mirror of
https://github.com/uutils/shadow.git
synced 2026-06-10 16:14:57 -07:00
3ed6188aea
Fixes #11 — tests/by-util/test_passwd.rs: 15 integration tests following uutils convention (status format, exit codes, lock/unlock cycle, aging, lifecycle, quiet mode, error cases). Fixes #12 — fuzz targets for all parsers: fuzz_passwd_parse, fuzz_shadow_parse, fuzz_login_defs_parse, fuzz_validate_username. All must not panic on any input. Fixes #15 — proptest round-trip tests for PasswdEntry, ShadowEntry: generate random valid entries, serialize, parse back, compare. Fixes #16 — parser edge case tests: wrong field counts, empty files, roundtrip via file I/O, negative values, boundary values, unicode rejection, null bytes, mixed whitespace, duplicate keys, key-only lines. Also: CONTRIBUTING.md, SECURITY.md created. README.md and CLAUDE.md updated to reflect uucore integration and current project state. 142 tests passing on Debian/Alpine/Fedora, zero clippy warnings.
19 lines
554 B
Rust
19 lines
554 B
Rust
// This file is part of the shadow-rs package.
|
|
//
|
|
// For the full copyright and license information, please view the LICENSE
|
|
// file that was distributed with this source code.
|
|
|
|
//! Fuzz target for `/etc/shadow` line parsing.
|
|
//!
|
|
//! Ensures `ShadowEntry::from_str` never panics on arbitrary input.
|
|
|
|
#![no_main]
|
|
use libfuzzer_sys::fuzz_target;
|
|
|
|
fuzz_target!(|data: &[u8]| {
|
|
if let Ok(s) = std::str::from_utf8(data) {
|
|
// Must not panic on any input — errors are fine.
|
|
let _ = s.parse::<shadow_core::shadow::ShadowEntry>();
|
|
}
|
|
});
|