Skip to content

Fix util users chugid and umask - #53681

Merged
Akm0d merged 3 commits into
saltstack:2019.2from
pkwestm:fix-util-users-chugid_and_umask
Jul 2, 2019
Merged

Akm0d merged 3 commits into
saltstack:2019.2from
pkwestm:fix-util-users-chugid_and_umask

Conversation

@pkwestm

@pkwestm pkwestm commented Jul 2, 2019

Copy link
Copy Markdown
Contributor

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-

mattp- commented Jul 2, 2019

Copy link
Copy Markdown
Contributor

👍

@Akm0d Akm0d left a comment

Copy link
Copy Markdown
Contributor

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