mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix selinux.fcontext_policy_present for Centos 6
'a' is not a valid filetype for semanage on Centos 6. Since "a" (all files) is the default behavior of semanage, don't specify a `--ftype` when invoking semanage. Closes #45825
This commit is contained in:
parent
d20ff89414
commit
1916e5c4a4
1 changed files with 3 additions and 1 deletions
|
@ -514,7 +514,9 @@ def fcontext_add_or_delete_policy(action, name, filetype=None, sel_type=None, se
|
|||
if action not in ['add', 'delete']:
|
||||
raise SaltInvocationError('Actions supported are "add" and "delete", not "{0}".'.format(action))
|
||||
cmd = 'semanage fcontext --{0}'.format(action)
|
||||
if filetype is not None:
|
||||
# "semanage --ftype a" isn't valid on Centos 6,
|
||||
# don't pass --ftype since "a" is the default filetype.
|
||||
if filetype is not None and filetype != 'a':
|
||||
_validate_filetype(filetype)
|
||||
cmd += ' --ftype {0}'.format(filetype)
|
||||
if sel_type is not None:
|
||||
|
|
Loading…
Add table
Reference in a new issue