mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Mark selinux._filetype_id_to_string as public function
_filetype_id_to_string is a private function in the selinux module. The selinux state module calls the function as filetype_id_to_string which fails of course. Rename the function from the private one to a public one to make the state call work. Resolves #42505.
This commit is contained in:
parent
e9ccaa61d2
commit
efc1c8c506
1 changed files with 2 additions and 2 deletions
|
@ -403,7 +403,7 @@ def _context_string_to_dict(context):
|
|||
return ret
|
||||
|
||||
|
||||
def _filetype_id_to_string(filetype='a'):
|
||||
def filetype_id_to_string(filetype='a'):
|
||||
'''
|
||||
Translates SELinux filetype single-letter representation
|
||||
to a more human-readable version (which is also used in `semanage fcontext -l`).
|
||||
|
@ -444,7 +444,7 @@ def fcontext_get_policy(name, filetype=None, sel_type=None, sel_user=None, sel_l
|
|||
'sel_role': '[^:]+', # se_role for file context is always object_r
|
||||
'sel_type': sel_type or '[^:]+',
|
||||
'sel_level': sel_level or '[^:]+'}
|
||||
cmd_kwargs['filetype'] = '[[:alpha:] ]+' if filetype is None else _filetype_id_to_string(filetype)
|
||||
cmd_kwargs['filetype'] = '[[:alpha:] ]+' if filetype is None else filetype_id_to_string(filetype)
|
||||
cmd = 'semanage fcontext -l | egrep ' + \
|
||||
"'^{filespec}{spacer}{filetype}{spacer}{sel_user}:{sel_role}:{sel_type}:{sel_level}$'".format(**cmd_kwargs)
|
||||
current_entry_text = __salt__['cmd.shell'](cmd)
|
||||
|
|
Loading…
Add table
Reference in a new issue