Change 13589 by jhi@alpha on 2001/12/10 04:21:59

        Just skip the readability test if running as root.

Affected files ...

.... //depot/perl/lib/Net/t/netrc.t#5 edit

Differences ...

==== //depot/perl/lib/Net/t/netrc.t#5 (text) ====
Index: perl/lib/Net/t/netrc.t
--- perl/lib/Net/t/netrc.t.~1~  Sun Dec  9 21:30:06 2001
+++ perl/lib/Net/t/netrc.t      Sun Dec  9 21:30:06 2001
@@ -63,19 +63,13 @@
        # the owner field should still not match
        $stat[2] = 0;
 
-       my $olduid = $>;
-       eval { $> = 1 }; # switch uid away from root (may not be impelemented)
-
-      SKIP: {
-         skip("don't you know what absolutely power does to you?", 2)
-             if $> == 0;
-         
-         ok( !defined(Net::Netrc::_readrc()),
-             '_readrc() should not read file owned by someone else' );
-         ok( $warn =~ /^Not owner:/, '... and should warn about it' );
-      }
-
-       eval { $> = $olduid }; # switch uid back (may not be implemented)
+        if ($<) { 
+          ok( !defined(Net::Netrc::_readrc()), 
+              '_readrc() should not read file owned by someone else' ); 
+          ok( $warn =~ /^Not owner:/, '... and should warn about it' ); 
+        } else { 
+          ok(1, "Skip - testing as root") for 1..2; 
+        } 
 }
 
 # this field must now match, to avoid the last-tested warning
End of Patch.

Reply via email to