Isaac Dunham wrote: [..] > A trickier bug is that rm -r dir will skip dir, saying > "rm: dir: is a directory" > I guess the fix involves rm -r calling rmdir instead of unlink.
unlinkat() also removes directories when given AT_REMOVEDIR. The following patch makes rm pass the tests and it still asks me when I try to remove a readonly dir. -Felix diff -r 434c4ae19f05 toys/posix/rm.c --- a/toys/posix/rm.c Thu Sep 18 18:07:58 2014 -0500 +++ b/toys/posix/rm.c Sat Sep 20 15:19:09 2014 +0200 @@ -50,7 +50,6 @@ // Handle chmod 000 directories when -f if (faccessat(fd, try->name, R_OK, AT_SYMLINK_NOFOLLOW)) { if (toys.optflags & FLAG_f) wfchmodat(fd, try->name, 0700); - else goto skip; } if (!try->again) return DIRTREE_COMEAGAIN; using = AT_REMOVEDIR; _______________________________________________ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net