aboutsummaryrefslogtreecommitdiff
path: root/tests/rm.test
diff options
context:
space:
mode:
authorYi-Yo Chiang <yochiang@google.com>2021-02-02 03:22:02 +0800
committerRob Landley <rob@landley.net>2021-02-01 22:00:30 -0600
commita8d8fbfa659b1e7e68110e6468de1bcf6a61fe34 (patch)
tree14d85f7aab35f7d3147074b8fe49ca7990ed835d /tests/rm.test
parentfdbdcc2ea1ab813f1fb9302f9a0e47d94ce33108 (diff)
downloadtoybox-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 'tests/rm.test')
0 files changed, 0 insertions, 0 deletions