You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2004/01/11 19:17:53 UTC
svn commit: rev 6139 - incubator/spamassassin/branches/b2_6_0/spamd
Author: felicity
Date: Sun Jan 11 10:17:52 2004
New Revision: 6139
Modified:
incubator/spamassassin/branches/b2_6_0/spamd/spamd.raw
Log:
bug 2917: Failure to remove /tmp/spamd-$$-init for certain settings of
auto_whitelist_path (and bayes_path)
Modified: incubator/spamassassin/branches/b2_6_0/spamd/spamd.raw
==============================================================================
--- incubator/spamassassin/branches/b2_6_0/spamd/spamd.raw (original)
+++ incubator/spamassassin/branches/b2_6_0/spamd/spamd.raw Sun Jan 11 10:17:52 2004
@@ -1306,19 +1306,19 @@
# bug 2015, bug 2223: rmpath() is not taint safe, so we've got to implement
# our own poor man's rmpath. If it fails, we report only the first error.
my $err;
- opendir (TMPDIR, $tmpsadir) or $err ||= "open $tmpsadir: $!";
- unless ($err) {
- foreach my $f (File::Spec->no_upwards (readdir (TMPDIR))) {
- $f = Mail::SpamAssassin::Util::untaint_file_path (
- File::Spec->catfile ($tmpsadir, $f)
- );
- unlink ($f) or $err ||= "remove $f: $!";
+ foreach my $d (($tmpsadir, $tmphome)) {
+ opendir (TMPDIR, $d) or $err ||= "open $d: $!";
+ unless ($err) {
+ foreach my $f (File::Spec->no_upwards (readdir (TMPDIR))) {
+ $f = Mail::SpamAssassin::Util::untaint_file_path (
+ File::Spec->catfile ($d, $f)
+ );
+ unlink ($f) or $err ||= "remove $f: $!";
+ }
+ closedir (TMPDIR) or $err ||= "close $d: $!";
}
- closedir (TMPDIR) or $err ||= "close $tmpsadir: $!";
+ rmdir ($d) or $err ||= "remove $d: $!";
}
-
- rmdir ($tmpsadir) or $err ||= "remove $tmpsadir: $!";
- rmdir ($tmphome) or $err ||= "remove $tmphome: $!";
# If the dir still exists, log a warning.
if (-d $tmphome) {