Repository navigation
Fix PAM auth using system Python instead of Salt's bundled Python (#69303) - #69323
Merged
Merged
Conversation
Contributor
Author
|
Is this valid for 3006.x too? |
Contributor
Author
|
Yes — same root cause. 3006.x and 3007.x hardcode |
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
twangboy
approved these changes
Jun 19, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
salt.auth.pam.__find_pyexenow usessys.executableon 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()returnssys.executable. Source/pip installs still use/usr/bin/python3;auth.pam.pythonoverride still wins.Merge requirements satisfied?
Commits signed with GPG?
Yes