SOURCES: exim-malware-timeout.patch (NEW), exim-clamav-timeout.pat...

arekm arekm at pld-linux.org
Tue Jun 13 18:42:12 CEST 2006


Author: arekm                        Date: Tue Jun 13 16:42:12 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- updated

---- Files affected:
SOURCES:
   exim-malware-timeout.patch (NONE -> 1.1)  (NEW), exim-clamav-timeout.patch (1.1 -> NONE)  (REMOVED)

---- Diffs:

================================================================
Index: SOURCES/exim-malware-timeout.patch
diff -u /dev/null SOURCES/exim-malware-timeout.patch:1.1
--- /dev/null	Tue Jun 13 18:42:12 2006
+++ SOURCES/exim-malware-timeout.patch	Tue Jun 13 18:42:07 2006
@@ -0,0 +1,66 @@
+diff -urN exim-4.62.org/src/malware.c exim-4.62/src/malware.c
+--- exim-4.62.org/src/malware.c	2006-04-28 12:32:22.000000000 +0200
++++ exim-4.62/src/malware.c	2006-06-13 18:41:29.000000000 +0200
+@@ -20,6 +20,8 @@
+ #define SHUT_WR 1
+ #endif
+ 
++#define	MALWARE_TIMEOUT             120
++
+ #define DRWEBD_SCAN_CMD             (1)     /* scan file, buffer or diskfile */
+ #define DRWEBD_RETURN_VIRUSES       (1<<0)   /* ask daemon return to us viruses names from report */
+ #define DRWEBD_IS_MAIL              (1<<19)  /* say to daemon that format is "archive MAIL" */
+@@ -557,7 +559,7 @@
+           return DEFER;
+         };
+ 
+-        bread = read(sock, av_buffer, sizeof(av_buffer));
++        bread = ip_recv(sock, av_buffer, sizeof(av_buffer), MALWARE_TIMEOUT);
+         if (bread >0) av_buffer[bread]='\0';
+         if (bread < 0) {
+           (void)close(sock);
+@@ -591,7 +593,7 @@
+         i = 0;
+         memset(av_buffer, 0, sizeof(av_buffer));
+         do {
+-          bread=read(sock, &av_buffer[i], 1);
++          bread=ip_recv(sock, &av_buffer[i], 1, MALWARE_TIMEOUT);
+           if (bread < 0) {
+             (void)close(sock);
+             log_write(0, LOG_MAIN|LOG_PANIC,
+@@ -976,7 +978,7 @@
+ 
+       /* wait for result */
+       memset(av_buffer, 0, sizeof(av_buffer));
+-      if ((!(bread = read(sock, av_buffer, sizeof(av_buffer))) > 0)) {
++      if ((!(bread = ip_recv(sock, av_buffer, sizeof(av_buffer), MALWARE_TIMEOUT)) > 0)) {
+         (void)close(sock);
+         log_write(0, LOG_MAIN|LOG_PANIC,
+              "malware acl condition: unable to read from sophie UNIX socket (%s)", sophie_options);
+@@ -1098,7 +1100,7 @@
+             return DEFER;
+           }
+           memset(av_buffer2, 0, sizeof(av_buffer2));
+-          bread = read(sock, av_buffer2, sizeof(av_buffer2));
++          bread = ip_recv(sock, av_buffer2, sizeof(av_buffer2), 60);
+ 
+           if (bread < 0) {
+             log_write(0, LOG_MAIN|LOG_PANIC,
+@@ -1171,7 +1173,7 @@
+       return DEFER;
+     }
+ 
+-    result = read (clam_fd, clamav_fbuf, fsize);
++    result = ip_recv (clam_fd, clamav_fbuf, fsize, MALWARE_TIMEOUT);
+     if (result == -1) {
+       (void)close(sockData);
+       (void)close(clam_fd);
+@@ -1238,7 +1240,7 @@
+ 
+       /* Read the result */
+       memset(av_buffer, 0, sizeof(av_buffer));
+-      bread = read(sock, av_buffer, sizeof(av_buffer));
++      bread = ip_recv(sock, av_buffer, sizeof(av_buffer), MALWARE_TIMEOUT);
+       (void)close(sock);
+ 
+       if (!(bread  > 0)) {
================================================================


More information about the pld-cvs-commit mailing list