Files
shadow/Makefile
T
Pierre Warnier 8ba8f940fd prod: GNU compat tests, PAM e2e, setuid, SELinux, audit, packaging
Fixes #93 — GNU compatibility test suite (tests/gnu-compat.sh)
Fixes #94 — PAM end-to-end test script (tests/pam-e2e.sh)
Fixes #95 — Setuid permissions in Makefile (chmod 4755)
Fixes #96 — nscd env_clear() on subprocess spawning
Fixes #97 — SELinux file context support (getfattr/chcon/restorecon)
Fixes #98 — Audit logging to syslog/auditd
Fixes #99 — subuid/subgid allocation in useradd
Fixes #100 — Debian packaging (debian/control, debian/rules)
Fixes #101 — Fedora packaging (shadow-rs.spec)
Fixes #103 — Recursive chown on usermod UID change
Fixes #104 — Proper date validation (Feb 31 rejected)

456 tests, zero clippy warnings. Binary: 894KB (release-small).
2026-03-24 15:15:21 +01:00

38 lines
926 B
Makefile

PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/sbin
PROFILE ?= release
TOOLS = passwd pwck useradd userdel usermod chpasswd chage \
groupadd groupdel groupmod grpck chfn chsh newgrp
.PHONY: all build test install uninstall clean
all: build
build:
cargo build --profile $(PROFILE)
test:
cargo test --workspace
install: build
install -Dm755 target/$(PROFILE)/shadow-rs $(DESTDIR)$(BINDIR)/shadow-rs
@for tool in $(TOOLS); do \
ln -sf shadow-rs $(DESTDIR)$(BINDIR)/$$tool; \
done
@# Setuid-root for tools that need it
@for tool in passwd chfn chsh newgrp; do \
chmod 4755 $(DESTDIR)$(BINDIR)/$$tool 2>/dev/null || true; \
done
@echo "Installed shadow-rs + $(words $(TOOLS)) symlinks to $(DESTDIR)$(BINDIR)/"
uninstall:
@for tool in $(TOOLS); do \
rm -f $(DESTDIR)$(BINDIR)/$$tool; \
done
rm -f $(DESTDIR)$(BINDIR)/shadow-rs
@echo "Uninstalled shadow-rs from $(DESTDIR)$(BINDIR)/"
clean:
cargo clean