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 incorrect user/group id handling in file state #50088

Merged
merged 1 commit into from Oct 17, 2018

Conversation

Projects
None yet
2 participants
@vulnbe
Copy link
Contributor

commented Oct 16, 2018

What does this PR do?

It fixes error in salt.states.file.

What issues does this PR fix or reference?

Issues messages are:

user not specified, but configured as a target for recursive ownership
group not specified, but configured as a target for recursive ownership

Issue occurs when user or group is set to 0 and 'recurse' is used:

/var/log/test/:
  file.directory:
    - user:  0
    - group: 0
    - recurse:
      - user
      - group

Tests written?

No

Commits signed with GPG?

Yes

@dwoz

This comment has been minimized.

Copy link
Contributor

commented Oct 17, 2018

@vulnbe Does the state work when user is set to a string instead of int?

/var/log/test/:
  file.directory:
    - user:  '0'
    - group: '0'
    - recurse:
      - user
      - group
@vulnbe

This comment has been minimized.

Copy link
Contributor Author

commented Oct 17, 2018

@dwoz It doesn't work.

@dwoz

dwoz approved these changes Oct 17, 2018

Copy link
Contributor

left a comment

I see, user/group can be an id.. file.user_to_uid just returns the int un-altered. I think the accepting both strings and integers here is a bit odd but that has nothing to do with your patch. Otherwise LGMT.

@dwoz dwoz merged commit 4d9e2a0 into saltstack:2018.3.3 Oct 17, 2018

8 checks passed

WIP ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint The lint job has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
@dwoz

This comment has been minimized.

Copy link
Contributor

commented Oct 17, 2018

@vulnbe We noticed this PR was against 2018.3.3.. That release has already been 'frozen', although I merged this to the 2018.3.3, the changes won't be included in that release. We'll make sure they are in the next one though.

@vulnbe

This comment has been minimized.

Copy link
Contributor Author

commented Oct 18, 2018

@dwoz Ok. Do I need to backport patch to other releases?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.