git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1315 77e5149b-7576-45b1-b177-96237e5ba77b
Nigel Horne authored on 2005/02/06 19:42:50... | ... |
@@ -676,6 +676,9 @@ Changes |
676 | 676 |
with, suggestion by "Hank Beatty" |
677 | 677 |
<hbeatty@starband.net> |
678 | 678 |
0.81g 2/2/05: Call watchdog if neither --external nor SESSION |
679 |
+0.82 6/2/05: On Solaris, ensure when quarantining a file that the |
|
680 |
+ old location is removed |
|
681 |
+ Up issue |
|
679 | 682 |
|
680 | 683 |
INTERNATIONALISATION |
681 | 684 |
|
... | ... |
@@ -26,6 +26,9 @@ |
26 | 26 |
* |
27 | 27 |
* Change History: |
28 | 28 |
* $Log: clamav-milter.c,v $ |
29 |
+ * Revision 1.177 2005/02/06 10:39:39 nigelhorne |
|
30 |
+ * 0.82 |
|
31 |
+ * |
|
29 | 32 |
* Revision 1.176 2005/02/02 08:30:24 nigelhorne |
30 | 33 |
* Call watchdog when neither SESSION not external is given |
31 | 34 |
* |
... | ... |
@@ -539,9 +542,9 @@ |
539 | 539 |
* Revision 1.6 2003/09/28 16:37:23 nigelhorne |
540 | 540 |
* Added -f flag use MaxThreads if --max-children not set |
541 | 541 |
*/ |
542 |
-static char const rcsid[] = "$Id: clamav-milter.c,v 1.176 2005/02/02 08:30:24 nigelhorne Exp $"; |
|
542 |
+static char const rcsid[] = "$Id: clamav-milter.c,v 1.177 2005/02/06 10:39:39 nigelhorne Exp $"; |
|
543 | 543 |
|
544 |
-#define CM_VERSION "0.81g" |
|
544 |
+#define CM_VERSION "0.82" |
|
545 | 545 |
|
546 | 546 |
#if HAVE_CONFIG_H |
547 | 547 |
#include "clamav-config.h" |
... | ... |
@@ -1727,7 +1730,7 @@ main(int argc, char **argv) |
1727 | 1727 |
/* set the temporary dir */ |
1728 | 1728 |
if((cpt = cfgopt(copt, "TemporaryDirectory"))) { |
1729 | 1729 |
tmpdir = cpt->strarg; |
1730 |
- cl_settempdir(tmpdir, (cfgopt(copt, "LeaveTemporaryFiles") != NULL)); |
|
1730 |
+ cl_settempdir(tmpdir, (short)(cfgopt(copt, "LeaveTemporaryFiles") != NULL)); |
|
1731 | 1731 |
} else if((tmpdir = getenv("TMPDIR")) == (char *)NULL) |
1732 | 1732 |
if((tmpdir = getenv("TMP")) == (char *)NULL) |
1733 | 1733 |
if((tmpdir = getenv("TEMP")) == (char *)NULL) |
... | ... |
@@ -2829,10 +2832,15 @@ clamfi_eom(SMFICTX *ctx) |
2829 | 2829 |
|
2830 | 2830 |
cli_dbgmsg("clamfi_eom\n"); |
2831 | 2831 |
|
2832 |
- if(!nflag) { /* remove any existing claims that it's virus free */ |
|
2832 |
+ if(!nflag) { |
|
2833 |
+ /* |
|
2834 |
+ * remove any existing claims that it's virus free so that |
|
2835 |
+ * downstream checkers aren't fooled by a carefully crafted |
|
2836 |
+ * virus. |
|
2837 |
+ */ |
|
2833 | 2838 |
int i; |
2834 | 2839 |
|
2835 |
- for(i = 1; i <= privdata->statusCount; i++) |
|
2840 |
+ for(i = privdata->statusCount; i > 0; --i) |
|
2836 | 2841 |
if(smfi_chgheader(ctx, "X-Virus-Status", i, NULL) == MI_FAILURE) |
2837 | 2842 |
if(use_syslog) |
2838 | 2843 |
syslog(LOG_WARNING, _("Failed to delete X-Virus-Status header %d"), i); |
... | ... |
@@ -4400,15 +4408,17 @@ move(const char *oldfile, const char *newfile) |
4400 | 4400 |
off_t offset; |
4401 | 4401 |
|
4402 | 4402 |
ret = rename(oldfile, newfile); |
4403 |
+ if(ret >= 0) |
|
4404 |
+ return 0; |
|
4403 | 4405 |
#else |
4404 | 4406 |
FILE *fin, *fout; |
4405 | 4407 |
int c; |
4406 | 4408 |
|
4407 | 4409 |
ret = link(oldfile, newfile); |
4410 |
+ if(ret >= 0) |
|
4411 |
+ return unlink(oldfile); |
|
4408 | 4412 |
#endif |
4409 | 4413 |
|
4410 |
- if(ret >= 0) |
|
4411 |
- return 0; |
|
4412 | 4414 |
if((ret < 0) && (errno != EXDEV)) { |
4413 | 4415 |
perror(newfile); |
4414 | 4416 |
return -1; |