samba-vscan/symantec vscan-symantec.c,1.36.2.5,1.36.2.6 vscan-symantec.conf,1.8.2.4,1.8.2.5 vscan-symantec_core.c,1.11.2.3,1.11.2.4

Rainer Link <[email protected]> Sun, 10 Apr 2005 15:22:56 +0000
Newsgroups gmane.comp.security.virus.openantivirus.cvs
Message-ID <[email protected]>
Update of /cvsroot/openantivirus/samba-vscan/symantec
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8392/symantec

Modified Files:
      Tag: VSCAN_0_3
	vscan-symantec.c vscan-symantec.conf vscan-symantec_core.c 
Log Message:
use file regexp stuff
modified some syslog satements to contain the INFO tag
some other small changes


Index: vscan-symantec.conf
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/symantec/vscan-symantec.conf,v
retrieving revision 1.8.2.4
retrieving revision 1.8.2.5
diff -u -d -r1.8.2.4 -r1.8.2.5
--- vscan-symantec.conf	7 Dec 2004 21:57:27 -0000	1.8.2.4
+++ vscan-symantec.conf	10 Apr 2005 15:22:54 -0000	1.8.2.5
@@ -58,5 +58,9 @@
 ; seperated list (default: empty list). Use this with care!
 exclude file types =
 
+; exclude files from being scanned via regular expression (PCRE)
+; (default: empty)
+exclude file regexp =
+
 ; IP:port Symantec CarrierScan listens on
 cs ip port = 127.0.0.1:7777

Index: vscan-symantec.c
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/symantec/vscan-symantec.c,v
retrieving revision 1.36.2.5
retrieving revision 1.36.2.6
diff -u -d -r1.36.2.5 -r1.36.2.6
--- vscan-symantec.c	23 Feb 2005 02:49:40 -0000	1.36.2.5
+++ vscan-symantec.c	10 Apr 2005 15:22:54 -0000	1.36.2.6
@@ -142,7 +142,9 @@
 	DEBUG(5, ("init file type\n"));
 	filetype_init(0, vscan_config.common.exclude_file_types);
 
-
+        /* initialise file regexp */
+        DEBUG(5, ("init file regexp\n"));
+        fileregexp_init(vscan_config.common.exclude_file_regexp);
 
 	#if (SMB_VFS_INTERFACE_VERSION >= 6)
 	 return SMB_VFS_NEXT_CONNECT(handle, conn, svc, user);
@@ -226,9 +228,13 @@
 #else
 		return default_vfs_ops.open(conn, fname, flags, mode);
 #endif
+        else if ( fileregexp_skipscan(filepath) == VSCAN_FR_SKIP_SCAN ) {
+                if ( vscan_config.common.verbose_file_logging )
+                        vscan_syslog("INFO: file '%s' not scanned as file is machted by exclude regexp", filepath);
+        }
 	else if ( filetype_skipscan(filepath) == VSCAN_FT_SKIP_SCAN ) {
 		if ( vscan_config.common.verbose_file_logging )
-			vscan_syslog("File '%s' not scanned as file type is on exclude list", filepath);
+			vscan_syslog("INFO: file '%s' not scanned as file type is on exclude list", filepath);
 #if (SMB_VFS_INTERFACE_VERSION >= 6)
                 return SMB_VFS_NEXT_OPEN(handle, conn, fname, flags, mode);
 #else
@@ -366,6 +372,12 @@
 		return retval;
 	}
 
+        /* dont' scan file which matches exclude regexp */
+        if ( fileregexp_skipscan(filepath) == VSCAN_FR_SKIP_SCAN ) {
+                if ( vscan_config.common.verbose_file_logging )
+                        vscan_syslog("INFO: file '%s' not scanned as file is machted by exclude regexp", filepath);
+                return retval;
+        }
 
 	/* don't scan files which are in the list of exclude file types */
 	if ( filetype_skipscan(filepath) == VSCAN_FT_SKIP_SCAN ) {

Index: vscan-symantec_core.c
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/symantec/vscan-symantec_core.c,v
retrieving revision 1.11.2.3
retrieving revision 1.11.2.4
diff -u -d -r1.11.2.3 -r1.11.2.4
--- vscan-symantec_core.c	25 Sep 2004 12:27:08 -0000	1.11.2.3
+++ vscan-symantec_core.c	10 Apr 2005 15:22:54 -0000	1.11.2.4
@@ -6,6 +6,9 @@
  * Copyright (C) Rainer Link, 2001-2004
  *               OpenAntiVirus.org <rainer-pBPPa8WU5k41Tgt60Rntydi2O/[email protected]>
  *
+ * based on the sample CarrierScan client from the Symantec documentation
+ * Copyright (C) Symantec Corporation, 2000, 2001
+ *
  * This software is licensed under the GNU General Public License (GPL)
  * See: http://www.gnu.org/copyleft/gpl.html
  *
@@ -34,7 +37,7 @@
 
         if ( ScanClientStartUp( &scanclient, pszStartUpString) > 0 ) 
         {
-                vscan_syslog("ERROR in ScanClientStartUp (IP:port: '%s')\n", cs_ip_port);
+                vscan_syslog("ERROR: problem in ScanClientStartUp (IP:port: '%s')\n", cs_ip_port);
         	cscan_ok = FALSE;        
         }
 
@@ -52,7 +55,7 @@
 	ScanResultGetProblem( hResults, 0, SC_PROBLEM_VIRUSNAME, virusName, &attrib_size ); 
 
 	
-        vscan_syslog_alert("ALERT - Scan result: '%s' infected with virus '%s', client: '%s'", infected_file, virusName, client_ip);
+        vscan_syslog_alert("ALERT: Scan result: '%s' infected with virus '%s', client: '%s'", infected_file, virusName, client_ip);
 	if ( send_warning_message )
 		vscan_send_warning_message(infected_file, virusName, client_ip);
 
@@ -70,12 +73,12 @@
 
 
 	if ( verbose_file_logging )
-	        vscan_syslog("Scanning file : '%s'", scan_file);
+	        vscan_syslog("INFO: Scanning file : '%s'", scan_file);
 
 	answer = ScanClientScanFile(scanclient, scan_file, scan_file, NULL, "", &results); 
         if( answer > 0 )
         { 
-                vscan_syslog("**** ERROR! Couldn't scan file %s\n", scan_file); 
+                vscan_syslog("ERROR: Couldn't scan file %s\n", scan_file); 
                 return VSCAN_SCAN_ERROR;
         }
 
@@ -113,6 +116,6 @@
 
 	ScanClientShutDown(scanclient); 
 
-        vscan_syslog("C API for CarrierScan cleaned up and released/terminated");
+        vscan_syslog("INFO: C API for CarrierScan cleaned up and released/terminated");
 
 }



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click