Commit Graph
5548 Commits
Author SHA1 Message Date
Sylvestre Ledru 8fcb17af79 ln: don't leave the temp behind when the rename is a no-op
Renaming the temp onto a destination that is already a link to the same
inode does nothing and returns success, so the temp name survived:
`ln -f a b` with b already hard-linked to a left a stray Cu* file.

Unlink the temp after the rename either way; on the normal path it is
already gone.
2026-09-16 23:48:22 +02:00
Sylvestre Ledru 0ab17fc1dd generalize the mv code for ln, cp
replace links atomically instead of unlinking first

Forced replacement was unlink(dst) then create. The gap lets another user
claim dst in a directory they can write to -- including a name the sticky
bit forbids them to remove -- so a privileged ln hands them a trusted name.
2026-09-16 23:48:22 +02:00
nagendramohan c6b9e4f092 ln: keep the destination when a forced link fails
`ln -f A B` unlinked B before attempting the link, so a link that failed
for any reason other than the destination already existing (a missing
source, a directory source, a dangling symlink with -L) left B deleted.

Attempt the link first and remove an existing destination only after the
link reports EEXIST, matching GNU, so a failed link never destroys the
destination.

Fixes #14550

Signed-off-by: nagendramohan <nagendramohan1990@gmail.com>
2026-09-15 09:42:58 +02:00
xtqqczze 5dbba49d50 chore: add missing newlines around spell-checker header 2026-09-15 09:04:19 +02:00
xtqqczze feebd94221 chore: add missing newlines after copyright header 2026-09-15 09:04:19 +02:00
Zhiwei Liang c3c07acf68 ls: use name sort for -u/-c in long format
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
2026-09-15 09:02:54 +02:00
xtqqczze 46af446950 test(stty): gate by target support 2026-09-15 08:52:31 +02:00
Yusuf Efe bf06f912dc csplit: always create the final split, even when empty
The rest of the input only got its own split when something was left
after the patterns, or when every pattern was a line number with
--suppress-matched. GNU always ends with that split, so a suppressed
match on the last line or an offset reaching the end of the input left
one file short. A {*} regex is the exception: it has already consumed
the input by the time it stops matching.
2026-09-15 08:22:29 +02:00
Zhiwei Liang b6726cc6ad dir, vdir: match GNU default quoting
Apply escape quoting and TTY control-character display in Config instead of patching quoting_style in the dir and vdir wrappers.

Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
2026-09-14 15:56:06 +02:00
wtcpython e2b5089553 cp: retain --no-preserve over later --preserve 2026-09-14 15:39:37 +02:00
oech3 a5891bcabf test_install.rs: add test case for eCryptfs 2026-09-14 14:39:22 +02:00
Sachin Kudlur Siddappa 3b5338affd fix(ls): ensure ACL and capability markers respect dereference config 2026-09-14 12:01:13 +02:00
Zhiwei Liang 3b9412956c uptime: accept hour or minute in pretty-print tests
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
2026-09-14 10:29:59 +02:00
thy cd434435d6 chmod: do not check umask on skipped symlinks during recursion 2026-09-14 09:59:05 +02:00
Daniel Hofstetter 6f650915d6 date: allow multiple --reference 2026-09-14 09:21:07 +02:00
xtqqczze d4ed53392a sort: gate tests correctly for BSD 2026-09-14 09:18:29 +02:00
oech3 a619a91832 CICD.yml: publish binaries with static openssl 2026-09-14 09:03:37 +02:00
Daniel Hofstetter 873adc93c9 date: rewrite test to remove thread::sleep (#14535) 2026-09-13 18:57:04 +02:00
Keith Hall bde787352b expr: switch to leftmost-longest regex matching behavior (#14527) 2026-09-13 18:56:43 +02:00
thy b125b38bbe cp: fix copying entries sharing parent directory name with -R . 2026-09-13 14:19:31 +02:00
oech3 5b7596c4ea nohup: build for Windows 2026-09-12 23:32:46 +02:00
Leonard Hecker fba6b9dbc1 Fix clippy warnings 2026-09-12 22:57:41 +02:00
Sylvestre Ledru f1272d52aa ls: include the -i/-s prefix in --dired offsets 2026-09-12 22:49:01 +02:00
Sylvestre Ledru 35631b7efd ls: account for the leading color reset in --dired offsets
When LS_COLORS sets a `no` style, ls emits a reset sequence before the
first listed line. Those bytes were written straight to the output
without advancing the //DIRED// line offset, so every reported pair was
short by the length of the reset and pointed inside the escape sequence
instead of at the name.
2026-09-12 22:49:01 +02:00
Sylvestre Ledru 43a7030922 ls: don't panic when writing the --dired trailer fails
print_dired_output ignored the BufWriter it was given and used the print
macros, which panic on a write error, and its flush reported one as a
plain I/O error. Write the trailer through the BufWriter instead, so a
failure is reported as GNU does: "write error", exit 2.

https://github.com/uutils/coreutils/issues/14497
2026-09-12 22:49:01 +02:00