samba-vscan/antivir vscan-antivir.c,1.1.2.2,1.1.2.3 vscan-antivir.conf,1.1.2.2,1.1.2.3 vscan-antivir.h,1.1.2.1,1.1.2.2 vscan-antivir_core.c,1.1.2.2,1.1.2.3

Rainer Link <[email protected]> Tue, 18 Jan 2005 20:03:17 +0000
Newsgroups gmane.comp.security.virus.openantivirus.cvs
Message-ID <[email protected]>
Update of /cvsroot/openantivirus/samba-vscan/antivir
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27996

Modified Files:
      Tag: VSCAN_0_3
	vscan-antivir.c vscan-antivir.conf vscan-antivir.h 
	vscan-antivir_core.c 
Log Message:
modifications for 0.3.6 release (use framework for parsing configuration)


Index: vscan-antivir.h
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/antivir/Attic/vscan-antivir.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- vscan-antivir.h	17 Nov 2004 19:21:04 -0000	1.1.2.1
+++ vscan-antivir.h	18 Jan 2005 20:03:14 -0000	1.1.2.2
@@ -5,6 +5,12 @@
 
 /* Configuration Section :-) */
 
+/* default location of samba-style configuration file (needs Samba >= 2.2.4
+ or Samba 3.0 */
+
+#define PARAMCONF "/etc/samba/vscan-antivir.conf"
+
+/* H+BEDV AntiVir related stuff */
 /* program name for scanner process */
 #define VSCAN_ANTIVIR_PROGRAM_NAME	"/usr/lib/AntiVir/antivir"
 
@@ -25,73 +31,6 @@
 #define VSCAN_AVDETECT_SPY		0
 #define VSCAN_AVDETECT_ALLTYPES		0
 
-/* default location of samba-style configuration file (needs Samba >= 2.2.4
- or Samba 3.0 */
-
-#define PARAMCONF "/etc/samba/vscan-antivir.conf"
-
-
-/* False = log only concerning file, True = log every file access */
-
-#ifndef VSCAN_VERBOSE_FILE_LOGGING
-# define VSCAN_VERBOSE_FILE_LOGGING False
-#endif
-
-/* if a file is bigger than VSCAN_MAX_SIZE it won't be scanned. Has to be
-   specified in bytes! If it set to 0, the file size check is disabled */
-
-#ifndef VSCAN_MAX_SIZE
-# define VSCAN_MAX_SIZE 0
-#endif
-
-/* True = scan files on open */
-
-#ifndef VSCAN_SCAN_ON_OPEN
-# define VSCAN_SCAN_ON_OPEN True
-#endif
-
-/* True = scan files on close */
-
-#ifndef VSCAN_SCAN_ON_CLOSE
-# define VSCAN_SCAN_ON_CLOSE True
-#endif
-
-/* True = deny access in case of scanning failure */
-
-#ifndef VSCAN_DENY_ACCESS_ON_ERROR
-# define VSCAN_DENY_ACCESS_ON_ERROR True
-#endif
-
-/* True = deny access in case of minor scanning failure */
-
-#ifndef VSCAN_DENY_ACCESS_ON_MINOR_ERROR
-# define VSCAN_DENY_ACCESS_ON_MINOR_ERROR True
-#endif
-
-/* True = send a warning message via window messenger service for alerts found */
-
-#ifndef VSCAN_SEND_WARNING_MESSAGE
-# define VSCAN_SEND_WARNING_MESSAGE True
-#endif
-
-/* default concerning file action */
-#define VSCAN_INFECTED_FILE_ACTION INFECTED_QUARANTINE
-
-/* default quarantine settings; hopefully the user changes this */
-#define VSCAN_QUARANTINE_DIRECTORY	"/tmp"
-#define VSCAN_QUARANTINE_PREFIX		"vir-"
-
-/* set default value for maximum lrufile entries */
-#define VSCAN_MAX_LRUFILES 100
-
-/* time after an entry is considered as expired */
-#define VSCAN_LRUFILES_INVALIDATE_TIME 5
-
-/* MIME-types of files to be exluded from scanning; that's an
-   semi-colon seperated list */
-#define VSCAN_FT_EXCLUDE_LIST ""
-
-
 /* End Configuration Section */
 
 /* functions by vscan-antivir_core */

Index: vscan-antivir_core.c
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/antivir/Attic/vscan-antivir_core.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- vscan-antivir_core.c	17 Jan 2005 20:43:09 -0000	1.1.2.2
+++ vscan-antivir_core.c	18 Jan 2005 20:03:14 -0000	1.1.2.3
@@ -3,7 +3,7 @@
  *
  * Core Interface for the H+BEDV AntiVir Scanner
  *
- * Copyright (C) Rainer Link, 2001-2002
+ * Copyright (C) Rainer Link, 2001-2005
  *               OpenAntiVirus.org <rainer-pBPPa8WU5k41Tgt60Rntydi2O/[email protected]>
  *               Dariusz Markowicz <[email protected]>, 2003
  *               H+BEDV Datentechnik GmbH <[email protected]>, 2004

Index: vscan-antivir.conf
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/antivir/Attic/vscan-antivir.conf,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- vscan-antivir.conf	7 Dec 2004 21:57:23 -0000	1.1.2.2
+++ vscan-antivir.conf	18 Jan 2005 20:03:14 -0000	1.1.2.3
@@ -36,7 +36,7 @@
 ; quarantine: try to move to quantine directory
 ; delete:     delete concerning file
 ; nothing:    do nothing (default)
-concerning file action = quarantine
+infected file action = quarantine
 
 ; where to put concerning files - you really want to change this!
 quarantine directory  = /tmp

Index: vscan-antivir.c
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/antivir/Attic/vscan-antivir.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- vscan-antivir.c	17 Jan 2005 20:43:07 -0000	1.1.2.2
+++ vscan-antivir.c	18 Jan 2005 20:03:07 -0000	1.1.2.3
@@ -4,7 +4,7 @@
  * virusscanning VFS module for samba.  Log concerning files via syslog
  * facility and block access using the H+BEDV AntiVir scanner.
  *
- * Copyright (C) Rainer Link, 2001-2003
+ * Copyright (C) Rainer Link, 2001-2005
  *               OpenAntiVirus.org <rainer-pBPPa8WU5k41Tgt60Rntydi2O/[email protected]>
  *               Dariusz Markowicz <[email protected]>, 2003
  * Copyright (C) Stefan (metze) Metzmacher, 2003
@@ -46,46 +46,12 @@
 
 #define VSCAN_MODULE_STR "vscan-antivir"
 
-fstring config_file;            /* location of config file, either
-                                   PARAMCONF or as set via vfs options
-                                */
-
-ssize_t max_size;          	/* do not scan files greater than max_size
-                                   if max_size = 0, scan any file
-                                */
+vscan_config_struct vscan_config; /* contains the vscan module configuration */
 
 BOOL verbose_file_logging;  	/* log ever file access */
-
-BOOL scan_on_open;         	/* scan a file before it is opened
-                                   Defaults to True
-                                */
-
-BOOL scan_on_close;        	/* scan a new file put on share or
-                                   if file was modified
-                                   Defaults to True
-                                */
-
-BOOL deny_access_on_error;	/* if communication to the scanner fails,
-				   should access to any file be denied? */
-
-BOOL deny_access_on_minor_error; /* if daemon returns non-critical error,
-                                    should access to the file be denied? */
-
 BOOL send_warning_message;	/* send a warning message using the windows
 				   messenger service? */
 
-enum infected_file_action_enum concerning_file_action; /* what to do with concerning files;
-                                                        defaults to quarantine */
-
-fstring quarantine_dir;	/* directory for concerning files */
-fstring quarantine_prefix;	/* prefix    for concerning files */
-
-int max_lrufiles;               /* specified the maximum entries in lrufiles list */
-time_t lrufiles_invalidate_time; /* specified the time in seconds after the lifetime
-                                    of an entry is expired and entry will be invalidated */
-
-pstring exclude_file_types;	/* list of file types which should be excluded from scanning */
-
 fstring	antivir_program_name;	/* name of antivir executable */
 
 BOOL antivir_arch_scan_enable;  /* archive related settings for the AntiVir scanner */
@@ -106,94 +72,44 @@
 
 static BOOL do_parameter(const char *param, const char *value)
 {
-	if ( StrCaseCmp("max file size", param) == 0 ) {
-		max_size = atoll(value);
-		/* the %z format spec for size_t does not work :( */
-		DEBUG(3, ("max file size is: %lld\n", (long long)max_size));
-	} else if ( StrCaseCmp("verbose file logging", param) == 0 ) {
-		set_boolean(&verbose_file_logging, value);
-		DEBUG(3, ("verbose file logging is: %d\n", verbose_file_logging));
-	} else if ( StrCaseCmp("scan on open", param) == 0 ) {
-		set_boolean(&scan_on_open, value);
-		DEBUG(3, ("scan on open: %d\n", scan_on_open));
-	} else if ( StrCaseCmp("scan on close", param) == 0 ) {
-		set_boolean(&scan_on_close, value);
-		DEBUG(3, ("scan on close is: %d\n", scan_on_close));
-	} else if ( StrCaseCmp("deny access on error", param) == 0 ) {
-		set_boolean(&deny_access_on_error, value);
-		DEBUG(3, ("deny access on error is: %d\n", deny_access_on_error));
-	} else if ( StrCaseCmp("deny access on minor error", param) == 0 ) {
-		set_boolean(&deny_access_on_minor_error, value);
-		DEBUG(3, ("deny access on minor error is: %d\n", deny_access_on_minor_error));
-	} else if ( StrCaseCmp("send warning message", param) == 0 ) {
-		set_boolean(&send_warning_message, value);
-		DEBUG(3, ("send warning message is: %d\n", send_warning_message));
-	} else if ((StrCaseCmp("concerning file action", param) == 0)
-#if 1 /* for compatibility */
-		|| (StrCaseCmp("infected file action", param) == 0)
-#endif
-	) {
-		if (StrCaseCmp("quarantine", value) == 0) {
-			concerning_file_action = INFECTED_QUARANTINE;
-		} else if (StrCaseCmp("delete", value) == 0) {
-			concerning_file_action = INFECTED_DELETE;
-		} else if (StrCaseCmp("nothing", value) == 0) {
-			concerning_file_action = INFECTED_DO_NOTHING;
-		} else {
-			DEBUG(2, ("samba-vscan: badly formed concerning file action in configuration file, parameter %s\n", value));
-		}
-		DEBUG(3, ("concerning file action is: %d\n", concerning_file_action));
-	} else if ( StrCaseCmp("quarantine directory", param) == 0 ) {
-		fstrcpy(quarantine_dir, value);
-		DEBUG(3, ("quarantine directory is: %s\n", quarantine_dir));
-	} else if ( StrCaseCmp("quarantine prefix", param) == 0 ) {
-		fstrcpy(quarantine_prefix, value);
-		DEBUG(3, ("quarantine prefix is: %s\n", quarantine_prefix));
-	} else if ( StrCaseCmp("max lru files entries", param) == 0 ) {
-		max_lrufiles = atoi(value);
-		DEBUG(3, ("max lru files entries is: %d\n", max_lrufiles));
-	} else if ( StrCaseCmp("lru file entry lifetime", param) == 0 ) {
-		lrufiles_invalidate_time = atol(value);
-		DEBUG(3, ("lru file entry lifetime is: %li\n", (long)lrufiles_invalidate_time));
-	} else if ( StrCaseCmp("exclude file types", param) == 0 ) {
-		pstrcpy(exclude_file_types, value);
-		DEBUG(3, ("exclude file types is: %s\n", exclude_file_types));
-	} else if ( StrCaseCmp("antivir program name", param) == 0) {
-		fstrcpy(antivir_program_name, value);
-		DEBUG(3, ("antivir program name is %s\n", antivir_program_name));
-	} else if ( StrCaseCmp("antivir scan in archive", param) == 0) {
-		set_boolean(&antivir_arch_scan_enable, value);
-		DEBUG(3, ("antivir scan in archive is %d\n", antivir_arch_scan_enable));
-	} else if ( StrCaseCmp("antivir max ratio in archive", param) == 0) {
-		antivir_arch_max_ratio = atoi(value);
-		DEBUG(3, ("antivir max ratio in archive is %d\n", antivir_arch_max_ratio));
-	} else if ( StrCaseCmp("antivir max archived file size", param) == 0) {
-		antivir_arch_max_size = atoll(value);
-		DEBUG(3, ("antivir max archived file size is %lld\n", (long long)antivir_arch_max_size));
-	} else if ( StrCaseCmp("antivir max recursion level", param) == 0) {
-		antivir_arch_max_recursion = atoi(value);
-		DEBUG(3, ("antivir max recursion level is %d\n", antivir_arch_max_recursion));
-	} else if ( StrCaseCmp("antivir detect dialer", param) == 0) {
-		set_boolean(&antivir_detect_dialer, value);
-		DEBUG(3, ("antivir detect dialer is %d\n", antivir_detect_dialer));
-	} else if ( StrCaseCmp("antivir detect game", param) == 0) {
-		set_boolean(&antivir_detect_game, value);
-		DEBUG(3, ("antivir detect game is %d\n", antivir_detect_game));
-	} else if ( StrCaseCmp("antivir detect joke", param) == 0) {
-		set_boolean(&antivir_detect_joke, value);
-		DEBUG(3, ("antivir detect joke is %d\n", antivir_detect_joke));
-	} else if ( StrCaseCmp("antivir detect pms", param) == 0) {
-		set_boolean(&antivir_detect_pms, value);
-		DEBUG(3, ("antivir detect pms is %d\n", antivir_detect_pms));
-	} else if ( StrCaseCmp("antivir detect spy", param) == 0) {
-		set_boolean(&antivir_detect_spy, value);
-		DEBUG(3, ("antivir detect spy is %d\n", antivir_detect_spy));
-	} else if ( StrCaseCmp("antivir detect alltypes", param) == 0) {
-		set_boolean(&antivir_detect_alltypes, value);
-		DEBUG(3, ("antivir detect alltypes is %d\n", antivir_detect_alltypes));
-	} else
-		DEBUG(3, ("unknown parameter: %s\n", param));
-		/* return False; ? */
+	if ( do_common_parameter(&vscan_config, param, value) == False ) {
+                /* parse VFS module specific configuration values */
+		if ( StrCaseCmp("antivir program name", param) == 0) {
+			fstrcpy(antivir_program_name, value);
+			DEBUG(3, ("antivir program name is %s\n", antivir_program_name));
+		} else if ( StrCaseCmp("antivir scan in archive", param) == 0) {
+			set_boolean(&antivir_arch_scan_enable, value);
+			DEBUG(3, ("antivir scan in archive is %d\n", antivir_arch_scan_enable));
+		} else if ( StrCaseCmp("antivir max ratio in archive", param) == 0) {
+			antivir_arch_max_ratio = atoi(value);
+			DEBUG(3, ("antivir max ratio in archive is %d\n", antivir_arch_max_ratio));
+		} else if ( StrCaseCmp("antivir max archived file size", param) == 0) {
+			antivir_arch_max_size = atoll(value);
+			DEBUG(3, ("antivir max archived file size is %lld\n", (long long)antivir_arch_max_size));
+		} else if ( StrCaseCmp("antivir max recursion level", param) == 0) {
+			antivir_arch_max_recursion = atoi(value);
+			DEBUG(3, ("antivir max recursion level is %d\n", antivir_arch_max_recursion));
+		} else if ( StrCaseCmp("antivir detect dialer", param) == 0) {
+			set_boolean(&antivir_detect_dialer, value);
+			DEBUG(3, ("antivir detect dialer is %d\n", antivir_detect_dialer));
+		} else if ( StrCaseCmp("antivir detect game", param) == 0) {
+			set_boolean(&antivir_detect_game, value);
+			DEBUG(3, ("antivir detect game is %d\n", antivir_detect_game));
+		} else if ( StrCaseCmp("antivir detect joke", param) == 0) {
+			set_boolean(&antivir_detect_joke, value);
+			DEBUG(3, ("antivir detect joke is %d\n", antivir_detect_joke));
+		} else if ( StrCaseCmp("antivir detect pms", param) == 0) {
+			set_boolean(&antivir_detect_pms, value);
+			DEBUG(3, ("antivir detect pms is %d\n", antivir_detect_pms));
+		} else if ( StrCaseCmp("antivir detect spy", param) == 0) {
+			set_boolean(&antivir_detect_spy, value);
+			DEBUG(3, ("antivir detect spy is %d\n", antivir_detect_spy));
+		} else if ( StrCaseCmp("antivir detect alltypes", param) == 0) {
+			set_boolean(&antivir_detect_alltypes, value);
+			DEBUG(3, ("antivir detect alltypes is %d\n", antivir_detect_alltypes));
+		} else
+			DEBUG(3, ("unknown parameter: %s\n", param));
+	}
 
 	return True;
 }
@@ -213,6 +129,10 @@
 static int vscan_connect(struct connection_struct *conn, PROTOTYPE_CONST char *svc, PROTOTYPE_CONST char *user)
 #endif
 {
+        fstring config_file;            /* location of config file, either
+                                           PARAMCONF or as set via vfs options
+                                        */
+
 	#if (SAMBA_VERSION_MAJOR==2 && SAMBA_VERSION_RELEASE>=4) || SAMBA_VERSION_MAJOR==3
 	 #if !(SMB_VFS_INTERFACE_VERSION >= 6)
 	  pstring opts_str;
@@ -228,35 +148,8 @@
 	/* set default value for configuration files */
 	fstrcpy(config_file, PARAMCONF);
 
-	/* set default value for max file size */
-	max_size = VSCAN_MAX_SIZE;
-
-	/* set default value for file logging */
-	verbose_file_logging = VSCAN_VERBOSE_FILE_LOGGING;
-
-	/* set default value for scan on open() */
-	scan_on_open = VSCAN_SCAN_ON_OPEN;
-
-	/* set default value for scan on close() */
-	scan_on_close = VSCAN_SCAN_ON_CLOSE;
-
-	/* set default value for deny access on error */
-	deny_access_on_error = VSCAN_DENY_ACCESS_ON_ERROR;
-
-	/* set default value for deny access on minor error */
-	deny_access_on_minor_error = VSCAN_DENY_ACCESS_ON_MINOR_ERROR;
-
-	/* set default value for send warning message */
-	send_warning_message = VSCAN_SEND_WARNING_MESSAGE;
-
-	/* set default value for maximum lrufile entries */
-	max_lrufiles = VSCAN_MAX_LRUFILES;
-
-	/* time after an entry is considered as expired */
-	lrufiles_invalidate_time = VSCAN_LRUFILES_INVALIDATE_TIME;
-
-	/* file type exclude ist */
-	pstrcpy(exclude_file_types, VSCAN_FT_EXCLUDE_LIST);
+        /* set default values */
+        set_common_default_settings(&vscan_config);
 
 	/* name of AntiVir executable file */
 	fstrcpy(antivir_program_name, VSCAN_ANTIVIR_PROGRAM_NAME);
@@ -279,46 +172,27 @@
 	       svc, user);
 
 	#if (SAMBA_VERSION_MAJOR==2 && SAMBA_VERSION_RELEASE>=4) || SAMBA_VERSION_MAJOR==3
-	 #if (SMB_VFS_INTERFACE_VERSION >= 6)
-	  fstrcpy(config_file, lp_parm_const_string(SNUM(conn),VSCAN_MODULE_STR,"config-file",PARAMCONF));
-	 #else
-	  pstrcpy(opts_str, (const char*) lp_vfs_options(SNUM(conn)));
-	  if( !*opts_str ) {
-		DEBUG(3, ("samba-vscan: no configuration file set - using default value (%s).\n", lp_vfs_options(SNUM(conn))));
-	  } else {
-		p = opts_str;
-		if ( next_token(&p, config_file, "=", sizeof(config_file)) ) {
-			trim_string(config_file, " ", " ");
-			if ( !strequal("config-file", config_file) ) {
-				DEBUG(3, ("samba-vscan - connect: options %s is not config-file\n", config_file));
-				/* setting default value */
-				fstrcpy(config_file, PARAMCONF);
 
-			} else {
-				if ( !next_token(&p, config_file," \n",sizeof(config_file)) ) {
-					DEBUG(3, ("samba-vscan - connect: no option after config-file=\n"));
-					/* setting default value */
-					fstrcpy(config_file, PARAMCONF);
-				} else {
-					trim_string(config_file, " ", " ");
-					DEBUG(3, ("samba-vscan - connect: config file name is %s\n", config_file));
-				}
-			}
-		}
-	  }
-	  #endif /*  #if (SMB_VFS_INTERFACE_VERSION >= 6)*/
-	  retval = pm_process(config_file, do_section, do_parameter);
-	  DEBUG(10, ("pm_process returned %d\n", retval));
+          fstrcpy(config_file, get_configuration_file(conn, VSCAN_MODULE_STR, PARAMCONF));
+          DEBUG(0, ("configuration file is: %s\n", config_file));
+
+          retval = pm_process(config_file, do_section, do_parameter);
+          DEBUG(10, ("pm_process returned %d\n", retval));
+
+          /* FIXME: this is lame! */
+          verbose_file_logging = vscan_config.common.verbose_file_logging;
+          send_warning_message = vscan_config.common.send_warning_message;
+
 	  if (!retval) vscan_syslog("ERROR: could not parse configuration file '%s'. File not found or not read-able. Using compiled-in defaults", config_file);
 	#endif
 
 	/* initialise lrufiles list */
 	DEBUG(5, ("init lrufiles list\n"));
-	lrufiles_init(max_lrufiles, lrufiles_invalidate_time);
+	lrufiles_init(vscan_config.common.max_lrufiles, vscan_config.common.lrufiles_invalidate_time);
 
 	/* initialise filetype */
 	DEBUG(5, ("init file type\n"));
-	filetype_init(0, exclude_file_types);
+	filetype_init(0, vscan_config.common.exclude_file_types);
 
 	/* tell core we have a(nother) session, ignore return code */
 	(void)vscan_antivir_connect();
@@ -373,7 +247,7 @@
 	pstrcat(filepath, fname);
 
 	/* scan files while opening? */
-	if ( !scan_on_open ) {
+	if ( !vscan_config.common.scan_on_open ) {
 		DEBUG(3, ("samba-vscan - open: File '%s' not scanned as scan_on_open is not set\n", fname));
 #if (SMB_VFS_INTERFACE_VERSION >= 6)
 		return SMB_VFS_NEXT_OPEN(handle, conn, fname, flags, mode);
@@ -395,7 +269,7 @@
 #else
 		return default_vfs_ops.open(conn, fname, flags, mode);
 #endif
-	else if ( ( stat_buf.st_size > max_size ) && ( max_size > 0 ) ) /* file is too large */
+	else if ( ( stat_buf.st_size > vscan_config.common.max_size ) && ( vscan_config.common.max_size > 0 ) ) /* file is too large */
 		vscan_syslog("INFO: File %s is larger than specified maximum file size! Not scanned!", fname);
 	else if ( stat_buf.st_size == 0 ) /* do not scan empty files */
 #if (SMB_VFS_INTERFACE_VERSION >= 6)
@@ -404,7 +278,7 @@
 		return default_vfs_ops.open(conn, fname, flags, mode);
 #endif
 	else if ( filetype_skipscan(filepath) == VSCAN_FT_SKIP_SCAN ) {
-		if ( verbose_file_logging )
+		if ( vscan_config.common.verbose_file_logging )
 			vscan_syslog("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);
@@ -416,7 +290,7 @@
 	{
 		/* prepare file scan, (re)open connection to the scanner */
 		sockfd = vscan_antivir_init();
-		if ( sockfd == -1 && deny_access_on_error ) {
+		if ( sockfd == -1 && vscan_config.common.deny_access_on_error ) {
 			/* an error occured - can not communicate to daemon - deny access */
 			vscan_syslog("ERROR: can not communicate to daemon - access denied");
 			errno = EACCES;
@@ -430,7 +304,7 @@
 			if ( must_be_checked == VSCAN_LRU_DENY_ACCESS ) {
 				/* file has already been checked and marked as containing an alert */
 				/* deny access */
-				if ( verbose_file_logging )
+				if ( vscan_config.common.verbose_file_logging )
 					vscan_syslog("File '%s' has already been scanned and marked as containing an alert. Not scanned any more. Access denied", filepath);
 
 				/* postprocess file scan */
@@ -441,7 +315,7 @@
 				return -1;
 			} else if ( must_be_checked == VSCAN_LRU_GRANT_ACCESS )  {
 				/* file has already been checked, not marked as containing an alert and not modified */
-				if ( verbose_file_logging )
+				if ( vscan_config.common.verbose_file_logging )
 					vscan_syslog("File '%s' has already been scanned, not marked as containing an alert and not modified. Not scanned anymore. Access granted", filepath);
 
 				/* postprocess file scan */
@@ -458,7 +332,7 @@
 
 			/* scan file */
 			retval = vscan_antivir_scanfile(sockfd, filepath, client_ip);
-			if ( retval == VSCAN_SCAN_MINOR_ERROR && deny_access_on_minor_error ) {
+			if ( retval == VSCAN_SCAN_MINOR_ERROR && vscan_config.common.deny_access_on_minor_error ) {
 				/* a minor error occured - deny access */
 				vscan_syslog("ERROR: daemon failed with a minor error - access to file %s denied", fname);
 				vscan_antivir_end(sockfd);
@@ -469,7 +343,7 @@
 				/* deny access */
 				errno = EACCES;
 				return -1;
-			} else if ( retval == VSCAN_SCAN_ERROR && deny_access_on_error ) {
+			} else if ( retval == VSCAN_SCAN_ERROR && vscan_config.common.deny_access_on_error ) {
 			/* an error occured - can not communicate to daemon - deny access */
 				vscan_syslog("ERROR: can not communicate to daemon - access to file %s denied", fname);
 				/* to be safe, remove file from lrufiles */
@@ -485,9 +359,9 @@
 				/* do action ... */
 
 #if (SMB_VFS_INTERFACE_VERSION >= 6)
-				rc = vscan_do_infected_file_action(handle, conn, filepath, quarantine_dir, quarantine_prefix, concerning_file_action);
+				rc = vscan_do_infected_file_action(handle, conn, filepath, vscan_config.common.quarantine_dir, vscan_config.common.quarantine_prefix, vscan_config.common.infected_file_action);
 #else
-				rc = vscan_do_infected_file_action(&default_vfs_ops, conn, filepath, quarantine_dir, quarantine_prefix, concerning_file_action);
+				rc = vscan_do_infected_file_action(&default_vfs_ops, conn, filepath, vscan_config.common.quarantine_dir, vscan_config.common.quarantine_prefix, vscan_config.common.infected_file_action);
 #endif
 
 				/* add/update file. mark file as containing an alert! */
@@ -530,7 +404,7 @@
 	retval = default_vfs_ops.close(fsp, fd);
 #endif
 
-	if ( !scan_on_close ) {
+	if ( !vscan_config.common.scan_on_close ) {
 		DEBUG(3, ("samba-vscan - close: File '%s' not scanned as scan_on_close is not set\n", fsp->fsp_name));
 		return retval;
 	}
@@ -547,7 +421,7 @@
 
 
 	if ( !fsp->modified ) {
-		if ( verbose_file_logging )
+		if ( vscan_config.common.verbose_file_logging )
 			vscan_syslog("INFO: file %s was not modified - not scanned", filepath);
 
 		return retval;
@@ -555,7 +429,7 @@
 
 	/* don't scan files which are in the list of exclude file types */
 	if ( filetype_skipscan(filepath) == VSCAN_FT_SKIP_SCAN ) {
-		if ( verbose_file_logging )
+		if ( vscan_config.common.verbose_file_logging )
 			vscan_syslog("File '%s' not scanned as file type is on exclude list", filepath);
 		return retval;
 	}
@@ -570,9 +444,9 @@
 		if ( rv == VSCAN_SCAN_VIRUS_FOUND ) {
 			/* alert was found */
 #if (SMB_VFS_INTERFACE_VERSION >= 6)
-			rc = vscan_do_infected_file_action(handle, fsp->conn, filepath, quarantine_dir, quarantine_prefix, concerning_file_action);
+			rc = vscan_do_infected_file_action(handle, fsp->conn, filepath, vscan_config.common.quarantine_dir, vscan_config.common.quarantine_prefix, vscan_config.common.infected_file_action);
 #else
-			rc = vscan_do_infected_file_action(&default_vfs_ops, fsp->conn, filepath, quarantine_dir, quarantine_prefix, concerning_file_action);
+			rc = vscan_do_infected_file_action(&default_vfs_ops, fsp->conn, filepath, vscan_config.common.quarantine_dir, vscan_config.common.quarantine_prefix, vscan_config.common.infected_file_action);
 #endif
 		}
 



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt