diff options
author | Yi-Yo Chiang <yochiang@google.com> | 2021-02-02 03:22:02 +0800 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2021-02-01 22:00:30 -0600 |
commit | a8d8fbfa659b1e7e68110e6468de1bcf6a61fe34 (patch) | |
tree | 14d85f7aab35f7d3147074b8fe49ca7990ed835d /toys/posix/paste.c | |
parent | fdbdcc2ea1ab813f1fb9302f9a0e47d94ce33108 (diff) | |
download | toybox-a8d8fbfa659b1e7e68110e6468de1bcf6a61fe34.tar.gz |
rm: Check file existence with lstat() explicitly if "-f" is specified
Instead of unlink() && check errno, call lstat() explicitly to check
file existence if "-f" is specified.
There is a regression when if the path to be removed is nonexistence
and within a readonly filesystem, then unlink() could set the EROFS
errno instead of ENOENT, thus screwing up the output of `rm`.
Diffstat (limited to 'toys/posix/paste.c')
0 files changed, 0 insertions, 0 deletions