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
37 lines
1.0 KiB
Docker
37 lines
1.0 KiB
Docker
# shadow-rs development image — Fedora 45
|
|
#
|
|
# PAM: pam-devel (Linux-PAM)
|
|
# SELinux: libselinux-devel — SELinux is ENFORCING by default
|
|
# Default shell: /bin/bash
|
|
# Shadow-utils package: shadow-utils
|
|
# Note: Fedora has different PAM stack config and login.defs defaults than Debian.
|
|
# SELinux is enforcing, which affects file context on /etc/passwd, /etc/shadow.
|
|
|
|
FROM fedora:latest
|
|
|
|
RUN dnf install -y \
|
|
gcc \
|
|
pam-devel \
|
|
libselinux-devel \
|
|
audit-libs-devel \
|
|
pkgconf-pkg-config \
|
|
shadow-utils \
|
|
&& dnf clean all
|
|
|
|
# Install Rust via rustup
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
|
|
--default-toolchain stable \
|
|
--component clippy,rustfmt
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
|
|
RUN cargo install cargo-deny \
|
|
&& curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C /root/.cargo/bin
|
|
|
|
RUN useradd -m -s /bin/bash testuser \
|
|
&& useradd -m -s /bin/sh testuser2 \
|
|
&& groupadd testgroup \
|
|
&& usermod -aG testgroup testuser
|
|
|
|
WORKDIR /workspace
|
|
CMD ["/bin/bash"]
|