Skip to content

Fix PAM auth using system Python instead of Salt's bundled Python (#69303) - #69323

Merged
dwoz merged 1 commit into
saltstack:3008.xfrom
dwoz:fix/issue-69303
Jun 19, 2026
Merged

dwoz merged 1 commit into
saltstack:3008.xfrom
dwoz:fix/issue-69303

Conversation

@dwoz

@dwoz dwoz commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

salt.auth.pam.__find_pyexe now uses sys.executable on bundled (onedir) installs so PAM auth works against Salt's own Python.

What issues does this PR fix or reference?

Fixes #69303

Previous Behavior

On a 3008 onedir install, __find_pyexe() preferred /usr/bin/python3. The system Python lacks the salt package and python-pam, so the PAM helper subprocess exits 1 and every login returns 401.

New Behavior

When salt.utils.package.bundled() is True, __find_pyexe() returns sys.executable. Source/pip installs still use /usr/bin/python3; auth.pam.python override still wins.

Merge requirements satisfied?

  • Docs
  • Changelog
  • Tests written/updated

Commits signed with GPG?

Yes

@dwoz
dwoz requested a review from a team as a code owner June 6, 2026 05:47
@dwoz dwoz added the test:full Run the full test suite label Jun 6, 2026
@dwoz dwoz added this to the Argon v3008.1 milestone Jun 6, 2026
@dwoz

dwoz commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Is this valid for 3006.x too?

@dwoz

dwoz commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Yes — same root cause. 3006.x and 3007.x hardcode pathlib.Path(__opts__.get("auth.pam.python", "/usr/bin/python3")) (no __find_pyexe(), no sys.executable fallback), so a relenv/onedir install hits the same failure: subprocess runs under the system python without salt/python-pam and exits 1. The patch shape differs there (no __find_pyexe() to reorder — needs to use sys.executable as the default when salt.utils.package.bundled() is True). Happy to open backport PRs against 3006.x and 3007.x if you want them.

salt.auth.pam.__find_pyexe() picked /usr/bin/python3 over sys.executable
whenever the system Python existed. On a relenv/onedir install of Salt
3008 the system Python (typically /usr/bin/python3.10) does not have the
salt package or python-pam installed, so the PAM helper subprocess
exited 1 and every login returned 401 with empty stdout/stderr.

Use salt.utils.package.bundled() to detect onedir/relenv installs and
prefer sys.executable (Salt's bundled interpreter) in that case. The
/usr/bin/python3 branch is preserved for pip/source installs where the
running interpreter may legitimately lack libpam bindings. The
auth.pam.python override still takes priority.

Fixes saltstack#69303
@dwoz
dwoz merged commit e56f4e2 into saltstack:3008.x Jun 19, 2026
477 checks passed
@dwoz
dwoz deleted the fix/issue-69303 branch November 13, 2026 08:29

This branch was previously deployed

1 inactive deployment
ci — 95e6a114 Deployed Jun 17, 2026 by dwoz via Build Onedir Packages / macOS (arm64) #24316
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants