Patch: fix seports to allow integers or string (#65134)
Signed-off-by: Joshua Schmidlkofer <joshua@joshuainnovates.us>
This commit is contained in:
parent
4a54873023
commit
570c82f068
1 changed files with 7 additions and 3 deletions
|
@ -156,9 +156,13 @@ def semanage_port_get_type(seport, port, proto):
|
||||||
:rtype: tuple
|
:rtype: tuple
|
||||||
:return: Tuple containing the SELinux type and MLS/MCS level, or None if not found.
|
:return: Tuple containing the SELinux type and MLS/MCS level, or None if not found.
|
||||||
"""
|
"""
|
||||||
ports = port.split('-', 1)
|
if isinstance(port, str):
|
||||||
if len(ports) == 1:
|
ports = port.split('-', 1)
|
||||||
ports.extend(ports)
|
if len(ports) == 1:
|
||||||
|
ports.extend(ports)
|
||||||
|
else:
|
||||||
|
ports = (port, port)
|
||||||
|
|
||||||
key = (int(ports[0]), int(ports[1]), proto)
|
key = (int(ports[0]), int(ports[1]), proto)
|
||||||
|
|
||||||
records = seport.get_all()
|
records = seport.get_all()
|
||||||
|
|
Loading…
Reference in a new issue