Skip to content

Commit 1d4153a

Browse files
authored
Merge branch 'main' into mv-fchown-cross-device
2 parents 3e5bd97 + 529f011 commit 1d4153a

82 files changed

Lines changed: 641 additions & 378 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/CICD.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ jobs:
876876
- { os: ubuntu-latest, features: "md5sum,sha1sum,sha224sum,sha256sum,sha384sum,sha512sum,cksum,openssl" }
877877
# macOS: vendored only — system libcrypto needs OPENSSL_DIR
878878
# pointing at Homebrew, which isn't worth wiring up for a smoke test.
879-
# todo: check Windows (MinGW's system openssl)
879+
# MinGW(UCRT): done at make.yml as actual consumer is MSYS2 only
880880
steps:
881881
- uses: actions/checkout@v7
882882
with:

.github/workflows/GnuComment.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ jobs:
1717

1818
runs-on: ubuntu-latest
1919
if: >
20-
github.event.workflow_run.event == 'pull_request'
20+
github.event.workflow_run.event == 'pull_request' &&
21+
(github.event.workflow_run.conclusion == 'success' ||
22+
github.event.workflow_run.conclusion == 'failure')
2123
steps:
2224
- name: 'Download artifact'
2325
uses: actions/github-script@v9
@@ -34,6 +36,10 @@ jobs:
3436
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
3537
return artifact.name == "comment"
3638
})[0];
39+
if (!matchArtifact) {
40+
core.info("No comment artifact found; skipping.");
41+
return;
42+
}
3743
var download = await github.rest.actions.downloadArtifact({
3844
owner: context.repo.owner,
3945
repo: context.repo.repo,

.github/workflows/make.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,15 +311,16 @@ jobs:
311311
# Upgrading it mid-session changes the shared memory layout (60344 -> 59320),
312312
# which causes subsequent fork() calls to fail with EAGAIN (exit code 254).
313313
shell: 'C:\msys64\usr\bin\bash.exe --login -eo pipefail {0}'
314+
# test Cygwin & MinGW(UCRT) instead of pre-installed Rust.
314315
run: |
315-
pacman -Sy --noconfirm --needed base-devel libopenssl make openssl-devel pkgconf rust
316+
pacman -Sy --noconfirm --needed base-devel libopenssl make openssl-devel pkgconf rust \
317+
mingw-w64-ucrt-x86_64-openssl mingw-w64-ucrt-x86_64-rust
316318
env:
317319
CHERE_INVOKING: 1
318320
- name: "`(x86_64-pc-cygwin) make install PROG_PREFIX=uu- PROFILE=release-small COMPLETIONS=n MANPAGES=n LOCALES=n`"
319321
shell: 'C:\msys64\usr\bin\bash.exe --login -eo pipefail {0}'
320322
run: |
321323
set -x
322-
export OPENSSL_NO_VENDOR=1
323324
export CARGOFLAGS="--features openssl"
324325
DESTDIR=/tmp/c make install PROG_PREFIX=uu- PROFILE=release-small COMPLETIONS=n MANPAGES=n LOCALES=n
325326
# Check that cksum is linked with openssl (e.g. msys-crypto-*.dll)
@@ -339,6 +340,7 @@ jobs:
339340
bsdtar -caf x86_64-pc-cygwin.tar.zst -C /tmp/c/usr/local bin
340341
env:
341342
CHERE_INVOKING: 1
343+
OPENSSL_NO_VENDOR: "1"
342344
RUST_BACKTRACE: "1"
343345
- name: Publish
344346
uses: softprops/action-gh-release@v3
@@ -351,14 +353,21 @@ jobs:
351353
individual-x86_64-pc-cygwin.tar.zst
352354
env:
353355
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
354-
- name: "`make install`"
355-
shell: bash
356+
- name: "`make install` (MinGW UCRT)"
357+
shell: 'C:\msys64\usr\bin\bash.exe --login -eo pipefail {0}'
358+
env:
359+
CHERE_INVOKING: 1
360+
MSYSTEM: "UCRT64"
361+
OPENSSL_DIR: "/ucrt64"
362+
OPENSSL_NO_VENDOR: "1"
363+
OPENSSL_STATIC: "0"
356364
run: |
357365
set -x
366+
export CARGOFLAGS="--features openssl"
358367
# Check that we exclude unix programs to avoid build failure
359368
# Windows's stdbuf depends on Cygwin's libstdbuf. So make should not try to install libstdbuf
360369
make install DESTDIR=/tmp/w PREFIX=/tmp/usr MULTICALL=y COMPLETIONS=n MANPAGES=n LOCALES=n \
361-
SKIP_UTILS="arch b2sum base32 base64 basename basenc cat cksum comm cp csplit cut date dd df dir dircolors dirname du echo env expand expr factor false fmt fold head hostname hostid join link ln ls md5sum mkdir mktemp more mv nl nproc numfmt od paste pathchk pr printenv printf ptx pwd readlink realpath rm rmdir seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf sleep sort split sum sync tac tail tee test touch tr true truncate tsort tty uname unexpand uniq unlink vdir wc whoami yes"
370+
SKIP_UTILS="arch b2sum base32 base64 basename basenc cat comm cp csplit cut date dd df dir dircolors dirname du echo env expand expr factor false fmt fold head hostname hostid join link ln ls md5sum mkdir mktemp more mv nl nproc numfmt od paste pathchk pr printenv printf ptx pwd readlink realpath rm rmdir seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf sleep sort split sum sync tac tail tee test touch tr true truncate tsort tty uname unexpand uniq unlink vdir wc whoami yes"
362371
target/release/coreutils.exe stdbuf --version
363372
364373
test_busybox:

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub fn main() {
2121

2222
// Check for tldr.zip when building uudoc to warn users once at build time
2323
// instead of repeatedly at runtime for each utility
24+
println!("cargo:rerun-if-changed=docs/tldr.zip");
2425
if env::var("CARGO_FEATURE_UUDOC").is_ok() && !Path::new("docs/tldr.zip").exists() {
2526
println!(
2627
"cargo:warning=No tldr archive found, so the documentation will not include examples."

deny.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ skip = [
6666
{ name = "itertools", version = "0.13.0" },
6767
# codspeed-divan-compat-macros
6868
{ name = "itertools", version = "0.14.0" },
69-
# ordered-multimap
70-
{ name = "hashbrown", version = "0.14.5" },
7169
# lru (via num-prime)
7270
{ name = "hashbrown", version = "0.16.1" },
7371
# cexpr (via bindgen)

fuzz/fuzz_targets/fuzz_env.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
5+
56
// spell-checker:ignore chdir putenv
67

78
#![no_main]

src/uu/chroot/src/chroot.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// file that was distributed with this source code.
55

66
// spell-checker:ignore (ToDO) NEWROOT Userspec chrooting chroots chdir pstatus repointed
7+
78
mod error;
89

910
use crate::error::ChrootError;

src/uu/cp/src/cp.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,6 +1892,11 @@ pub(crate) fn copy_attributes(
18921892
attributes.mode
18931893
};
18941894

1895+
// A created directory only defaults to copying the source mode; unlike an
1896+
// explicit preserve (-p/-a), GNU applies the umask to it.
1897+
let apply_umask_to_mode =
1898+
dest_is_freshly_created_dir && !matches!(attributes.mode, Preserve::Yes { .. });
1899+
18951900
// Track whether `chown` to the source's uid succeeded. If it did not
18961901
// (typical case: non-root user copying a root-owned setuid file), the
18971902
// mode preservation below must strip setuid/setgid so the destination
@@ -1956,6 +1961,12 @@ pub(crate) fn copy_attributes(
19561961
let mode = perms.mode() & !0o6000;
19571962
perms.set_mode(mode);
19581963
}
1964+
if apply_umask_to_mode {
1965+
// The umask never covers setuid/setgid, so clear them
1966+
// explicitly: a non-preserving copy must not carry the
1967+
// source's set-user/group-ID bits into the new directory.
1968+
perms.set_mode(perms.mode() & !0o6000 & !uucore::mode::get_umask());
1969+
}
19591970
perms
19601971
};
19611972
#[cfg(not(unix))]

src/uu/csplit/src/csplit.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// file that was distributed with this source code.
55

66
// spell-checker:ignore rustdoc
7+
78
#![allow(rustdoc::private_intra_doc_links)]
89

910
use std::borrow::Borrow;

0 commit comments

Comments
 (0)