summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-11-27 12:50:08 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-11-27 12:50:08 +0000
commit9a4da9311d34e77ffdec7b888a8a3f66535ff14e (patch)
tree306e54b76281cdc1bb0f902098124fd1a52c95ed /t
parent901b18f1f40355e1c6bf8f01f58203410eb7eabb (diff)
parent80d06f2dff03a52147744439d4888c6bef091986 (diff)
downloadperl-9a4da9311d34e77ffdec7b888a8a3f66535ff14e.tar.gz
integrate cfgperl changes into mainline
p4raw-id: //depot/perl@2318
Diffstat (limited to 't')
-rwxr-xr-xt/op/filetest.t21
-rwxr-xr-xt/op/grent.t6
-rwxr-xr-xt/op/pwent.t5
3 files changed, 25 insertions, 7 deletions
diff --git a/t/op/filetest.t b/t/op/filetest.t
index 13c5917adc..9228b5730b 100755
--- a/t/op/filetest.t
+++ b/t/op/filetest.t
@@ -26,19 +26,30 @@ print "ok 5\n";
# make sure TEST is r-x
eval { chmod 0555, 'TEST' };
-if ($@) {
- print "#[$@]\nok 6 # skipped\n";
+$bad_chmod = $@;
+
+$oldeuid = $>; # root can read and write anything
+eval '$> = 1'; # so switch uid (may not be implemented)
+
+print "# oldeuid = $oldeuid, euid = $>\n";
+
+if ($bad_chmod) {
+ print "#[$@]\nok 6 #skipped\n";
}
else {
- print "not " if -w 'TEST';
- print "ok 6\n";
+ print "not " if -w 'TEST';
+ print "ok 6\n";
}
-# Scripts are not -x everywhere.
+# Scripts are not -x everywhere so cannot test that.
print "not " unless -r 'op';
print "ok 7\n";
+eval '$> = $oldeuid'; # switch uid back (may not be implemented)
+
+# this would fail for the euid 1
+# (unless we have unpacked the source code as uid 1...)
print "not " unless -w 'op';
print "ok 8\n";
diff --git a/t/op/grent.t b/t/op/grent.t
index 48698e879a..9d2b01d51a 100755
--- a/t/op/grent.t
+++ b/t/op/grent.t
@@ -7,7 +7,10 @@ BEGIN {
my $GR = "/etc/group";
- if ($Config{'i_grp'} ne 'define' or not -f $GR or not open(GR, $GR)) {
+ if (($^O eq 'next' and not open(GR, "nidump group .|"))
+ or (defined $Config{'i_grp'} and $Config{'i_grp'} ne 'define')
+ or not -f $GR or not open(GR, $GR)
+ ) {
print "1..0\n";
exit 0;
}
@@ -46,6 +49,7 @@ while (<GR>) {
$not = 1, last
if $name ne $name_s or
# Shadow passwords confuse this.
+# Not that group passwords are used much but still.
# $passwd ne $passwd_s or
$gid ne $gid_s or
$members ne $members_s;
diff --git a/t/op/pwent.t b/t/op/pwent.t
index 8fd9ce0dd8..87b2ac1f78 100755
--- a/t/op/pwent.t
+++ b/t/op/pwent.t
@@ -7,7 +7,10 @@ BEGIN {
my $PW = "/etc/passwd";
- if ($Config{'i_pwd'} ne 'define' or not -f $PW or not open(PW, $PW)) {
+ if (($^O eq 'next' and not open(PW, "nidump passwd .|"))
+ or (defined $Config{'i_pwd'} and $Config{'i_pwd'} ne 'define')
+ or not -f $PW or not open(PW, $PW)
+ ) {
print "1..0\n";
exit 0;
}