summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rwxr-xr-xtests/rm/unreadable6
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 61ff64101..2757dff4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-10-24 Jim Meyering <meyering@redhat.com>
+
+ 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.
+
2007-10-23 Jim Meyering <meyering@redhat.com>
* README-hacking: Refer to LZMA Utils <http://tukaani.org/lzma/>.
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"}} ],
);