Update of /cvsroot/openantivirus/samba-vscan/clamav
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31801
Modified Files:
Tag: VSCAN_0_3
vscan-clamav.c vscan-clamav.conf vscan-clamav.h
vscan-clamav_core.c
Log Message:
improved libclamav support: limits are now compilte-time/runtime setting
options
Index: vscan-clamav.c
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/clamav/vscan-clamav.c,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- vscan-clamav.c 1 Dec 2003 13:20:40 -0000 1.1.2.3
+++ vscan-clamav.c 1 Mar 2004 10:03:49 -0000 1.1.2.4
@@ -158,6 +158,23 @@
#endif
} else if ( StrCaseCmp("exclude file types", param) == 0 ) {
pstrcpy(exclude_file_types, value);
+ DEBUG(3, ("exclude file types is: %s\n", exclude_file_types));
+
+#ifdef LIBCLAMAV
+ } else if ( StrCaseCmp("libclamav max files in archive", param) == 0 ) {
+ /* sanity check? */
+ clamav_limits.maxfiles = atoi(value);
+ DEBUG(3, ("libclamav maxfiles limit is: %i\n", clamav_limits.maxfiles));
+ } else if ( StrCaseCmp("libclamav max archived file size", param) == 0) {
+ /* sanity check? */
+ clamav_limits.maxfilesize = atol(value);
+ DEBUG(3, ("libclamav max archived files limit is: %li\n", clamav_limits.maxfilesize));
+ } else if ( StrCaseCmp("libclamav max recursion level", param) == 0 ) {
+ /* sanity check? */
+ clamav_limits.maxreclevel = atoi(value);
+ DEBUG(3, ("libclamav max recursion level limit is: %i\n", clamav_limits.maxreclevel));
+
+#endif
} else
DEBUG(3, ("unknown parameter: %s\n", param));
@@ -218,7 +235,7 @@
send_warning_message = VSCAN_SEND_WARNING_MESSAGE;
/* name of clamd socket */
- fstrcpy(clamd_socket_name, CLAMD_SOCKET_NAME);
+ fstrcpy(clamd_socket_name, VSCAN_CLAMD_SOCKET_NAME);
/* set default value for maximum lrufile entries */
max_lrufiles = VSCAN_MAX_LRUFILES;
@@ -229,6 +246,14 @@
/* file type exclude ist */
pstrcpy(exclude_file_types, VSCAN_FT_EXCLUDE_LIST);
+#ifdef LIBCLAMAV
+ memset(&clamav_limits, 0, sizeof(struct cl_limits));
+
+ clamav_limits.maxfiles = VSCAN_CL_MAXFILES;
+ clamav_limits.maxfilesize = VSCAN_CL_MAXFILESIZE;
+ clamav_limits.maxreclevel = VSCAN_CL_MAXRECLEVEL;
+ #endif
+
vscan_syslog("INFO: connect to service %s by user %s",
svc, user);
Index: vscan-clamav.conf
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/clamav/vscan-clamav.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-clamav.conf 12 Sep 2003 09:46:20 -0000 1.1.2.2
+++ vscan-clamav.conf 1 Mar 2004 10:03:49 -0000 1.1.2.3
@@ -60,3 +60,16 @@
; socket name of clamd (default: /var/run/clamd)
clamd socket name = /var/run/clamd
+
+; limits, if vscan-clamav is build for using the clamav library (libclamav)
+; instead of clamd
+
+; maximum number of files in archive (default: 1000)
+libclamav max files in archive = 1000
+
+; maximum archived file sitze, in bytes (default: 10 MB)
+libclamav max archived file size = 10 * 1048576
+
+; maximum recursion level (default: 5)
+libclamav max recursion level = 5
+
Index: vscan-clamav.h
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/clamav/vscan-clamav.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- vscan-clamav.h 1 Dec 2003 13:20:40 -0000 1.1.2.3
+++ vscan-clamav.h 1 Mar 2004 10:03:49 -0000 1.1.2.4
@@ -5,9 +5,17 @@
/* Configuration Section :-) */
-/* Clam AntiVirus stuff:
+/* Clam AntiVirus (clamd) stuff:
socket name of Clam daemon */
-#define CLAMD_SOCKET_NAME "/var/run/clamd"
+#define VSCAN_CLAMD_SOCKET_NAME "/var/run/clamd"
+
+/* Clam AntiVirus (libclamav) stuff:
+ maximum number of files in archive */
+#define VSCAN_CL_MAXFILES 1000
+/* maximum archived file size (in bytes) */
+#define VSCAN_CL_MAXFILESIZE 10485670
+/* maximum recursion level */
+#define VSCAN_CL_MAXRECLEVEL 5
/* default location of samba-style configuration file (needs Samba >= 2.2.4
or Samba 3.0 */
Index: vscan-clamav_core.c
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/clamav/vscan-clamav_core.c,v
retrieving revision 1.5.2.3
retrieving revision 1.5.2.4
diff -u -d -r1.5.2.3 -r1.5.2.4
--- vscan-clamav_core.c 29 Feb 2004 20:29:08 -0000 1.5.2.3
+++ vscan-clamav_core.c 1 Mar 2004 10:03:49 -0000 1.5.2.4
@@ -48,12 +48,6 @@
/* build the trie */
cl_buildtrie(clamav_root);
- /* FIXME: this should be configurable */
- /* set up archive limits */
- clamav_limits.maxfiles = 1000; /* max files */
- clamav_limits.maxfilesize = 10 * 1048576; /* maximal archived file size == 10 Mb */
- clamav_limits.maxreclevel = 8; /* maximal recursion level */
-
}
}
#endif /* LIBCLAMAV */
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.