mirror of
https://github.com/uutils/shadow.git
synced 2026-06-10 16:14:57 -07:00
97130fea20
Cargo workspace with three-layer architecture mirroring uutils conventions: - shadow-core: /etc/passwd and /etc/shadow parsers, atomic file writes, username validation, error types, feature-gated module stubs (PAM, SELinux, group, gshadow, login.defs, subid, nscd, lock, uid_alloc) - uu_passwd: tool skeleton with clap CLI, uumain/uu_app pattern - multicall binary: argv[0] dispatch with --list support Docker test matrix (Debian Trixie, Alpine musl, Fedora SELinux): all three pass clippy -D warnings, 21 tests, and cargo fmt --check. 21 unit tests covering: - passwd/shadow file parsing and roundtrip serialization - atomic file write with fsync + rename + failure rollback - username validation rules (length, charset, edge cases) - clap command definition
32 lines
877 B
Docker
32 lines
877 B
Docker
# shadow-rs development image — Alpine 3.23 (musl libc)
|
|
#
|
|
# PAM: linux-pam-dev (Linux-PAM, not OpenPAM)
|
|
# SELinux: not available (Alpine doesn't ship SELinux)
|
|
# Default shell: /bin/ash (busybox)
|
|
# Shadow-utils package: shadow
|
|
# Note: musl libc — different from glibc. Tests NSS/getpwent differences.
|
|
# No SELinux. Busybox shadow-utils may differ from GNU shadow-utils.
|
|
|
|
FROM rust:alpine
|
|
|
|
RUN apk add --no-cache \
|
|
musl-dev \
|
|
linux-pam-dev \
|
|
linux-headers \
|
|
pkgconf \
|
|
shadow \
|
|
bash \
|
|
curl
|
|
|
|
RUN rustup component add clippy rustfmt \
|
|
&& cargo install cargo-deny \
|
|
&& curl -LsSf https://get.nexte.st/latest/linux-musl | tar zxf - -C /usr/local/cargo/bin
|
|
|
|
RUN adduser -D -s /bin/bash testuser \
|
|
&& adduser -D -s /bin/sh testuser2 \
|
|
&& addgroup testgroup \
|
|
&& addgroup testuser testgroup
|
|
|
|
WORKDIR /workspace
|
|
CMD ["/bin/bash"]
|