<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src, branch v9.5</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v9.5</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v9.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2024-03-26T18:57:32Z</updated>
<entry>
<title>ls: avoid ENOENT from readdir() on FreeBSD 14</title>
<updated>2024-03-26T18:57:32Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2024-03-26T18:27:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=6e2b4769cc0690075dfda0a297fab043411b7c7c'/>
<id>urn:sha1:6e2b4769cc0690075dfda0a297fab043411b7c7c</id>
<content type='text'>
* src/ls.c (print_dir): readdir() on FreeBSD 14 was
seen to pass ENOENT through.  ENOENT in this context
means "Directory unlinked but still open".
Reported by Bruno Haible with tests/ls/removed-directory.sh
</content>
</entry>
<entry>
<title>cp: with --no-preserve=mode ensure set-group-ID bits maintained on dirs</title>
<updated>2024-03-25T22:27:15Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2024-03-25T22:17:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=30039cb23a2cbdc2ef92e7c474bd9d9ae404ffe0'/>
<id>urn:sha1:30039cb23a2cbdc2ef92e7c474bd9d9ae404ffe0</id>
<content type='text'>
This issue was introduced in commit v8.19-145-g24ebca6

* src/copy.c (copy_internal): On systems that don't support ACLs,
the fallback default chmod done on directories should maintain
the set-group-ID, as that's generally auto-set by the system.
* NEWS: Mention the fix.
Reported by Bruno Haible on Alpine (with tests/cp/preserve-mode.sh)
</content>
</entry>
<entry>
<title>doc: fix translation issue in chown/chgrp amalgamation</title>
<updated>2024-03-24T20:25:37Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2024-03-24T20:12:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=26fd96a96c6c84fbbcfe0919c34ac56511949cb3'/>
<id>urn:sha1:26fd96a96c6c84fbbcfe0919c34ac56511949cb3</id>
<content type='text'>
* src/chown-core.h (emit_from_option_description): The conditional
string composition here caused issues for translators.
Instead move to a more general description ...
(src/chown.c (usage): ... here.
Fixes https://bugs.gnu.org/69985
</content>
</entry>
<entry>
<title>doc: fix various translation issues</title>
<updated>2024-03-24T19:57:29Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2024-03-24T19:55:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=6259593ac708a989ea5beea4dce14d4651397af8'/>
<id>urn:sha1:6259593ac708a989ea5beea4dce14d4651397af8</id>
<content type='text'>
 src/chown.c (usage): Translate parameterized strings.
 src/copy.c (copy_internal): Translate each part of ternary.
* src/cp.c (usage): Fix typo; s/exisiting/existing/.
</content>
</entry>
<entry>
<title>mv: treat --exchange more like non-exchange</title>
<updated>2024-03-23T01:39:27Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2024-03-23T01:38:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=5a1d00e4504204dc4c84eb641abb961e8074a218'/>
<id>urn:sha1:5a1d00e4504204dc4c84eb641abb961e8074a218</id>
<content type='text'>
Also, improve quality of diagnostics.
Problems/suggestions by Bernhard Voelker in
&lt;https://bugs.gnu.org/69532#82&gt;.
* src/copy.c (emit_verbose): New arg FORMAT.  All uses changed,
to improve quality of diagnostics when --exchange is used.
(copy_internal): Don’t try to optimize --exchange so much; this
simplifies the code and keeps it closer to the non --exchange case.
</content>
</entry>
<entry>
<title>cp,ln,mv: improve dir vs nondir diagnostics</title>
<updated>2024-03-23T01:39:27Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2024-03-22T19:02:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=ff42adb55e99226f55a7b141316ee2a7b84a4857'/>
<id>urn:sha1:ff42adb55e99226f55a7b141316ee2a7b84a4857</id>
<content type='text'>
* src/copy.c (copy_internal): Simplify logic for copying
from directory to non-directory or vice versa, and always
diagnose with both source and destination file names.
</content>
</entry>
<entry>
<title>env: add -a,--argv0 to set the first argument passed to exec</title>
<updated>2024-03-22T13:12:52Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2023-03-02T14:56:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=193449b17334649a2abcbca589544d858fca92a1'/>
<id>urn:sha1:193449b17334649a2abcbca589544d858fca92a1</id>
<content type='text'>
Using the shell's exec -a feature can be awkward
so add support for setting overriding argv[0].
This gives env full control over the arguments it passes.

* src/env.c: Accept -a,--argv0 and set argv[0] appropriately.
* tests/env/env.sh: Add test cases.
* doc/coreutils.texi (env invocation): Describe -a,--argv0.
* NEWS: Mention the new feature.
</content>
</entry>
<entry>
<title>mv: new option --exchange</title>
<updated>2024-03-20T21:40:29Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2024-03-20T21:00:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=5d3fd24f4286d422482dd1697c9fe1bfa30f608e'/>
<id>urn:sha1:5d3fd24f4286d422482dd1697c9fe1bfa30f608e</id>
<content type='text'>
* src/copy.h (struct cp_options): New member 'exchange'.
* src/copy.c (copy_internal): Support the new member.
* src/mv.c (EXCHANGE_OPTION): New constant.
(long_options): Add --exchange.
(usage): Document --exchange.
(main): Support --exchange.
* tests/mv/mv-exchange.sh: New test case.
* tests/local.mk (all_tests): Add it.
</content>
</entry>
<entry>
<title>chmod: fix TOCTOU security issue with symlink replacement</title>
<updated>2024-03-19T23:56:45Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2024-03-19T23:34:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=425b8a2f534fe02e8c1e39ad6a3d2c18eca12de3'/>
<id>urn:sha1:425b8a2f534fe02e8c1e39ad6a3d2c18eca12de3</id>
<content type='text'>
This is an issue with -[H]R mode, where an attacker
may replace a traversed file with a symlink
between where we stat() the file and chmod() the file.

* src/chmod.c (process_file): Remove the first !S_ISLNK guard
as that's now just an optimization, and instead consistently
apply fchmodat() to files/symlinks.  Ensure AT_SYMLINK_NOFOLLOW
is set when traversing in default (-H) mode.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/11108
</content>
</entry>
<entry>
<title>chmod: add support for -h, -H,-L,-P, --dereference options</title>
<updated>2024-03-19T23:43:53Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2016-11-28T08:13:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=07a69fc3ba717b879218592db685a1c79869cb28'/>
<id>urn:sha1:07a69fc3ba717b879218592db685a1c79869cb28</id>
<content type='text'>
There have been various requests to add -h to avoid following symlinks
for security reasons.  This wasn't provided previously as chmod(1)
already ignored symlinks unless specified on the command line.
Note chmod defaults to -H mode rather than the chown default of -P,
as usually chown can work directly on symlinks and so defaults
to not traversing those specified on the command line.
Note FreeBSD chmod does default to -P mode, but we retain the -H mode
default also for compatibility with existing chmod behavior.

Adding -HLP will allow chmod to disable traversing CLI symlinks to dirs.
Adding -h will allow to disable following CLI symlinks to files/dirs,
  also operating on all symlinks on systems that support that.
Adding --dereference will be significant with -H (the default).  I.e.
  symlinks to dirs not recursed, but symlinks are dereferenced.
Adding these options will also be consistent with chown(1), chgrp(1),
and chmod(1) on other systems.

Note since chmod(1) currently ignores symlinks by default,
and -h is primarily a mechanism to avoid following symlinks, rather than
for operating on the symlink itself, we make -h try to chmod a symlink,
but ignore ENOTSUP.  In that way we're consistent with chown(1)
where it also ignores ENOTSUP for symlinks, and we don't fail when
trying to be extra secure with command line params.

* doc/coreutils.texi (chmod invocation): Reference the -H,-L,-P
descriptions, and adjust the corresponding macros to say
the default is -H or -P as appropriate.
Add --dereference and -h,--no-dereference descriptions.
* man/chmod.x: Adjust discussion of symlink handling.
* src/chmod.c (main): Accept new options and set
fts flags appropriately.
(process_file): Process / dereference symlinks as necessary.
* src/system.h (emit_symlink_recurse_options): A new function
refactored from chown.c and chmod.c usage().
* tests/chmod/symlinks.sh: New test for the new options.
* tests/local.mk: Reference the new test.
* NEWS: Mention the new feature.
</content>
</entry>
</feed>
