Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:Update
coreutils.1874
coreutils-chmod-fix-erroneous-warnings-with-R-c...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File coreutils-chmod-fix-erroneous-warnings-with-R-changes.patch of Package coreutils.1874
Upstream patch on top of v8.22 (upstream since v8.23). chmod: fix erroneous warnings with -R --changes (boo#994678). Original upstream commit: - http://git.sv.gnu.org/cgit/coreutils.git/commit/?id=09eda9ed9d Downstream adjustment of the patch: - Tweak change in NEWS. From 09eda9ed9d386f3aa84bfff1699cc4cfcec8647e Mon Sep 17 00:00:00 2001 From: Dylan Simon <dylan@dylex.net> Date: Tue, 18 Mar 2014 11:50:29 -0400 Subject: [PATCH] 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 | 7 ++++++- src/chmod.c | 11 +++++++---- tests/chmod/c-option.sh | 11 +++++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) Index: NEWS =================================================================== --- NEWS.orig 2016-08-31 10:44:56.797934059 +0200 +++ NEWS 2016-08-31 10:44:56.841934455 +0200 @@ -1,6 +1,11 @@ GNU coreutils NEWS -*- outline -*- - Changes done after the release of 8.22 +Downstream openSUSE changes done after the release of 8.22 + +** Bug fixes + + chmod -Rc no longer issues erroneous warnings for files with special bits set. + [bug introduced in coreutils-6.0] df --local no longer hangs with inaccessible remote mounts. [bug introduced in coreutils-8.21] Index: src/chmod.c =================================================================== --- src/chmod.c.orig 2013-12-04 15:48:30.000000000 +0100 +++ src/chmod.c 2016-08-31 10:44:56.841934455 +0200 @@ -111,7 +111,8 @@ static struct option const long_options[ The old mode was OLD_MODE, but it was changed to NEW_MODE. */ static bool -mode_changed (char const *file, mode_t old_mode, mode_t new_mode) +mode_changed (int dir_fd, char const *file, char const *file_full_name, + mode_t old_mode, mode_t new_mode) { if (new_mode & (S_ISUID | S_ISGID | S_ISVTX)) { @@ -120,10 +121,11 @@ mode_changed (char const *file, mode_t o struct stat new_stats; - if (stat (file, &new_stats) != 0) + if (fstatat (dir_fd, file, &new_stats, 0) != 0) { if (! force_silent) - error (0, errno, _("getting new attributes of %s"), quote (file)); + error (0, errno, _("getting new attributes of %s"), + quote (file_full_name)); return false; } @@ -283,7 +285,8 @@ process_file (FTS *fts, FTSENT *ent) if (verbosity != V_off) { bool changed = (chmod_succeeded - && mode_changed (file, old_mode, new_mode)); + && mode_changed (fts->fts_cwd_fd, file, file_full_name, + old_mode, new_mode)); if (changed || verbosity == V_high) { Index: tests/chmod/c-option.sh =================================================================== --- tests/chmod/c-option.sh.orig 2013-12-04 15:48:30.000000000 +0100 +++ tests/chmod/c-option.sh 2016-08-31 10:44:56.841934455 +0200 @@ -37,4 +37,15 @@ case "$(cat out)" in *) cat out; fail=1 ;; esac +# From V5.1.0 to 8.22 this would stat the wrong file and +# give an erroneous ENOENT diagnostic +mkdir -p a/b || framework_failure_ +# chmod g+s might fail as detailed in setgid.sh +# but we don't care about those edge cases here +chmod g+s a/b +# This should never warn, but it did when special +# bits are set on b (the common case under test) +chmod -c -R g+w a 2>err +compare /dev/null err || fail=1 + Exit $fail
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor