You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by si...@apache.org on 2007/07/23 11:55:09 UTC

svn commit: r558677 - in /spamassassin/branches/3.1/t: SATest.pm spamd_plugin.t

Author: sidney
Date: Mon Jul 23 02:55:08 2007
New Revision: 558677

URL: http://svn.apache.org/viewvc?view=rev&rev=558677
Log:
bug 5529: make test as root fails with t/spamd_plugin.t

Modified:
    spamassassin/branches/3.1/t/SATest.pm
    spamassassin/branches/3.1/t/spamd_plugin.t

Modified: spamassassin/branches/3.1/t/SATest.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.1/t/SATest.pm?view=diff&rev=558677&r1=558676&r2=558677
==============================================================================
--- spamassassin/branches/3.1/t/SATest.pm (original)
+++ spamassassin/branches/3.1/t/SATest.pm Mon Jul 23 02:55:08 2007
@@ -19,6 +19,7 @@
   our $NO_SPAMC_EXE;
   our $SKIP_SPAMC_TESTS;
   our $SSL_AVAILABLE;
+  our $SKIP_SETUID_NOBODY_TESTS = 0;
 
 }
 
@@ -85,6 +86,11 @@
   # if running as root, ensure "nobody" can write to it too
   if ($> == 0) {
     $tmp_dir_mode = 0777;
+    umask 022;  # ensure correct permissions on files and dirs created here
+    # Bug 5529 initial fix: For now don't run a test as root if it has a problem resuting from setuid nobody
+    # FIXME: Eventually we can actually test setuid nobody and accessing ./log to make this test more fine grained
+    #  and we can create an accessible temp dir that some of the tests can use. But for now just skip those tests.
+    $SKIP_SETUID_NOBODY_TESTS = 1;
   } else {
     $tmp_dir_mode = 0755;
   }
@@ -102,6 +108,7 @@
   # rmtree ("log");
 
   mkdir ("log", 0755);
+  chmod (0755, "log"); # set in case log already exists with wrong permissions
 
   rmtree ("log/user_state");
   rmtree ("log/outputdir.tmp");

Modified: spamassassin/branches/3.1/t/spamd_plugin.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.1/t/spamd_plugin.t?view=diff&rev=558677&r1=558676&r2=558677
==============================================================================
--- spamassassin/branches/3.1/t/spamd_plugin.t (original)
+++ spamassassin/branches/3.1/t/spamd_plugin.t Mon Jul 23 02:55:08 2007
@@ -4,10 +4,10 @@
 use SATest; sa_t_init("spamd_plugin");
 
 use constant numtests => 6;
-use Test; BEGIN { plan tests => ((!$SKIP_SPAMD_TESTS && !$RUNNING_ON_WINDOWS) ?
-                        numtests : 0) };
+use Test; plan tests => (($SKIP_SPAMD_TESTS || $RUNNING_ON_WINDOWS || $SKIP_SETUID_NOBODY_TESTS) ?
+                        0 : numtests);
 
-exit unless (!$SKIP_SPAMD_TESTS && !$RUNNING_ON_WINDOWS);
+exit unless !($SKIP_SPAMD_TESTS || $RUNNING_ON_WINDOWS || $SKIP_SETUID_NOBODY_TESTS);
 
 # ---------------------------------------------------------------------------