samba3-vscan/antivir vscan-antivir_core.c,1.2,1.3
Rainer Link <[email protected]> Wed, 12 Apr 2006 09:21:55 +0000
| Newsgroups | gmane.comp.security.virus.openantivirus.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/openantivirus/samba3-vscan/antivir
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11996/antivir
Modified Files:
vscan-antivir_core.c
Log Message:
bugfix to avoid connection issues, if the startup of the antivir server
takes a little bit longer than expect. Provided by Avira
Index: vscan-antivir_core.c
===================================================================
RCS file: /cvsroot/openantivirus/samba3-vscan/antivir/vscan-antivir_core.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- vscan-antivir_core.c 23 Jul 2005 14:47:44 -0000 1.2
+++ vscan-antivir_core.c 12 Apr 2006 09:21:53 -0000 1.3
@@ -194,11 +194,17 @@
request = NULL;
/* get response (in a loop, we might have to skip some lines) */
- do {
+ while (1) {
+ /* get another input line */
memset(buff, 0, sizeof(buff));
p1 = fgets((char *)&buff, sizeof(buff), antivir_file_read);
- if (p1 == NULL)
- break;
+ if (p1 == NULL) {
+ /* read error or EOF, close the scanner process */
+ disconnect_from_scanner();
+ vscan_syslog("ERROR: can not get result from antivir");
+ return VSCAN_SCAN_ERROR;
+ }
+
/* remove trailing spaces */
p1 = buff + strlen(buff);
while ((p1 > buff) && (isspace((int)*(p1-1)))) {
@@ -250,12 +256,8 @@
/* FIXME: should this really reported as minor error? */
return VSCAN_SCAN_MINOR_ERROR;
}
- } while (0);
-
- /* read error or EOF, close the scanner process */
- disconnect_from_scanner();
-
- vscan_syslog("ERROR: can not get result from antivir");
+ }
+ /* UNREACH */
return VSCAN_SCAN_ERROR;
}
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642