Several people reported problems with the same test in mod_perl 2.0. Only now I've figured why: they run the test suite while logged as 'root', which was absolutly non-obvious.

When this happens Apache::Test starts the server under user 'nobody' if such exists, or dies otherwise. When the server is started under that username, the test suite can't create dirs and files because they aren't owned by that user 'nobody'... the test suite fails.

I suggest we kill that 'nobody' workaround, and just die if the test suite is started as root.

Prompting for another username as suggested by XXX below will lead to the same problem.

diff -b -u -r1.144 TestConfig.pm
--- Apache-Test/lib/Apache/TestConfig.pm 2 Dec 2002 16:11:48 -0000 1.144
+++ Apache-Test/lib/Apache/TestConfig.pm 3 Dec 2002 14:20:50 -0000
@@ -444,16 +444,7 @@


     my $user = $ENV{APACHE_USER} || (getpwuid($uid) || "#$uid");

-    if ($user eq 'root') {
-        my $other = (getpwnam('nobody'))[0];
-        if ($other) {
-            $user = $other;
-        }
-        else {
-            die "cannot run tests as User root";
-            #XXX: prompt for another username
-        }
-    }
+    die "cannot run tests as User root" if $user eq 'root';

     $user;
 }


__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com



Reply via email to