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

Fix util users chugid and umask #53681

Merged
merged 3 commits into from
Jul 2, 2019

Conversation

pkwestm
Copy link
Contributor

@pkwestm pkwestm commented Jul 2, 2019

What does this PR do?

When group parameter was added to salt.utils.user previous behaviour of the function chugid_and_umask changed. When parameter runas is provided but group parameter is not the effective group will remain as the executing user of salt. Previously this was changed to the primary group of user in runas parameter. This PR restores the old behaviour so that old code continues to work when group parameter is omitted.

Previous Behavior

Example below use cmd.run to show behaviour. Notice gid in output.

[saltminion2019] root@saltminion2019:~ # salt-call cmd.run id runas=wpa
local:
    uid=24774(wpa) gid=0(root) groups=0(root),10513(domain_users)
[saltminion2019] root@saltminion2019:~ #

New Behavior

[saltminion2019] root@saltminion2019:~ # salt-call cmd.run id runas=wpa
local:
    uid=24774(wpa) gid=10513(domain_users) groups=10513(domain_users)
[saltminion2019] root@saltminion2019:~ #

Tests written?

Yes, could not find any existing test for user.py. New file created unit/utils/test_user.py. Please let me know if tests should be implemented elsewhere.

Commits signed with GPG?

Yes

@mattp-
Copy link
Contributor

mattp- commented Jul 2, 2019

👍

Copy link
Contributor

@Akm0d Akm0d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks good. The location of the test case seems to be appropriate 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants