From 459cab00f22c88ed64f56d9928baeba7a10789d5 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 6 Feb 2015 17:31:52 -0600 Subject: 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.) --- toys/posix/rm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/posix') 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); -- cgit v1.2.3