diff options
author | Jim Meyering <meyering@redhat.com> | 2007-10-24 08:50:09 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2007-10-24 08:50:09 +0200 |
commit | b924d0380eefddc4a6dd5b8521b91c3a4bc4527a (patch) | |
tree | ec3a803c9d55e2c5df4898238161dc0089897e34 /tests/rm/unreadable | |
parent | def157c9271c3fc601ec8fe7085fb63b25b3e26f (diff) | |
download | coreutils-b924d0380eefddc4a6dd5b8521b91c3a4bc4527a.tar.xz |
Don't fail part 2 of tests/rm/unreadable when run as root.
* tests/rm/unreadable: With UID == 0, expect different results.
Reported by Mike Frysinger.
Diffstat (limited to 'tests/rm/unreadable')
-rwxr-xr-x | tests/rm/unreadable | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/rm/unreadable b/tests/rm/unreadable index 2fbe0320d..4af8280de 100755 --- a/tests/rm/unreadable +++ b/tests/rm/unreadable @@ -38,6 +38,7 @@ use strict; my $d = "dir-$$"; my $mkdir = {PRE => sub {mkdir $d,0100 or die "$d: $!\n"}}; my $prog = 'rm'; +my $uid = $<; my @Tests = ( @@ -47,8 +48,9 @@ my @Tests = ['unreadable-1', '-rf', $d, {EXIT => 0}, $mkdir], ['unreadable-2', '-rf', $d, - {EXIT => 1}, - {ERR => "$prog: cannot remove \`$d': Permission denied\n"}, + {EXIT => $uid == 0 ? 0 : 1}, + {ERR => $uid == 0 ? '' + : "$prog: cannot remove \`$d': Permission denied\n"}, {PRE => sub { (mkdir $d,0700 and mkdir "$d/x",0700 and chmod 0100,$d) or die "$d: $!\n"}} ], ); |