Files
shadow/Cargo.toml
T
Pierre Warnier 8ee65a7552 phase3: implement groupadd, groupdel, groupmod, grpck, chfn, chsh, newgrp
All 14 shadow-utils tools are now implemented.

groupadd: create groups with auto GID allocation, system groups, force mode.
groupdel: delete groups, checks for primary group usage.
groupmod: modify GID, rename, password changes.
grpck: verify /etc/group and /etc/gshadow integrity.
chfn: change GECOS sub-fields (name, room, phone).
chsh: change login shell with /etc/shells validation.
newgrp: change effective group with crypt(3) password verification.

449 tests, zero clippy warnings, all 14 tools in multicall binary.
2026-03-24 10:47:07 +01:00

158 lines
4.7 KiB
TOML

# spell-checker:ignore uutils
[package]
name = "shadow-rs"
version = "0.0.1"
edition = "2021"
license = "MIT"
description = "Memory-safe Rust reimplementation of Linux shadow-utils"
repository = "https://github.com/shadow-utils-rs/shadow-rs"
readme = "README.md"
keywords = ["coreutils", "shadow", "passwd", "useradd", "linux"]
categories = ["command-line-utilities", "os::unix-apis"]
[workspace]
members = [
"src/shadow-core",
"src/uu/passwd",
"src/uu/pwck",
"src/uu/useradd",
"src/uu/userdel",
"src/uu/usermod",
"src/uu/groupadd",
"src/uu/groupdel",
"src/uu/groupmod",
"src/uu/grpck",
"src/uu/chfn",
"src/uu/chsh",
"src/uu/newgrp",
"src/uu/chpasswd",
"src/uu/chage",
]
[workspace.package]
version = "0.0.1"
edition = "2021"
license = "MIT"
authors = ["shadow-rs contributors"]
repository = "https://github.com/shadow-utils-rs/shadow-rs"
[workspace.dependencies]
# Internal crates
shadow-core = { path = "src/shadow-core" }
# CLI
clap = { version = "4", features = ["derive", "wrap_help"] }
# uutils integration
uucore = "0.7"
# Error handling
thiserror = "2"
# Unix/Linux
nix = { version = "0.29", features = ["user", "fs", "process", "signal", "term", "resource"] }
libc = "0.2"
# Security
zeroize = "1"
# Testing
proptest = "1"
tempfile = "3"
[dependencies]
# Tool crates (optional, enabled by features)
passwd = { optional = true, version = "0.0.1", package = "uu_passwd", path = "src/uu/passwd" }
pwck = { optional = true, version = "0.0.1", package = "uu_pwck", path = "src/uu/pwck" }
useradd = { optional = true, version = "0.0.1", package = "uu_useradd", path = "src/uu/useradd" }
userdel = { optional = true, version = "0.0.1", package = "uu_userdel", path = "src/uu/userdel" }
usermod = { optional = true, version = "0.0.1", package = "uu_usermod", path = "src/uu/usermod" }
chpasswd = { optional = true, version = "0.0.1", package = "uu_chpasswd", path = "src/uu/chpasswd" }
chage = { optional = true, version = "0.0.1", package = "uu_chage", path = "src/uu/chage" }
groupadd = { optional = true, version = "0.0.1", package = "uu_groupadd", path = "src/uu/groupadd" }
groupdel = { optional = true, version = "0.0.1", package = "uu_groupdel", path = "src/uu/groupdel" }
groupmod = { optional = true, version = "0.0.1", package = "uu_groupmod", path = "src/uu/groupmod" }
grpck = { optional = true, version = "0.0.1", package = "uu_grpck", path = "src/uu/grpck" }
chfn = { optional = true, version = "0.0.1", package = "uu_chfn", path = "src/uu/chfn" }
chsh = { optional = true, version = "0.0.1", package = "uu_chsh", path = "src/uu/chsh" }
newgrp = { optional = true, version = "0.0.1", package = "uu_newgrp", path = "src/uu/newgrp" }
[features]
default = ["passwd", "pwck", "useradd", "userdel", "usermod", "chpasswd", "chage",
"groupadd", "groupdel", "groupmod", "grpck", "chfn", "chsh", "newgrp"]
# Individual tools
feat_passwd = ["passwd"]
feat_pwck = ["pwck"]
feat_useradd = ["useradd"]
feat_userdel = ["userdel"]
feat_usermod = ["usermod"]
feat_chpasswd = ["chpasswd"]
feat_chage = ["chage"]
feat_groupadd = ["groupadd"]
feat_groupdel = ["groupdel"]
feat_groupmod = ["groupmod"]
feat_grpck = ["grpck"]
feat_chfn = ["chfn"]
feat_chsh = ["chsh"]
feat_newgrp = ["newgrp"]
# Grouped features
feat_phase1 = ["feat_passwd", "feat_pwck"]
feat_phase2 = ["feat_useradd", "feat_userdel", "feat_usermod", "feat_chpasswd", "feat_chage"]
feat_phase3 = ["feat_groupadd", "feat_groupdel", "feat_groupmod", "feat_grpck", "feat_chfn", "feat_chsh", "feat_newgrp"]
feat_common = ["feat_phase1", "feat_phase2"]
[[bin]]
name = "shadow-rs"
path = "src/bin/shadow-rs.rs"
[[test]]
name = "test_chage"
path = "tests/by-util/test_chage.rs"
[[test]]
name = "test_chpasswd"
path = "tests/by-util/test_chpasswd.rs"
[[test]]
name = "test_passwd"
path = "tests/by-util/test_passwd.rs"
[[test]]
name = "test_chfn"
path = "tests/by-util/test_chfn.rs"
[[test]]
name = "test_chsh"
path = "tests/by-util/test_chsh.rs"
[[test]]
name = "test_newgrp"
path = "tests/by-util/test_newgrp.rs"
[dev-dependencies]
chage = { version = "0.0.1", package = "uu_chage", path = "src/uu/chage" }
chfn = { version = "0.0.1", package = "uu_chfn", path = "src/uu/chfn" }
chpasswd = { version = "0.0.1", package = "uu_chpasswd", path = "src/uu/chpasswd" }
chsh = { version = "0.0.1", package = "uu_chsh", path = "src/uu/chsh" }
newgrp = { version = "0.0.1", package = "uu_newgrp", path = "src/uu/newgrp" }
shadow-core = { path = "src/shadow-core", features = ["shadow"] }
nix = { workspace = true }
tempfile = { workspace = true }
[profile.release]
lto = true
strip = true
[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }
[workspace.lints.clippy]
all = { level = "deny" }
pedantic = { level = "warn" }
[lints]
workspace = true