SA Bugzilla – Bug 1962
taint detection mode broken
Last modified: 2003-06-27 03:40:59 UTC
Hi, running SA 2.55 with Perl 5.6.1 I get the following: # /usr/pkg/bin/perl -T -w /usr/pkg/bin/spamd -H -a -c -m 2 -D -r # /var/run/spamd.pid debug: Score set 0 chosen. debug: running in taint mode? no which is obviously wrong. Since the untainting of @ENV in spamd the function Mail::SpamAssassin::Util::am_running_in_taint_mode doesn't work anymore. Although 'make test' runs fine on NetBSD I get problems like this on Solaris 8: t/spamc_B...........spamd start failed: log: debug: Score set 0 chosen. debug: running in taint mode? no debug: ignore: test message to precompile patterns and load modules debug: using "log/test_rules_copy" for site rules dir debug: bayes: no dbs present, cannot scan: ./log/user_state/bayes_toks debug: Score set 0 chosen. debug: Initialising learner debug: debug: Only 0 spam(s) in Bayes DB < 200 debug: bayes: 16469 untie-ing debug: bayes: 16469 untie-ing db_toks debug: running header regexp tests; score so far=0 debug: running body-text per-line regexp tests; score so far=2.5 debug: running raw-body-text per-line regexp tests; score so far=2.5 debug: running uri tests; score so far=2.5 debug: uri tests: Done uriRE debug: running full-text regexp tests; score so far=2.5 debug: all '*To' addrs: debug: all '*From' addrs: ignore@compiling.spamassassin.taint.org debug: running meta tests; score so far=3.6 debug: is spam? score=3.6 required=5 tests=DATE_MISSING,MISSING_HEADERS,NO_REAL_NAME debug: bayes: 16469 untie-ing Insecure directory in $ENV{PATH} while running with -T switch at ../spamd/spamd line 1084. Maybe you need to kill a running spamd process? I made sure all directories in my PATH were only owner-writable. Removing all of http://bugzilla.spamassassin.org/showattachment.cgi?attach_id=858 from spamd let's 'make test' finish successfully on Solaris 8 but introduces again the problem reported in http://bugzilla.spamassassin.org/show_bug.cgi?id=1725 'Insecure dependency in chown while running with -T switch at /home/klaus/usr/pkg/bin/spamd line 270' ciao Klaus
Created attachment 1084 [details] wrong patch Doesn't actually attempt to fix the rmtree bug
Comment on attachment 1084 [details] wrong patch --- spamassassin/spamassassin/spamd/spamd.raw Mon Jun 16 15:05:40 2003 +++ /tmp/sa/spamd/spamd.raw Mon Jun 23 13:43:01 2003 @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w -T +#!/usr/bin/perl -wT- ############################################################# # The code in this file is copyright 2001 by Craig Hughes # # It is licensed for use with the SpamAssassin distribution # @@ -1210,7 +1210,7 @@ # if the dir still exists, throw a warning. if (-d $tmphome) { - warn "rmtree couldn't remove $tmphome!: $!\n"; + warn "rmtree couldn't remove $tmphome!: $@\n"; } }
Comment on attachment 1084 [details] wrong patch Gack, sorry, sent the wrong file :-( See the bug trace for the correct patch -- seems I can't replace the wrong patch with the correct one.
Subject: Re: taint detection mode broken Maybe I am missing the obvious, but what is the change in line 1 (perl -wT-) supposed to fix? The problem this bug is about is the fact, that taint mode detection is broken (see above: debug: running in taint mode? no); taint mode was definitely enabled with "perl -T". The fix for http://bugzilla.spamassassin.org/show_bug.cgi?id=1725 (detainting @ENV) broke the logic in Mail::SpamAssassin::Util::am_running_in_taint_mode which relies on $ENV{PATH} being tainted with '-T'. Hmm, while I think about this: calling Mail::SpamAssassin::Util::am_running_in_taint_mode() just before detainting @ENV would work around the problem. Yup, SA 2.55 on Solaris8 before: t/spamc_B...........spamd start failed: log: debug: Score set 0 chosen. debug: running in taint mode? no and after: t/spamc_B...........ok t/spamc_c...........ok t/spamd.............ok t/spamd_maxchildren.ok ciao Klaus
Created attachment 1092 [details] simple work-around for taint mode detection taint mode works now on Solaris (and NetBSD anyway)
Could this simple patch 1092 still be included in 2.60-cvs?
Sorry, I was misreading your bug report. I'll file a separate bug (and try to include the correct patch this time, duh)
+1 ok, this patch makes sense to me.
+1 easy!
committed.