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

Ian Macdonald secsnortdev at ...1490...
Wed Oct 16 06:46:02 EDT 2002


Yikes, that what I get for rushing it. I did a  copy and paste and screwed
up, I did the compile on a windows box but did the diff from a linux box.

You are right about the typo on the ifdef

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>

Thanks for the good eyes


Ian

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);


----- Original Message -----
From: "Frank Knobbe" <fknobbe at ...337...>
To: "Ian Macdonald" <secsnortdev at ...1490...>
Cc: <snort-devel at lists.sourceforge.net>
Sent: Tuesday, October 15, 2002 5:41 PM
Subject: Re: [Snort-devel] Patch for fixing fully qualified log path
inportscan2 for Win32






More information about the Snort-devel mailing list