1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00
Commit graph

3499 commits

Author SHA1 Message Date
Sylvestre Ledru
832dd495bf selinux: adjust more error messages 2025-05-07 22:58:46 +02:00
Daniel Hofstetter
bcc02e9cea
Merge pull request #7897 from aaron-ang/ptx-panic
ptx: use char count instead of byte index to handle utf-8 characters
2025-05-07 15:52:13 +02:00
Aaron Ang
1cfb19a936 ptx: use char count instead of byte index to handle utf-8 characters 2025-05-06 23:41:02 -07:00
Daniel Hofstetter
b78f78bedf uptime: use clap to handle too many path args 2025-05-06 16:05:23 +02:00
Sylvestre Ledru
5148ba12d6 set_selinux_security_context: also display the error from the crate
+ fix comments from review
2025-05-06 08:52:27 +02:00
Sylvestre Ledru
b3a2b74ca1 cp/selinx: improve the support of --preserve-context and simplify the code.
+ Add test for the selinux changes with context SLASHLogin
Improves the coverage of tests/cp/cp-a-selinux.sh
2025-05-06 08:52:27 +02:00
Sylvestre Ledru
e7fdd3dfba selinux: add support in cp 2025-05-06 08:52:27 +02:00
Alexander
7d5cfbc4b6
Merge pull request #7881 from alexs-sh/7736-control-flow-experiments
uucore/echo:handle ControlFlow result
2025-05-05 00:33:51 +02:00
cerdelen
13c0a813eb
Remove clap for echo (#7603)
* Parsing echo flags manually without clap as clap introduced various problematic interactions with hyphens

* fixed error where multiple flags would parse wrong

* Spelling & formatting fixes

* docu for EchoFlag struct

* more extensive comment/documentation

* revert POSIXLY_CORRECT check to only check if it is set

* Fixed problem of overwriting flags. Added test for same issue

* cargo fmt

* cspell

* Update src/uu/echo/src/echo.rs

Enabling POSIXLY_CORRECT flag if value is not UTF-8

Co-authored-by: Jan Verbeek <jan.verbeek@posteo.nl>

---------

Co-authored-by: Jan Verbeek <jan.verbeek@posteo.nl>
2025-05-04 20:13:52 +02:00
hz2
6d29b7b3c1
Tail macos stdin ran from script fix (#7844)
* fixes #7763

- introduce macOS-specific config guard
- added test for testing tail stdin when redirected (`>`) from file and
  when through a pipe (`|`)

* created test to mock behavior in #7763, with comments

added drop line

* re-enabled test_stdin_redirect_dir_when_target_os_is_macos, and added a check to handle error message

* added location of current directory so test env can find script

* adjusting to try to have FreeBSD find the file in CI test

* putting in /env instead of assuming bash

* removed ignore macro

* added comments explaining the need for specific macOS cases, including reference to rust-lang issue: https://github.com/rust-lang/rust/issues/95239
2025-05-04 18:33:09 +02:00
Teemu Pätsi
4ee53acad0
expr: Fix parsing negated character classes "[^a]" (#7884)
* expr: Fix regex escape logic

We have to track if the previous character was already escaped to determine
if the '\' character should be interpreted as an escape character.

* expr: Fix parsing caret (^) as character class negation token

* expr: Add tests for parsing carets in regex

* expr: Add missing semicolon

* expr: Simplify boolean assignment

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-05-04 17:35:18 +02:00
Daniel Hofstetter
69d5cf40b1
Merge pull request #7877 from yuankunzhang/main
split: fix a racing condition that causes issue #7869
2025-05-04 14:39:09 +02:00
Daniel Hofstetter
8c4d69b2f6
Merge pull request #7845 from sylvestre/selinux-error
set_selinux_security_context should return an Error, not String
2025-05-04 12:45:53 +02:00
yuankunzhang
d412f582cb split: fix a racing condition that causes issue #7869 2025-05-04 16:49:03 +08:00
Daniel Hofstetter
5909315d1c
date: move file header to top; merge imports (#7857) 2025-05-04 09:36:21 +02:00
Daniel Hofstetter
cd3c921d1e
cp: copy dir if source path ends with dot (#7874) 2025-05-04 09:31:34 +02:00
Sylvestre Ledru
c177362a51 set_selinux_security_context: also display the error from the crate
+ fix comments from review
2025-05-03 23:16:43 +02:00
Dorian Péron
f49e120877
Merge pull request #7846 from frendsick/fix/expr-regex-option-singleline
expr: Fix regex anchor matching behavior with `REGEX_OPTION_SINGLELINE`
2025-05-02 13:35:10 +02:00
Daniel Hofstetter
ed0492a046 uptime: fix "unused import" warnings with musl 2025-05-02 09:09:57 +02:00
Zhang Wen
68c91c17ba
install: implement the --no-target-directory option (#7867)
* implement --no-target-directory option

* add test for --no-target-directory
2025-05-02 07:24:16 +02:00
Sylvestre Ledru
595f56a9e7 set_selinux_security_context: match GNU's error 2025-05-01 14:10:13 +02:00
Dorian Péron
279629f67e
Merge pull request #7855 from jtracey/printf-nonzero
printf: use non-zero indexes
2025-04-30 16:32:31 +02:00
Leo Emar-Kar
b14388ca41
ls: update chrono crate version and switch to new_lenient use (#7858)
* update chrono crate version and switch to new_lenient use

* bring back custom_tz_fmt and update test

* update chrono version in fuzz lock file

* replace boxing with parse_to_owned
2025-04-29 16:29:42 +02:00
Nicolas Boichat
19e08d5c11 test_date: Add test for quarter
This was fixed upstream in #7333, but it's a good idea to have a
test here as well, especially as we're considering switching
datetime library.
2025-04-29 21:35:00 +08:00
Nicolas Boichat
25e4410c3b date: Properly support %#z, instead of rejecting the format
It's easy to just replace %#z with %z as the capitalization makes
no sense anyway.
2025-04-29 21:35:00 +08:00
Justin Tracey
27487be267
printf: use non-zero indexes 2025-04-28 14:06:12 -04:00
Dan Hipschman
e92e419a93 cp: refuse to copy symlink over itself 2025-04-28 09:56:43 +02:00
bitspill
d957e64999
Merge pull request #7492 from bitspill/rm
rm: skip prompt when stdin is not interactive; Fix #7326
2025-04-27 23:54:16 +02:00
Teemu Pätsi
07501be4ae
expr: Escape anchor characters within pattern (#7842)
* expr: Escape anchor characters within the core pattern

The anchor characters `^` and `$` are not considered special characters by `expr`
unless they are used as expected on the start or end of the pattern.
2025-04-27 23:52:35 +02:00
Teemu Pätsi
c6e2f9fd9a
expr: Enable ignored test_anchor test 2025-04-26 18:28:21 +03:00
Sylvestre Ledru
606c0c1f57
Merge pull request #7837 from sargas/add-indexing-to-printf
printf: Add indexing to format strings
2025-04-25 23:58:01 +02:00
Dan Hipschman
fe93dae612 date: add tests for relative weekdays 2025-04-25 14:09:22 -07:00
Daniel Hofstetter
0ec36bef11
Merge pull request #7838 from zcg00/install_deletes_files
install: fixes issue #7795
2025-04-25 15:10:11 +02:00
Zachary Goff-Hodges
827d0fcee9
install: fixes issue #7795 2025-04-25 03:48:50 -07:00
Daniel Hofstetter
c5fba4bfd8
Merge pull request #7831 from sylvestre/selinux-mkfifo
mkfifo: implement selinux support
2025-04-25 09:11:50 +02:00
Joseph Jon Booker
7f98d98472 printf: Add indexing to format strings 2025-04-24 22:11:49 -05:00
Sylvestre Ledru
18db15e4e6
Merge pull request #7208 from jtracey/printf-go
printf: improve support of printing multi-byte values of characters
2025-04-24 22:02:13 +02:00
Sylvestre Ledru
b7f2815668
Merge pull request #7833 from cakebaker/shred_remove_obsolete_test
shred: remove obsolete test
2025-04-24 21:56:19 +02:00
Sylvestre Ledru
4a94a4e1dc spell: add getfattr in the ignore list 2025-04-24 21:54:29 +02:00
Sylvestre Ledru
8298173554 mkfifo: implement selinux support
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

merge
2025-04-24 21:54:12 +02:00
Daniel Hofstetter
48c4c82ab3 id: remove unnecessary #[cfg(unix)] in tests 2025-04-24 15:21:11 +02:00
Daniel Hofstetter
2b5391e6eb id: fix error message & simplify tests 2025-04-24 15:21:11 +02:00
Daniel Hofstetter
e378558996 shred: remove obsolete test 2025-04-24 09:25:11 +02:00
Jeremy Smart
b151e039ae
shred: fix random passes* (#7830)
* shred: fix random passes, update documentation, add test

* shred: update tests
2025-04-24 09:15:36 +02:00
Dorian Péron
151b196f50
Merge pull request #7828 from cakebaker/mknod_remove_duplicate_test
mknod: remove duplicate test
2025-04-24 05:08:07 +02:00
Jeremy Smart
044b33d8cb
Merge pull request #7760 from Qelxiros/7670-tail-hex-formatting
tail hex parsing, remove fundu dependency
2025-04-23 18:34:00 +02:00
Daniel Hofstetter
f91e3215c1 mknod: remove duplicate test 2025-04-23 17:33:58 +02:00
Daniel Hofstetter
67400abd70
Merge pull request #7818 from sylvestre/selinux-mknod
mknod: implement selinux support
2025-04-23 09:38:09 +02:00
Sylvestre Ledru
aebada4cd4 mknod: implement selinux support
+ improve the option management a bit
2025-04-23 08:37:42 +02:00
Teemu Pätsi
6ac444a9c6
id: Handle NULL pointer gracefully within cstr2cow macro (#7810)
* id: Handle NULL pointer gracefully within `cstr2cow` macro

> getlogin() returns a pointer to a string containing the name of the user logged in on the controlling terminal of the process, or a NULL pointer if this information cannot be determined.

Ref: https://linux.die.net/man/3/getlogin

* id: Remove redundant std::ffi:: prefix from CStr

* id: Add comment for the null check

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>

* id: Remove skip for test that should not segfault anymore

Segfault fixed by 292fb9242342d47412a789f4d0002b811568bd41

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2025-04-23 08:26:00 +02:00