]> git.ipfire.org Git - thirdparty/coreutils.git/commit
chmod: fix erroneous warnings with -R --changes
authorDylan Simon <dylan@dylex.net>
Tue, 18 Mar 2014 15:50:29 +0000 (11:50 -0400)
committerPádraig Brady <P@draigBrady.com>
Wed, 19 Mar 2014 02:33:44 +0000 (02:33 +0000)
commit09eda9ed9d386f3aa84bfff1699cc4cfcec8647e
tree5909449e495d5080b7999c2c6dd65ff7e6033271
parent5b790fda0e3781746451031284ce9730d79c9a89
chmod: fix erroneous warnings with -R --changes

For files with "special" bits set, we would stat the relative
file name in the wrong directory, giving an erroneous ENOENT diagnostic.
This issue was introduced with commit v5.92-653-gc1994c1
which changed fts to not change directory on traversal.

* src/chmod.c (mode_changed): Use fts->fts_cwd_fd with fstatat rather
than stat.  All callers changed.
* tests/chmod/c-option.sh: Add a test case.
* NEWS: Mention the fix.
Fixes http://bugs.gnu.org/17035
NEWS
src/chmod.c
tests/chmod/c-option.sh