Skip to content

Commit

Permalink
Merge pull request saltstack#50088 from vulnbe/fix-incorrect-id-handl…
Browse files Browse the repository at this point in the history
…ing-2018-3-3

Fix incorrect user/group id handling in file state
  • Loading branch information
dwoz authored Oct 17, 2018
2 parents 84e2dcf + 619f2f2 commit 4d9e2a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions salt/states/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -3188,7 +3188,7 @@ def directory(name,
# NOTE: Should this be enough to stop the whole check altogether?
if recurse_set:
if 'user' in recurse_set:
if user:
if user or isinstance(user, int):
uid = __salt__['file.user_to_uid'](user)
# file.user_to_uid returns '' if user does not exist. Above
# check for user is not fatal, so we need to be sure user
Expand All @@ -3206,7 +3206,7 @@ def directory(name,
else:
user = None
if 'group' in recurse_set:
if group:
if group or isinstance(group, int):
gid = __salt__['file.group_to_gid'](group)
# As above with user, we need to make sure group exists.
if isinstance(gid, six.string_types):
Expand Down

0 comments on commit 4d9e2a0

Please sign in to comment.