Skip to content

Fix PAM-first audit log ownership - #9

Merged
dmytrogajewski merged 1 commit into
masterfrom
fix/pam-audit-ownership
Nov 7, 2026
Merged

dmytrogajewski merged 1 commit into
masterfrom
fix/pam-audit-ownership

Conversation

@dmytrogajewski

Copy link
Copy Markdown
Collaborator

When sudo invokes PAM before the user daemon starts, PAM creates last.log as root and the daemon cannot append transaction records. Create new audit files with mode 0600 and assign their file descriptor the bond-store directory's owner/group before writing. Preserve existing files and reject final-component symlinks.

Regression coverage checks private creation, symlink rejection, ownership under root-run PAM, and preservation of previous records. CI explicitly runs the privileged ownership test against a disposable tempdir; no live PAM stack is touched.

Validation: make lint; make test (461 passed, 11 ignored); privileged ownership regression passed in an isolated rootless container. The original failure was reproduced in the NixOS KVM review of #7; the combined Nix changes will receive the full VM rerun after this fix merges.

Existing root-owned audit files retain their ownership; documented administrator recovery preserves their contents.

@dmytrogajewski
dmytrogajewski merged commit e31dc04 into master Nov 7, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants