Files
Pierre Warnier 92783375aa review: fix all findings from comprehensive code review
Security fixes:
- newgrp: add initgroups() before execv to reset supplementary groups (H-3)
- pam: use Zeroizing<String> for password buffers on all exit paths (M-5)
- atomic: retry-once on stale tmp file from crashed run (M-3)
- atomic: UmaskGuard opts out of Send/Sync via PhantomData (L-2)
- lock: flush + fsync in write_pid_file before hard_link (L-7)

Deduplication (~300 lines removed):
- Centralize caller_is_root(), current_username(), SignalBlocker in
  shadow_core::hardening — remove 10+5+5 private copies across tools
- Add SignalBlocker to all 6 remaining mutating tools (M-4)
- Remove dead CantSort variant from grpck, fix pwck allow (M-8)
- Remove dead read_passwd from test_chfn (M-8)

Binary cleanup:
- shadow-rs multicall: use ExitCode instead of process::exit (M-6)
- completions: use ExitCode + Result pattern, remove unwrap/exit (H-3)

Documentation:
- crypt: thread-safety warning on public API (H-1)
- shadow: clarify unlock() behavior for * password (H-2)
- validate: document $ rejection deviation from GNU (L-4)
- selinux/audit: note shell-out implementation status (L-6)
- chpasswd/chage tests: TODO for --prefix integration (M-8)
- userdel: document inline skip_unless_root reason (L-9)

Testing:
- Add fuzz targets for group and gshadow parsers (M-7)
- skel: use create_dir for tighter error detection (L-8)
- crypt: compile-time modulo bias assertion (L-1)
2026-04-03 19:27:25 +02:00

47 lines
872 B
TOML

[package]
name = "shadow-rs-fuzz"
version = "0.0.0"
publish = false
edition = "2021"
[package.metadata]
cargo-fuzz = true
[dependencies]
libfuzzer-sys = "0.4"
shadow-core = { path = "../src/shadow-core", features = ["shadow", "login-defs", "group", "gshadow"] }
tempfile = "3"
[workspace]
members = ["."]
[[bin]]
name = "fuzz_passwd_parse"
path = "fuzz_targets/fuzz_passwd_parse.rs"
doc = false
[[bin]]
name = "fuzz_shadow_parse"
path = "fuzz_targets/fuzz_shadow_parse.rs"
doc = false
[[bin]]
name = "fuzz_login_defs_parse"
path = "fuzz_targets/fuzz_login_defs_parse.rs"
doc = false
[[bin]]
name = "fuzz_validate_username"
path = "fuzz_targets/fuzz_validate_username.rs"
doc = false
[[bin]]
name = "fuzz_group_parse"
path = "fuzz_targets/fuzz_group_parse.rs"
doc = false
[[bin]]
name = "fuzz_gshadow_parse"
path = "fuzz_targets/fuzz_gshadow_parse.rs"
doc = false