diff options
author | Rob Landley <rob@landley.net> | 2016-11-21 16:47:23 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2016-11-21 16:47:23 -0600 |
commit | 382057f588fbf2c2f7950b85dd317721b8d04c07 (patch) | |
tree | ba6b074d5c956f2f5747e27ce0f8ab948a0a602c /toys/posix/rm.c | |
parent | 9b4a67545e11975068d6e16c6872d54e0473e715 (diff) | |
download | toybox-382057f588fbf2c2f7950b85dd317721b8d04c07.tar.gz |
Have dirtree_notdotdot() pass through !node->parent so . and .. on the command
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.)
Diffstat (limited to 'toys/posix/rm.c')
-rw-r--r-- | toys/posix/rm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/rm.c b/toys/posix/rm.c index 99fa8edf..2f99c326 100644 --- a/toys/posix/rm.c +++ b/toys/posix/rm.c @@ -28,7 +28,7 @@ static int do_rm(struct dirtree *try) int dir = S_ISDIR(try->st.st_mode), or = 0, using = 0; // Skip . and .. (yes, even explicitly on the command line: posix says to) - if (!dirtree_notdotdot(try)) return 0; + if (isdotdot(try->name)) return 0; // Intentionally fail non-recursive attempts to remove even an empty dir // (via wrong flags to unlinkat) because POSIX says to. |