summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2007-12-09 00:56:02 +0100
committerJim Meyering <meyering@redhat.com>2007-12-09 00:57:00 +0100
commitde5b055bbf6c77246826f1276c2a5b9c7264b2bf (patch)
treec01060293b726d419c90875dbb3ff3c65eb7760c
parentf16499e4d5cc4bd50067a7d8acc295ac5446833f (diff)
downloadcoreutils-de5b055bbf6c77246826f1276c2a5b9c7264b2bf.tar.xz
"rm" as root would fail to unlink a non-directory on OS X 10.4.x
* src/remove.c (remove_entry) ["can unlink directories"]: Fix a mistakenly reversed condition. * NEWS: Mention this bug fix. Reported by Pieter Bowman.
-rw-r--r--ChangeLog8
-rw-r--r--NEWS4
-rw-r--r--THANKS1
-rw-r--r--src/remove.c2
4 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f9686a618..d2f2f3114 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-12-09 Jim Meyering <meyering@redhat.com>
+
+ "rm" as root would fail to unlink a non-directory on OS X 10.4.x
+ * src/remove.c (remove_entry) ["can unlink directories"]: Fix a
+ mistakenly reversed condition.
+ * NEWS: Mention this bug fix.
+ Reported by Pieter Bowman.
+
2007-12-08 Jim Meyering <meyering@redhat.com>
* src/c99-to-c89.diff: Adjust shred.c offsets.
diff --git a/NEWS b/NEWS
index c6a0511e5..e5e59a629 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ GNU coreutils NEWS -*- outline -*-
* Noteworthy changes in release 6.9.91 (????-??-??) [beta]
+ "rm" would fail to unlink a non-directory when run in an environment
+ in which the user running rm is capable of unlinking a directory.
+ [bug introduced in coreutils-6.9]
+
* Noteworthy changes in release 6.9.90 (2007-12-01) [beta]
diff --git a/THANKS b/THANKS
index 0b0124b90..f91c2625e 100644
--- a/THANKS
+++ b/THANKS
@@ -424,6 +424,7 @@ Philippe De Muyter phdm@macqel.be
Philippe Schnoebelen Philippe.Schnoebelen@imag.fr
Phillip Jones mouse@datastacks.com
Piergiorgio Sartor sartor@sony.de
+Pieter Bowman bowman@math.utah.edu
Piotr Kwapulinski kwap@univ.gda.pl
Prashant TR tr@eth.net
Rainer Orth ro@TechFak.Uni-Bielefeld.DE
diff --git a/src/remove.c b/src/remove.c
index 11e2ccb0e..de8f5ffc9 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -1150,7 +1150,7 @@ remove_entry (int fd_cwd, Dirstack_state const *ds, char const *filename,
dirent_type = DT_DIR;
}
- if (dirent_type == DT_DIR)
+ if (dirent_type != DT_DIR)
{
/* At this point, barring race conditions, FILENAME is known
to be a non-directory, so it's ok to try to unlink it. */