aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-02-06 17:31:52 -0600
committerRob Landley <rob@landley.net>2015-02-06 17:31:52 -0600
commit459cab00f22c88ed64f56d9928baeba7a10789d5 (patch)
tree83867f80bb4cb8be3e232739dad19944910df157 /toys/posix
parentbd6c3f35ae226125737503dddac48e7924425b49 (diff)
downloadtoybox-459cab00f22c88ed64f56d9928baeba7a10789d5.tar.gz
In rm, init using to AT_REMOVEDIR in the dir case earlier.
(If you had a chmod 000 directory and did rm -r on it without -f, after the prompt it would complain it was a directory.)
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/rm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/rm.c b/toys/posix/rm.c
index 7b7916c2..5523a98c 100644
--- a/toys/posix/rm.c
+++ b/toys/posix/rm.c
@@ -47,13 +47,13 @@ static int do_rm(struct dirtree *try)
// handle directory recursion
if (dir) {
+ using = AT_REMOVEDIR;
// Handle chmod 000 directories when -f
if (faccessat(fd, try->name, R_OK, 0)) {
if (toys.optflags & FLAG_f) wfchmodat(fd, try->name, 0700);
else goto skip;
}
if (!try->again) return DIRTREE_COMEAGAIN;
- using = AT_REMOVEDIR;
if (try->symlink) goto skip;
if (flags & FLAG_i) {
char *s = dirtree_path(try, 0);