[prev in list] [next in list] [prev in thread] [next in thread] 

List:       os-sim-commits
Subject:    [Os-sim-commits] agent/ossim_agent ParserSnort.py,1.10,1.11
From:       Alberto Roman Linacero <alberto_r () users ! sourceforge ! net>
Date:       2008-10-27 18:47:31
Message-ID: E1KuX7j-0006pa-GT () 23jxhf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Update of /cvsroot/os-sim/agent/ossim_agent
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26105

Modified Files:
	ParserSnort.py 
Log Message:
- fixed a snort thread crash when some snort.123456789 file is removed from the snort \
                log directory while the agent is running
- fixed a snort problem (it didn't read files) when the snort log directory is empty \
and snort is started after the ossim-agent


Index: ParserSnort.py
===================================================================
RCS file: /cvsroot/os-sim/agent/ossim_agent/ParserSnort.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- ParserSnort.py	17 Jan 2008 10:30:46 -0000	1.10
+++ ParserSnort.py	27 Oct 2008 18:47:29 -0000	1.11
@@ -254,16 +254,8 @@
             timestamp = f[f.rindex('.')+1:]
             f = os.path.join(self._dir,f)
 
-            ## FIXME:
-            ## self._timestamp is not declared if log directory
-            ## is empty (init_log_dir->len(dircontents))
-            ## need to be tested
-            #
-            #if not hasattr(self, "_timestamp"):
-            #    self._logdir.append(f)
-            #    self._timestamp = timestamp
-            #elif timestamp>self._timestamp and f not in self._logdir:
-            #    self._logdir.append(f)
+            if not hasattr(self, "_timestamp"): #log directory is empty \
(init_log_dir->len(dircontents) could be also tested) +                \
self._timestamp = 0  
             if timestamp>self._timestamp and f not in self._logdir:
                 self._logdir.append(f)
@@ -292,7 +284,10 @@
                     self._currentfile = self._logdir[0]
                     del self._logdir[0]
                     self._timestamp = \
                self._currentfile[self._currentfile.rindex('.')+1:]
-                    self._fd =  open(self._currentfile,"r")
+                    try:
+                        self._fd =  open(self._currentfile,"r")
+                    except IOError:
+                        logger.error("Error reading file %s : it doesn't exists" % \
self._currentfile)  logger.debug("Open file %s " % self._currentfile)
                     self._hdrread = False
             # Read the header


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Os-sim-commits mailing list
Os-sim-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/os-sim-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic