[Snort-devel] Patch for fixing fully qualified log path inportscan2 for Win32

Frank Knobbe fknobbe at ...337...
Wed Oct 16 07:59:05 EDT 2002


On Wed, 2002-10-16 at 08:45, Ian Macdonald wrote:
> [...]
> I still think it should be #ifdef.
> <sudo code>
>     If windows box check that the second character of the path argument is a
> :
>             then
>                     copy the fully qualified log path
>     else check the first character of the path argument is a /
>             then
>                     copy the fully qualified log path.
> </sudo code>


But shouldn't the log file contain a : if the platform is *nix, and a \
if the platform is Windows?


Frank


> diff -Naur snort-1.9.0.orig/src/preprocessors/spp_portscan2.c
> snort-1.9.0/src/pr
> eprocessors/spp_portscan2.c
> --- snort-1.9.0.orig/src/preprocessors/spp_portscan2.c  Wed Sep 25 15:46:58
> 2002
> +++ snort-1.9.0/src/preprocessors/spp_portscan2.c       Tue Oct 15 15:08:05
> 2002
> @@ -307,8 +307,13 @@
>              {
>                  if(isascii((int)(stoks[1][0])))
>                  {
> +#ifdef WIN32
> +                    if (stoks[1][1] == ':')
> +                        strncpy (logpath, stoks[1], STD_BUF);
> +#else
>                      if (stoks[1][0] == '/')
>                          strncpy (logpath, stoks[1], STD_BUF);
> +#endif
>                      else
>                      {
>                          strncpy(logpath, pv.log_dir, STD_BUF);
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
URL: <https://lists.snort.org/pipermail/snort-devel/attachments/20021016/758c47df/attachment.sig>


More information about the Snort-devel mailing list