From test-commitsangelaoliver@example.org Wed Sep 15 02:10:47 2010
Return-Path: <test-commitsangelaoliver@example.org>
Delivered-To: angelaoliver@example.org
Received: (qmail 82705 invoked from network); 15 Sep 2010 02:10:47 -0000
Received: from unknown (HELO mail.apache.org) (83.161.120.155)
  by 83.161.120.155 with SMTP; 15 Sep 2010 02:10:47 -0000
Received: (qmail 84648 invoked by uid 500); 15 Sep 2010 02:10:46 -0000
Mailing-List: contact angelaoliver@example.org; run by ezmlm
Precedence: bulk
List-Help: <mailto:angelaoliver@example.org>
List-Unsubscribe: <mailto:angelaoliver@example.org>
List-Post: <mailto:angelaoliver@example.org>
List-Id: <test-commits.perl.apache.org>
Reply-To: angelaoliver@example.org
Delivered-To: mailing list angelaoliver@example.org
Received: (qmail 84641 invoked by uid 99); 15 Sep 2010 02:10:46 -0000
Received: from Unknown (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Sep 2010 02:10:46 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Sep 2010 02:10:29 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id 79E47238890B; Wed, 15 Sep 2010 02:10:08 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r997170 - /perl/Apache-Test/trunk/Changes
Date: Wed, 15 Sep 2010 02:10:08 -0000
To: angelaoliver@example.org
From: angelaoliver@example.org
X-Mailer: svnmailer-1.0.8
Message-Id: <angelaoliver@example.org>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: phred
Date: Wed Sep 15 02:10:08 2010
New Revision: 997170

URL: http://svn.apache.org/viewvc?rev=997170&view=rev
Log:
Release 1.33

Modified:
    perl/Apache-Test/trunk/Changes

Modified: perl/Apache-Test/trunk/Changes
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/Changes?rev=997170&r1=997169&r2=997170&view=diff
==============================================================================
--- perl/Apache-Test/trunk/Changes (original)
+++ perl/Apache-Test/trunk/Changes Wed Sep 15 02:10:08 2010
@@ -6,7 +6,7 @@ Changes - Apach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Test change logfile
 
 =over 3
 
-=item 1.33-dev
+=item 1.33 September 14, 2010
 
 Propagate APACHE_TEST_NO_STICKY_PREFERENCES to the Apache environment
 for mod_perl configurations (Apach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestConfigPerl),



From test-commitsangelaoliver@example.org Wed Sep 15 02:15:06 2010
Return-Path: <test-commitsangelaoliver@example.org>
Delivered-To: angelaoliver@example.org
Received: (qmail 83241 invoked from network); 15 Sep 2010 02:15:06 -0000
Received: from unknown (HELO mail.apache.org) (83.161.120.155)
  by 83.161.120.155 with SMTP; 15 Sep 2010 02:15:06 -0000
Received: (qmail 88099 invoked by uid 500); 15 Sep 2010 02:15:06 -0000
Mailing-List: contact angelaoliver@example.org; run by ezmlm
Precedence: bulk
List-Help: <mailto:angelaoliver@example.org>
List-Unsubscribe: <mailto:angelaoliver@example.org>
List-Post: <mailto:angelaoliver@example.org>
List-Id: <test-commits.perl.apache.org>
Reply-To: angelaoliver@example.org
Delivered-To: mailing list angelaoliver@example.org
Received: (qmail 88091 invoked by uid 99); 15 Sep 2010 02:15:06 -0000
Received: from Unknown (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Sep 2010 02:15:06 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Sep 2010 02:14:49 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id 3904D23889B3; Wed, 15 Sep 2010 02:14:28 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r997171 - /perl/Apache-Test/tags/1_33/
Date: Wed, 15 Sep 2010 02:14:28 -0000
To: angelaoliver@example.org
From: angelaoliver@example.org
X-Mailer: svnmailer-1.0.8
Message-Id: <angelaoliver@example.org>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: phred
Date: Wed Sep 15 02:14:27 2010
New Revision: 997171

URL: http://svn.apache.org/viewvc?rev=997171&view=rev
Log:
Tag 1.33

Added:
    perl/Apache-Test/tags/1_33/
      - copied from r997170, perl/Apache-Test/trunk/


From test-commitsangelaoliver@example.org Wed Sep 15 02:21:09 2010
Return-Path: <test-commitsangelaoliver@example.org>
Delivered-To: angelaoliver@example.org
Received: (qmail 83671 invoked from network); 15 Sep 2010 02:21:09 -0000
Received: from unknown (HELO mail.apache.org) (83.161.120.155)
  by 83.161.120.155 with SMTP; 15 Sep 2010 02:21:09 -0000
Received: (qmail 88783 invoked by uid 500); 15 Sep 2010 02:21:09 -0000
Mailing-List: contact angelaoliver@example.org; run by ezmlm
Precedence: bulk
List-Help: <mailto:angelaoliver@example.org>
List-Unsubscribe: <mailto:angelaoliver@example.org>
List-Post: <mailto:angelaoliver@example.org>
List-Id: <test-commits.perl.apache.org>
Reply-To: angelaoliver@example.org
Delivered-To: mailing list angelaoliver@example.org
Received: (qmail 88776 invoked by uid 99); 15 Sep 2010 02:21:09 -0000
Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Sep 2010 02:21:09 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Sep 2010 02:21:08 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id 7DF2623889B3; Wed, 15 Sep 2010 02:20:48 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r997173 - in /perl/Apache-Test/trunk: Changes RELEASE
 lib/Apache/Test.pm
Date: Wed, 15 Sep 2010 02:20:48 -0000
To: angelaoliver@example.org
From: angelaoliver@example.org
X-Mailer: svnmailer-1.0.8
Message-Id: <angelaoliver@example.org>

Author: phred
Date: Wed Sep 15 02:20:48 2010
New Revision: 997173

URL: http://svn.apache.org/viewvc?rev=997173&view=rev
Log:
start 1.34 dev cycle

Modified:
    perl/Apache-Test/trunk/Changes
    perl/Apache-Test/trunk/RELEASE
    perl/Apache-Test/trunk/lib/Apache/Test.pm

Modified: perl/Apache-Test/trunk/Changes
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/Changes?rev=997173&r1=997172&r2=997173&view=diff
==============================================================================
--- perl/Apache-Test/trunk/Changes (original)
+++ perl/Apache-Test/trunk/Changes Wed Sep 15 02:20:48 2010
@@ -6,6 +6,10 @@ Changes - Apach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Test change logfile
 
 =over 3
 
+=item 1.34-dev
+
+
+
 =item 1.33 September 14, 2010
 
 Propagate APACHE_TEST_NO_STICKY_PREFERENCES to the Apache environment

Modified: perl/Apache-Test/trunk/RELEASE
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/RELEASE?rev=997173&r1=997172&r2=997173&view=diff
==============================================================================
--- perl/Apache-Test/trunk/RELEASE (original)
+++ perl/Apache-Test/trunk/RELEASE Wed Sep 15 02:20:48 2010
@@ -35,7 +35,7 @@ Instructions for Apache-Test Release Man
    (or maybe longer to give most people a chance to catch up). no need
    to tag this package
 
-   Subject: [RELEASE CANDIDATE] Apache-Test-1.33 RC\d+
+   Subject: [RELEASE CANDIDATE] Apache-Test-1.34 RC\d+
 
   a. if problems are detected during stage 2, repeat stages 1 and 2.
 
@@ -67,7 +67,7 @@ Instructions for Apache-Test Release Man
 5. Announce the package
 
   a. post ... to the modperl, announce lists
-  Subject: [ANNOUNCE] Apache-Test 1.33
+  Subject: [ANNOUNCE] Apache-Test 1.34
      include 
   - MD5 sig (as it comes from CPAN upload announce).
   - the latest Changes
@@ -79,7 +79,7 @@ Instructions for Apache-Test Release Man
   b. edit ./Changes:
      - start a new item with incremented version + '-dev'
 
-  =item 1.34-dev
+  =item 1.35-dev
 
   c. bump up version numbers in this file to make it easier to do the
      next release.
@@ -87,4 +87,4 @@ Instructions for Apache-Test Release Man
      $ perl -pi -e 's/(\d+)\.(\d+)/join(".", $1, $2+1)/eg' RELEASE
 
   d. commit Changes
-     % svn ci -m "start 1.34-dev cycle" Changes RELEASE lib/Apache/Test.pm
+     % svn ci -m "start 1.35-dev cycle" Changes RELEASE lib/Apache/Test.pm

Modified: perl/Apache-Test/trunk/lib/Apache/Test.pm
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/lib/Apache/Test.pm?rev=997173&r1=997172&r2=997173&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/Test.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/Test.pm Wed Sep 15 02:20:48 2010
@@ -36,7 +36,7 @@ BEGIN {
 
 use vars qw(@ISA @EXPORT %EXPORT_TAGS $VERSION %SubTests @SkipReasons);
 
-$VERSION = '1.33';
+$VERSION = '1.34';
 
 my @need = qw(need_lwp need_http11 need_cgi need_access need_auth
               need_module need_apache need_min_apache_version



From test-commitsangelaoliver@example.org Wed Sep 15 20:38:43 2010
Return-Path: <test-commitsangelaoliver@example.org>
Delivered-To: angelaoliver@example.org
Received: (qmail 75571 invoked from network); 15 Sep 2010 20:38:43 -0000
Received: from unknown (HELO mail.apache.org) (83.161.120.155)
  by 83.161.120.155 with SMTP; 15 Sep 2010 20:38:43 -0000
Received: (qmail 51374 invoked by uid 500); 15 Sep 2010 20:38:43 -0000
Mailing-List: contact angelaoliver@example.org; run by ezmlm
Precedence: bulk
List-Help: <mailto:angelaoliver@example.org>
List-Unsubscribe: <mailto:angelaoliver@example.org>
List-Post: <mailto:angelaoliver@example.org>
List-Id: <test-commits.perl.apache.org>
Reply-To: angelaoliver@example.org
Delivered-To: mailing list angelaoliver@example.org
Received: (qmail 51364 invoked by uid 99); 15 Sep 2010 20:38:43 -0000
Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Sep 2010 20:38:43 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Sep 2010 20:38:41 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id CB67D23889E1; Wed, 15 Sep 2010 20:38:20 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r997488 - /perl/Apache-Test/trunk/CONTRIBUTORS
Date: Wed, 15 Sep 2010 20:38:20 -0000
To: angelaoliver@example.org
From: angelaoliver@example.org
X-Mailer: svnmailer-1.0.8
Message-Id: <angelaoliver@example.org>

Author: phred
Date: Wed Sep 15 20:38:20 2010
New Revision: 997488

URL: http://svn.apache.org/viewvc?rev=997488&view=rev
Log:
Add myself to maintainer list.

Modified:
    perl/Apache-Test/trunk/CONTRIBUTORS

Modified: perl/Apache-Test/trunk/CONTRIBUTORS
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/CONTRIBUTORS?rev=997488&r1=997487&r2=997488&view=diff
==============================================================================
--- perl/Apache-Test/trunk/CONTRIBUTORS (original)
+++ perl/Apache-Test/trunk/CONTRIBUTORS Wed Sep 15 20:38:20 2010
@@ -4,8 +4,7 @@ Apache-Test was originally developed by:
 
 Now maintained by:
 
-  Stas Bekman <angelaoliver@example.org>
-  Geoffrey Young <angelaoliver@example.org>
+  Fred Moyer <angelaoliver@example.org>
   Philip M. Gollucci <angelaoliver@example.org>
 
 with contributions from the following helpful people 
@@ -14,9 +13,11 @@ with contributions from the following he
   Alessandro Forghieri <angelaoliver@example.org>
   David Wheeler <angelaoliver@example.org>
   Gary Benson <angelaoliver@example.org>
+  Geoffrey Young <angelaoliver@example.org>
   Ken Williams <angelaoliver@example.org>
   Randy Kobes <angelaoliver@example.org>
   Rick Myers <angelaoliver@example.org>
+  Stas Bekman <angelaoliver@example.org>
   Steve Hay <angelaoliver@example.org>
   Steve Piner <angelaoliver@example.org>
   Tatsuhiko Miyagawa <angelaoliver@example.org>



From test-commitsangelaoliver@example.org Wed Sep 29 19:27:53 2010
Return-Path: <test-commitsangelaoliver@example.org>
Delivered-To: angelaoliver@example.org
Received: (qmail 93080 invoked from network); 29 Sep 2010 19:27:52 -0000
Received: from unknown (HELO mail.apache.org) (83.161.120.155)
  by 83.161.120.155 with SMTP; 29 Sep 2010 19:27:52 -0000
Received: (qmail 57504 invoked by uid 500); 29 Sep 2010 19:27:52 -0000
Mailing-List: contact angelaoliver@example.org; run by ezmlm
Precedence: bulk
List-Help: <mailto:angelaoliver@example.org>
List-Unsubscribe: <mailto:angelaoliver@example.org>
List-Post: <mailto:angelaoliver@example.org>
List-Id: <test-commits.perl.apache.org>
Reply-To: angelaoliver@example.org
Delivered-To: mailing list angelaoliver@example.org
Received: (qmail 57497 invoked by uid 99); 29 Sep 2010 19:27:52 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Sep 2010 19:27:52 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Sep 2010 19:27:49 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id 7911623888FE; Wed, 29 Sep 2010 19:27:27 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r1002818 - in /perl/Apache-Test/trunk: Changes Makefile.PL
 lib/Apache/TestRun.pm
Date: Wed, 29 Sep 2010 19:27:27 -0000
To: angelaoliver@example.org
From: angelaoliver@example.org
X-Mailer: svnmailer-1.0.8
Message-Id: <angelaoliver@example.org>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: phred
Date: Wed Sep 29 19:27:27 2010
New Revision: 1002818

URL: http://svn.apache.org/viewvc?rev=1002818&view=rev
Log:
Skip test suite if run as root user.  The workarounds which try to accomplish
running the tests as root are usually unsuccessful, and require user
intervention, which leads to additional support issues and problems.


Modified:
    perl/Apache-Test/trunk/Changes
    perl/Apache-Test/trunk/Makefile.PL
    perl/Apache-Test/trunk/lib/Apache/TestRun.pm

Modified: perl/Apache-Test/trunk/Changes
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/Changes?rev=1002818&r1=1002817&r2=1002818&view=diff
==============================================================================
--- perl/Apache-Test/trunk/Changes (original)
+++ perl/Apache-Test/trunk/Changes Wed Sep 29 19:27:27 2010
@@ -8,7 +8,10 @@ Changes - Apach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Test change logfile
 
 =item 1.34-dev
 
-
+Don't attempt to run the test suite as root.  The workarounds needed
+to facilitate root testing cause large maintenance costs, and return
+no tangible benefits.
+[Fred Moyer]
 
 =item 1.33 September 14, 2010
 

Modified: perl/Apache-Test/trunk/Makefile.PL
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/Makefile.PL?rev=1002818&r1=1002817&r2=1002818&view=diff
==============================================================================
--- perl/Apache-Test/trunk/Makefile.PL (original)
+++ perl/Apache-Test/trunk/Makefile.PL Wed Sep 29 19:27:27 2010
@@ -223,3 +223,24 @@ sub add_Apache__test_target {
         $string;
     };
 }
+
+sub MY888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4test {
+    my $self = shift;
+
+    # run tests normally if non root user
+    return $self->Apach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestMM888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4test(@_) if (($> != 0) # root user
+        or (Apach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestConfig888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4WINFU)); # win users
+        # or win32
+
+    return <<EOF
+test888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4
+\t\@echo
+\t\@echo Apach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Test tests cannot be run as the root user.
+\t\@echo Apache cannot spawn child processes as 'root', therefore
+\t\@echo the test suite must be run with a non privileged user.
+\t\@echo Please build Apach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Test as a non-privileged user to
+\t\@echo run the test suite.
+\t\@echo
+EOF
+}
+

Modified: perl/Apache-Test/trunk/lib/Apache/TestRun.pm
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/lib/Apache/TestRun.pm?rev=1002818&r1=1002817&r2=1002818&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestRun.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestRun.pm Wed Sep 29 19:27:27 2010
@@ -46,7 +46,6 @@ my $orig_cwd;
 my $orig_conf_opts;
 
 my %core_files  = ();
-my %original_t_perms = ();
 
 my @std_run      = qw(start-httpd run-tests stop-httpd);
 my @others       = qw(verbose configure clean help ssl http11 bugreport
@@ -563,7 +562,7 @@ sub start {
         }
     }
 
-    $self->adjust_t_perms();
+    $self->check_runtime_user();
 
     if ($opts->{'start-httpd'}) {
         exit_perl 0 unless $server->start;
@@ -603,8 +602,6 @@ sub run_tests {
 sub stop {
     my $self = shift;
 
-    $self->restore_t_perms;
-
     return $self->{server}->stop if $self->{opts}->{'stop-httpd'};
 }
 
@@ -950,172 +947,21 @@ sub warn_core {
     }, $vars->{top_dir});
 }
 
-# this function handles the cases when the test suite is run under
-# 'root':
-#
-# 1. When user 'bar' is chosen to run Apache with, files and dirs
-#    created by 'root' might be not writable/readable by 'bar'
-#
-# 2. when the source is extracted as user 'foo', and the chosen user
-#    to run Apache under is 'bar', in which case normally 'bar' won't
-#    have the right permissions to write into the fs created by 'foo'.
-#
-# We solve that by 'chown -R bar.bar t/' in a portable way.
-#
-# 3. If the parent directory is not rwx for the chosen user, that user
-#    won't be able to read/write the DocumentRoot. In which case we
-#    have nothing else to do, but to tell the user to fix the situation.
-#
-sub adjust_t_perms {
-    my $self = shift;
-
-    return if Apach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestConfig888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4WINFU;
-
-    %original_t_perms = (); # reset global
+# catch any attempts to ./t/TEST the tests as root user
 
-    my $user = getpwuid($>) || '';
-    if ($user eq 'root') {
-        my $vars = $self->{test_config}->{vars};
-        my $user = $vars->{user};
-        my($uid, $gid) = (getpwnam($user))[2..3]
-            or die "Can't find out uid/gid of '$user'";
-
-        warning "root mode: ".
-            "changing the files ownership to '$user' ($uid:$gid)";
-        finddepth(sub {
-            $original_t_perms{$Fil888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Fin888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4name} = [(stat $_)[4..5]];
-            chown $uid, $gid, $_;
-        }, $vars->{t_dir});
-
-        $self->check_perms($user, $uid, $gid);
-
-        $self->become_nonroot($user, $uid, $gid);
-    }
-}
-
-sub restore_t_perms {
+sub check_runtime_user {
     my $self = shift;
 
     return if Apach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestConfig888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4WINFU;
 
-    if (%original_t_perms) {
-        warning "root mode: restoring the original files ownership";
-        my $vars = $self->{test_config}->{vars};
-        while (my($file, $ids) = each %original_t_perms) {
-            next unless -e $file; # files could be deleted
-            chown @$ids, $file;
-        }
-    }
-}
-
-# this sub is executed from an external process only, since it
-# "sudo"'s into a uid/gid of choice
-sub run_root_fs_test {
-    my($uid, $gid, $dir) = @_;
-
-    # first must change gid and egid ("$gid $gid" for an empty
-    # setgroups() call as explained in perlvar.pod)
-    my $groups = "$gid $gid";
-    $( = $) = $groups;
-    die "failed to change gid to $gid"
-        unless $( eq $groups && $) eq $groups;
-
-    # only now can change uid and euid
-    $< = $> = $uid+0;
-    die "failed to change uid to $uid" unless $< == $uid && $> == $uid;
-
-    my $file = catfile $dir, ".apache-test-file-$$-".time.int(rand);
-    eval "END { unlink q[$file] }";
-
-    # unfortunately we can't run the what seems to be an obvious test:
-    # -r $dir && -w _ && -x _
-    # since not all perl implementations do it right (e.g. sometimes
-    # acls are ignored, at other times setid/gid change is ignored)
-    # therefore we test by trying to attempt to read/write/execute
-
-    # -w
-    open TEST, ">$file" or die "failed to open $file: $!";
-
-    # -x
-    -f $file or die "$file cannot be looked up";
-    close TEST;
-
-    # -r
-    opendir DIR, $dir or die "failed to open dir $dir: $!";
-    defined readdir DIR or die "failed to read dir $dir: $!";
-    close DIR;
-
-    # all tests passed
-    print "OK";
-}
-
-sub check_perms {
-    my ($self, $user, $uid, $gid) = @_;
-
-    # test that the base dir is rwx by the selected non-root user
-    my $vars = $self->{test_config}->{vars};
-    my $dir  = $vars->{t_dir};
-    my $perl = Apach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestConfig888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4shell_ready($vars->{perl});
+    my $user = getpwuid($>) || '';
 
-    # find where Apach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestRun was loaded from, so we load this
-    # exact package from the external process
-    my $inc = dirname dirname $INC{"Apache/TestRun.pm"};
-    my $sub = "Apach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestRun888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4run_root_fs_test";
-    my $check = <<"EOI";
-$perl -Mlib=$inc -MApach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestRun -e 'eval { $sub($uid, $gid, q[$dir]) }';
-EOI
-    warning "testing whether '$user' is able to -rwx $dir\n$check\n";
-
-    my $res = qx[$check] || '';
-    warning "result: $res";
-    unless ($res eq 'OK') {
-        $self->user_error(1);
-        #$self->restore_t_perms;
-        error <<"EOI";
-You are running the test suite under user 'root'.
-Apache cannot spawn child processes as 'root', therefore
-we attempt to run the test suite with user '$user' ($uid:$gid).
-The problem is that the path (including all parent directories):
-  $dir
-must be 'rwx' by user '$user', so Apache can read and write under that
-path.
-
-There are several ways to resolve this issue. One is to move and
-rebuild the distribution to '/tmp/' and repeat the 'make test'
-phase. The other is not to run 'make test' as root (i.e. building
-under your /home/user directory).
-
-You can test whether some directory is suitable for 'make test' under
-'root', by running a simple test. For example to test a directory
-'$dir', run:
-
-  % $check
-Only if the test prints 'OK', the directory is suitable to be used for
-testing.
-EOI
-        skip_test_suite();
-        exit_perl 0;
+    if ($user eq 'root') {
+        error "Apache cannot spawn child processes as root, therefore the test suite must be run as a non-privileged user.";
+        exit_perl(0);
     }
-}
 
-# in case the client side creates any files after the initial chown
-# adjustments we want the server side to be able to read/write them, so
-# they better be with the same permissions. dropping root permissions
-# and becoming the same user as the server side solves this problem.
-sub become_nonroot {
-    my ($self, $user, $uid, $gid) = @_;
-
-    warning "the client side drops 'root' permissions and becomes '$user'";
-
-    # first must change gid and egid ("$gid $gid" for an empty
-    # setgroups() call as explained in perlvar.pod)
-    my $groups = "$gid $gid";
-    $( = $) = $groups;
-    die "failed to change gid to $gid" unless $( eq $groups && $) eq $groups;
-
-    # only now can change uid and euid
-    $< = $> = $uid+0;
-    die "failed to change uid to $uid" unless $< == $uid && $> == $uid;
+    return 1;
 }
 
 sub run_request {




{'source': 'Apache Software Foundation Public Mail Archives'}