mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Teach file.check_perms to handle uids and gids.
Fixes #21423. Allow passing in numeric values for user and group.
This commit is contained in:
parent
74b9ec2be0
commit
b28dba2ecd
@ -2714,9 +2714,13 @@ def check_perms(name, ret, user, group, mode, follow_symlinks=False):
|
||||
ret['changes']['mode'] = mode
|
||||
# user/group changes if needed, then check if it worked
|
||||
if user:
|
||||
if isinstance(user, int):
|
||||
user = uid_to_user(user)
|
||||
if user != perms['luser']:
|
||||
perms['cuser'] = user
|
||||
if group:
|
||||
if isinstance(group, int):
|
||||
group = gid_to_group(group)
|
||||
if group != perms['lgroup']:
|
||||
perms['cgroup'] = group
|
||||
if 'cuser' in perms or 'cgroup' in perms:
|
||||
|
Loading…
Reference in New Issue
Block a user