summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-03-09 15:25:05 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-03-09 15:25:05 +0000
commit218d7377a71591af7a854208a27c04b399144aab (patch)
treedfad5e7733f9b57407f2d616086775eb46fe9ff7
parent62815d3c8d96cc000ba7b7782a9f95afd54ffe44 (diff)
downloadperl-218d7377a71591af7a854208a27c04b399144aab.tar.gz
In op/stat #35 better to scan all the potential directories
for setuids, not just the first one. p4raw-id: //depot/perl@9091
-rwxr-xr-xt/op/stat.t21
1 files changed, 12 insertions, 9 deletions
diff --git a/t/op/stat.t b/t/op/stat.t
index 6c508ebddd..1d8c7a36eb 100755
--- a/t/op/stat.t
+++ b/t/op/stat.t
@@ -178,15 +178,18 @@ if ($^O eq 'mpeix' or $^O eq 'amigaos' or $Is_Dosish or $Is_Cygwin) {
$cnt = $uid = 0;
die "Can't run op/stat.t test 35 without pwd working" unless $cwd;
-($bin) = grep {-d} ($^O eq 'machten' ? qw(/usr/bin /bin) :
- qw(/sbin /usr/sbin /bin /usr/bin))
- or print ("not ok 35\n"), goto tty_test;
-opendir BIN, $bin or die "Can't opendir $bin: $!";
-while (defined($_ = readdir BIN)) {
- $_ = "$bin/$_";
- $cnt++;
- $uid++ if -u;
- last if $uid && $uid < $cnt;
+my @bin = grep {-d} ($^O eq 'machten' ?
+ qw(/usr/bin /bin) :
+ qw(/sbin /usr/sbin /bin /usr/bin));
+unless (@bin) { print ("not ok 35\n"), goto tty_test; }
+for my $bin (@bin) {
+ opendir BIN, $bin or die "Can't opendir $bin: $!";
+ while (defined($_ = readdir BIN)) {
+ $_ = "$bin/$_";
+ $cnt++;
+ $uid++ if -u;
+ last if $uid && $uid < $cnt;
+ }
}
closedir BIN;