summaryrefslogtreecommitdiff
path: root/lib/Net
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-12-10 01:26:53 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-10 01:26:53 +0000
commit860599f1563eb187b3ec0b74653ad9a88d0147d0 (patch)
tree50afde34739b1682e6b614fd00fddf1184b5d7d9 /lib/Net
parentfd781486aade56259bc3516488577dcd5b758b97 (diff)
downloadperl-860599f1563eb187b3ec0b74653ad9a88d0147d0.tar.gz
Root is the lizard king.
p4raw-id: //depot/perl@13579
Diffstat (limited to 'lib/Net')
-rw-r--r--lib/Net/t/netrc.t19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/Net/t/netrc.t b/lib/Net/t/netrc.t
index c7bbc04706..edde65a1bf 100644
--- a/lib/Net/t/netrc.t
+++ b/lib/Net/t/netrc.t
@@ -58,13 +58,24 @@ SKIP: {
$stat[2] = 077;
ok( !defined(Net::Netrc::_readrc()),
'_readrc() should not read world-writable file' );
- ok( $warn =~ /^Bad permissions/, '... and should warn about it' );
+ ok( $warn =~ /^Bad permissions:/, '... and should warn about it' );
# the owner field should still not match
$stat[2] = 0;
- ok( !defined(Net::Netrc::_readrc()),
- '_readrc() should not read file owned by someone else' );
- ok( $warn =~ /^Not owner/, '... and should warn about it' );
+
+ 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)
}
# this field must now match, to avoid the last-tested warning