archive.extracted: Don't run lsattr when enforcing user/group ownership

This changes file.check_perms such that it doesn't run lsattr if no
attrs are passed in.
This commit is contained in:
Erik Johnson 2019-01-03 10:19:56 -06:00
parent 04fdae5bbd
commit 787b79a1b2
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -4478,7 +4478,9 @@ def check_perms(name, ret, user, group, mode, attrs=None, follow_symlinks=False)
is_dir = os.path.isdir(name)
is_link = os.path.islink(name)
if not salt.utils.platform.is_windows() and not is_dir and not is_link:
if attrs is not None \
and not salt.utils.platform.is_windows() \
and not is_dir and not is_link:
try:
lattrs = lsattr(name)
except SaltInvocationError: