From d74a1e667fe14fa35e9af1b08a34535dc4a0144c Mon Sep 17 00:00:00 2001 From: Pierre Warnier Date: Fri, 3 Apr 2026 18:14:57 +0200 Subject: [PATCH] review: address all 7 Copilot review comments - shadow.rs: use ShadowError::Other instead of Parse for clock error - crypt.rs: use getrandom(2) syscall instead of /dev/urandom (works in chroot) - crypt.rs: reject rounds parameter for yescrypt in generate_salt() - crypt.rs: detect unsupported methods by verifying result prefix (musl compat) - crypt.rs: serialize tests with Mutex (crypt(3) uses static buffer) - crypt.rs: add 6 round-trip tests for hash_password/verify_password - chpasswd.rs: validate --sha-rounds range, reject -m unconditionally - chpasswd.rs: strip rounds for yescrypt before calling hash_password - chpasswd: add crypt feature to shadow-core dependency --- src/uu/chpasswd/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/chpasswd/Cargo.toml b/src/uu/chpasswd/Cargo.toml index 7dad5a3..96d46b1 100644 --- a/src/uu/chpasswd/Cargo.toml +++ b/src/uu/chpasswd/Cargo.toml @@ -21,7 +21,7 @@ path = "src/main.rs" [dependencies] clap = { workspace = true } nix = { workspace = true } -shadow-core = { workspace = true, features = ["shadow"] } +shadow-core = { workspace = true, features = ["shadow", "crypt"] } uucore = { workspace = true } zeroize = { workspace = true }