]> git.ipfire.org Git - thirdparty/coreutils.git/commit
chmod: fix use of uninitialized var if -v
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 16 Aug 2021 04:29:38 +0000 (21:29 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 16 Aug 2021 04:32:09 +0000 (21:32 -0700)
commitbbb19b18687d5572dcbe7bbb1a48c8ee0f21786b
tree2ef97eca5bc68fe9b85c4958d2f91d74911721c7
parent29079b9aa2d25d7a2f69245946fcabc2167dc4f7
chmod: fix use of uninitialized var if -v

Problem reported by Michael Debertol (Bug#50070).
* NEWS: Mention the fix.
* src/chmod.c (struct change_status): New struct, replacing the
old enum Change_status.  All uses changed.
(describe_change): Distinguish between cases depending on
whether 'stat' or its equivalent succeeded.  Report a line
of output even if 'stat' failed, as that matches the documentation.
Rework to avoid casts.
(process_file): Do not output nonsense modes computed from
uninitialized storage, removing a couple of IF_LINTs.  Simplify by
defaulting to CH_NO_STAT.
NEWS
src/chmod.c