1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-07-06 00:38:55 +02:00

13 Commits

Author SHA1 Message Date
Pádraig Brady 5d3f03b4fb stat: use quoted file names with --terse
* src/stat.c: Use %Qn rather than a bare %n by default,
so output is maintained on a single line for parsing.
2026-06-04 13:48:05 +01:00
Pádraig Brady 49f3b66719 stat: support %Qn format to output quoted file name
%N also outputs the target of a symlink
so support %Qn to give more control over quoted names.

* src/stat.c (print_it): Validate %Qn.
(print_stat): Output quoted file name with %Qn.
(usage): Add %Qn description.
* doc/coreutils.texi (stat invocation): Likewise.
* tests/stat/stat-fmt.sh: Add a test case.
2026-06-04 13:14:27 +01:00
Pádraig Brady 641422abad stat: honor QUOTING_STYLE in default file name quoting
This is safer to output to terminal with malicious file names,
with multiple lines or control characters etc.

* src/stat.c: Quote the file name in the default output format
in the default quoting style, or as selected with QUOTING_STYLE.
Reported by Michał Majchrowicz and Marcin Wyczechowski.
2026-06-04 13:14:27 +01:00
Sylvestre Ledru cec863ff08 tests: stat: cover %N escaping of control characters
The default shell-escape quoting style escapes control characters in
file names (e.g. newlines) as $'...' sequences, but no test exercised
this; only the single-quote character was covered.
referenced here: https://github.com/uutils/coreutils/issues/9925

* tests/stat/stat-fmt.sh: Add a case with a file name containing
contiguous and separated newlines.
https://github.com/coreutils/coreutils/pull/271
2026-05-29 19:19:36 +01:00
Pádraig Brady 54e9fcb640 tests: avoid false failure with hidden /proc on Guix
* tests/stat/stat-mount.sh: Don't try our stat under unshare
unless mount(8) exits gracefully.
Reported by Bruno Haible.
2026-04-16 21:28:44 +01:00
Pádraig Brady 57cea2bb6c tests: stat: ensure independence from /proc/
* tests/stat/stat-mount.sh: Ensure stat -c '%a'
is independent from /proc.
https://github.com/coreutils/coreutils/pull/250
2026-04-10 14:55:07 +01:00
Paul Eggert d53203b316 stat: handle %%%N too
* src/stat.c (main): Fix incorrect counting of '%'s before 'N'.
* tests/stat/stat-fmt.sh: Test for the bug.
2026-02-27 16:50:36 -08:00
Collin Funk 803bfa01e1 stat: don't check QUOTING_STYLE when --printf %%N is used
* NEWS: Mention the fix.
* src/stat.c (main): Only check QUOTING_STYLE if there is a %N that is
not preceded by a percentage sign.
* tests/stat/stat-fmt.sh: Add some test cases.
2026-02-26 21:20:37 -08:00
Collin Funk 73d3a49f45 maint: run 'make update-copyright' 2026-01-01 10:56:16 -08:00
Pádraig Brady 28b176085f maint: update all copyright year number ranges
Update to latest gnulib with new copyright year.
Run "make update-copyright" and then...

* gnulib: Update included in this commit as copyright years
are the only change from the previous gnulib commit.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
2025-01-01 09:33:08 +00:00
Paul Eggert 65a46e9e21 tests: port to noatime file systems
On these file systems the atime is always zero.
Problem found with ZFS on Ubuntu 24.04 LTS.
* tests/stat/stat-birthtime.sh (check_timestamps_updated):
* tests/stat/stat-nanoseconds.sh:
Work even if atimes are always zero.
* tests/stat/stat-nanoseconds.sh:
Fix typo: print_ver_ called before init.sh sourced.
2024-07-16 01:54:20 +00:00
Pádraig Brady a966dcdb69 maint: update all copyright year number ranges
Update to latest gnulib with new copyright year.
Run "make update-copyright" and then...

* gnulib: Update included in this commit as copyright years
are the only change from the previous gnulib commit.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Manually update copyright year,
until we fully sync with gnulib at a later stage.
* tests/sample-test: Adjust to use the single most recent year.
2024-01-01 13:27:23 +00:00
Sylvestre Ledru 15925d0e5b tests: move tests to a directory per utility
* cfg.mk: Adjust syntax check exclusion paths.
* tests/local.mk: Adjust for renamed tests.
2023-06-19 13:12:37 +01:00