samba-vscan/clamav vscan-clamav.c,1.1.2.4,1.1.2.5 vscan-clamav.h,1.1.2.4,1.1.2.5 vscan-clamav_core.c,1.5.2.5,1.5.2.6

Rainer Link <[email protected]> Wed, 08 Sep 2004 16:13:22 +0000
Newsgroups gmane.comp.security.virus.openantivirus.cvs
Message-ID <[email protected]>
Update of /cvsroot/openantivirus/samba-vscan/clamav
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25633

Modified Files:
      Tag: VSCAN_0_3
	vscan-clamav.c vscan-clamav.h vscan-clamav_core.c 
Log Message:
some fixes for libclamav support by Helmut Heinreichsberger
(note: there was an interface change for cl_scanfile after clamav 0.65)


Index: vscan-clamav.h
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/clamav/vscan-clamav.h,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -d -r1.1.2.4 -r1.1.2.5
--- vscan-clamav.h	1 Mar 2004 10:03:49 -0000	1.1.2.4
+++ vscan-clamav.h	8 Sep 2004 16:13:19 -0000	1.1.2.5
@@ -94,10 +94,13 @@
 void vscan_clamav_lib_done();
 
 
+#ifdef LIBCLAMAV
+int vscan_clamav_scanfile_lib(char* scan_file, char* client_ip);
+#else
 /* scans a file */
 int vscan_clamav_scanfile(int sockfd, char *scan_file, char *client_ip);
 /* closes socket */
 void vscan_clamav_end(int sockfd);
-
+#endif
 
 #endif /* __VSCAN_CLAMAV_H_ */ 

Index: vscan-clamav.c
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/clamav/vscan-clamav.c,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -d -r1.1.2.4 -r1.1.2.5
--- vscan-clamav.c	1 Mar 2004 10:03:49 -0000	1.1.2.4
+++ vscan-clamav.c	8 Sep 2004 16:13:19 -0000	1.1.2.5
@@ -345,7 +345,9 @@
 {
 	int retval, must_be_checked;
 	SMB_STRUCT_STAT stat_buf;
+#ifndef LIBCLAMAV
 	int sockfd;
+#endif
 	pstring filepath;
 	char client_ip[CLIENT_IP_SIZE];
 
@@ -469,7 +471,7 @@
                         } else if ( retval == -1 && deny_access_on_error ) {
 			/* an error occured - can not communicate to daemon - deny access */
                                 vscan_syslog("ERROR: can not communicate to clamd - access to file %s denied", fname);
-#ifdef LIBCLAMAV
+#ifndef LIBCLAMAV
 				vscan_clamav_end(sockfd);
 #endif
 				/* to be safe, remove file from lrufiles */

Index: vscan-clamav_core.c
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/clamav/vscan-clamav_core.c,v
retrieving revision 1.5.2.5
retrieving revision 1.5.2.6
diff -u -d -r1.5.2.5 -r1.5.2.6
--- vscan-clamav_core.c	2 May 2004 19:45:31 -0000	1.5.2.5
+++ vscan-clamav_core.c	8 Sep 2004 16:13:19 -0000	1.5.2.6
@@ -66,7 +66,7 @@
 /*
   If virus is found, logs the filename/virusname into syslog
 */
-void vscan_clamav_log_virus(char *infected_file, char *results, char *client_ip)
+void vscan_clamav_log_virus(const char *infected_file, const char *results, const char *client_ip)
 {
 
     vscan_syslog_alert("ALERT - Scan result: '%s' infected with virus '%s', client: '%s'", infected_file, results, client_ip);
@@ -81,9 +81,10 @@
 */
 int vscan_clamav_scanfile_lib(char* scan_file, char* client_ip)
 {
-    int ret, no = 0;
+    int ret;
     unsigned long int size = 0;
-    char* virname;
+    /* interface change sometime after 0.65 release */
+    const char* virname;
 
     ret = cl_scanfile(scan_file, &virname, &size, clamav_root, &clamav_limits, CL_ARCHIVE);
     if ( ret == CL_CLEAN ) {    /* no virus found */



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click