-
Notifications
You must be signed in to change notification settings - Fork 5.6k
salt-call and salt-pip honor configured user #68685
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
Open
dwoz
wants to merge
11
commits into
saltstack:3006.x
Choose a base branch
from
dwoz:salt-call-user
base: 3006.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
The upgrade path was checking /var/run first, which may be tmpfs that gets cleared or recreated during package operations. This caused the scriptlet to detect root:root ownership instead of the actual configured ownership (e.g., salt:salt). Changes: - Check persistent directories first: /var/cache then /etc/salt/pki - Check /var/run last as it may be tmpfs - Change minion default fallback from salt:salt to root:root (matches actual default runtime user for minion) - Keep master/syndic/api default fallback as salt:salt (correct for them) This ensures ownership detection uses stable, persistent directories that won't be affected by tmpfs or package installation side effects.
The previous approach of detecting ownership in %posttrans failed because
RPM had already installed files with root:root (from %defattr) by the time
%posttrans ran.
New approach:
- %pre scriptlet (runs BEFORE files are installed):
* Detects current ownership from persistent directories
* Saves to /tmp/.salt-{package}-upgrade-ownership
- %posttrans scriptlet (runs AFTER files are installed):
* Reads saved ownership from temp file
* Restores ownership to all directories
* Cleans up temp file
Applied to all packages: minion, master, syndic, cloud
This ensures ownership is captured before RPM overwrites directories,
then correctly restored after the new files are in place.
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.
Fixes #68684