aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/rm.c
AgeCommit message (Collapse)Author
2016-11-21Have dirtree_notdotdot() pass through !node->parent so . and .. on the commandRob Landley
line aren't filtered out. Audited all the callers and removed redundant calls, adjusted call sequence, etc. (And let rm _not_ do this, because posix.)
2016-01-05Add error_msg_raw() and friends, replace error_msg("%s", s) uses, enable formatRob Landley
checking, and fix up format checking complaints. Added out(type, value) function to stat to avoid a zillion printf typecasts.
2015-09-07Remove prompt argument from yesno(), caller can fprintf(stderr, "blah") itself.Rob Landley
This fixes the build break, the change to yesno() prototype accidentally got checked in last commit. (Oops, sorry.)
2015-02-06In rm, init using to AT_REMOVEDIR in the dir case earlier.Rob Landley
(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.)
2015-02-06Alright, the Android guys agree with the musl guys: ↵Rob Landley
faccessat(AT_SYMLINK_NOFOLLOW) is not supported.
2014-09-18rm -rf needs to chmod directories to u+rwx, because directories need +x to ↵Isaac Dunham
search. (Fixes messages about not being able to delete directories when running make test).
2014-09-13Bug report from luckboy: rm -f on a broken symlink didn't work because our ↵Rob Landley
"does it exist" test (to avoid errors on rm -f of nonexistent files) said it didn't. The fix: replace the access() with unlink(), which produces the same "does not exist" errno and has the added bonus of acting as a fastpath for rm -f on non-directories. (And since it produces a different error on directories, falls through to the old behavior there.) Most of this commit is comment updates explaining being subtle. :)
2014-07-26Move DIRTREE_COMEAGAIN second callback up to when the filehandle is still ↵Rob Landley
open, and add dir->again variable to distinguish second call instead of checking for -1 filehandle.
2014-07-03Fix rm -rf of chmod 000 directories.Rob Landley
2013-09-06Missing typecast in recent rm fix. Oops.Rob Landley
2013-09-05fix rm to handle "mkdir sub/sub && chmod 007 sub/sub && rm -rf sub".Rob Landley
Previous version didn't delete it, but exited without error. Neither was right.
2013-01-02Have error_msg() and friends set TT.exitval to 1 if it's still 0, clean out ↵Rob Landley
other places that were setting it that no longer need to.
2012-12-12The Linux kernel "make clean" calls rm -f with no arguments, which ↵0.4.2Rob Landley
apparently is not an error.
2012-12-10essat's flag not to follow symlinks isn't in the system call, and if libc is ↵Rob Landley
supposed to implement this as a wrapper uClibc gets it wrong. So use the stat info about symlinks instead. (Doesn't check the parent directory, but if that's read only we can't delete the file anyway so prompting is moot.)
2012-12-08Complicate the rm -i behavior to do what posix specifies.Rob Landley
2012-12-07New rm command.Rob Landley