Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pam: fix pam_unix autohentication failures when ran as user #266828

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

trofi
Copy link
Contributor

@trofi trofi commented Nov 11, 2023

Commit d0c42df "pam: bind Linux-PAM locales from pam-specific folder (upstream patch)" added autoreconfHook269 into one of the postPatch phases.

This clobbered the change applied by suid-wrapper-path.patch as it was patching Makefile.in.

As a result nixosTests.sway test started failing as:

check pass; user unknown

Running swaylock on real system exhibited the same result.

As suid-wrapper-path.patch is clobbered we were running non-suid version of unix_chkpwd:

/nix/store/...-linux-pam-1.5.2/sbin/unix_chkpwd

instead of SUID-wrapped

/run/wrappers/bin/unix_chkpw

The fix is trivial: move the patch from auto-generated file to Makefile.am.

Discovered-by: Yureka

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Commit d0c42df "pam: bind Linux-PAM locales from pam-specific folder
(upstream patch)" added autoreconfHook269 into one of the postPatch
phases.

This clobbered the change applied by `suid-wrapper-path.patch` as it was
patching Makefile.in.

As a result `nixosTests.sway` test started failing as:

    check pass; user unknown

Running `swaylock` on real system exhibited the same result.

As `suid-wrapper-path.patch` is clobbered we were running non-suid
version of `unix_chkpwd`:

    /nix/store/...-linux-pam-1.5.2/sbin/unix_chkpwd

instead of SUID-wrapped

    /run/wrappers/bin/unix_chkpw

The fix is trivial: move the patch from auto-generated file to
`Makefile.am`.

Discovered-by: Yureka
@trofi
Copy link
Contributor Author

trofi commented Nov 11, 2023

Note: this is a rebuild of all of linux:

$ ./maintainers/scripts/rebuild-amount.sh HEAD^
Estimating rebuild amount by counting changed Hydra jobs (parallel=unset).
      1 pkgs-lib-tests
      2 x86_64-darwin
  47413 x86_64-linux

@vcunat vcunat changed the base branch from staging to staging-next November 11, 2023 15:39
@vcunat vcunat merged commit b8b231f into NixOS:staging-next Nov 11, 2023
@trofi trofi deleted the pam-fix-auth-helper-path branch November 11, 2023 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants