diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-10 04:21:59 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-10 04:21:59 +0000 |
commit | 8c81eb11585093a7c1d46400c4760e25b5816865 (patch) | |
tree | 0eeadfd95704f5a68dfed01d50d9cc1df670c94e /lib | |
parent | 3e33716fff35c87acba10f1d7630d4ad55ad58e8 (diff) | |
download | perl-8c81eb11585093a7c1d46400c4760e25b5816865.tar.gz |
Just skip the readability test if running as root.
p4raw-id: //depot/perl@13589
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Net/t/netrc.t | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/Net/t/netrc.t b/lib/Net/t/netrc.t index edde65a1bf..885b515452 100644 --- a/lib/Net/t/netrc.t +++ b/lib/Net/t/netrc.t @@ -63,19 +63,13 @@ SKIP: { # 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 |