1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00

[PR #11486/c05c3133 backport][stable-12] seport: Add support for dccp and sctp protocols (#11509)

seport: Add support for dccp and sctp protocols (#11486)

Support for dccp and sctp protocols were added to SELinux userspace
python libraries in 3.0 version release in November 2019.

(cherry picked from commit c05c31334b)

Co-authored-by: Petr Lautrbach <lautrbach@redhat.com>
This commit is contained in:
patchback[bot] 2026-02-14 21:14:44 +01:00 committed by GitHub
parent baddfa5a80
commit 6437fe15c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 6 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- seport - adds support for DCCP and SCTP protocols (https://github.com/ansible-collections/community.general/pull/11486).

View file

@ -29,9 +29,10 @@ options:
proto: proto:
description: description:
- Protocol for the specified port. - Protocol for the specified port.
- Support for V(dccp) and V(sctp) has been added in community.general 12.4.0.
type: str type: str
required: true required: true
choices: [tcp, udp] choices: [tcp, udp, dccp, sctp]
setype: setype:
description: description:
- SELinux type for the specified port. - SELinux type for the specified port.
@ -145,7 +146,7 @@ def semanage_port_get_ports(seport, setype, proto, local):
:param setype: SELinux type. :param setype: SELinux type.
:type proto: str :type proto: str
:param proto: Protocol ('tcp' or 'udp') :param proto: Protocol ('tcp', 'udp', 'dccp', 'sctp')
:rtype: list :rtype: list
:return: List of ports that have the specified SELinux type. :return: List of ports that have the specified SELinux type.
@ -166,7 +167,7 @@ def semanage_port_get_type(seport, port, proto):
:param port: Port or port range (example: "8080", "8080-9090") :param port: Port or port range (example: "8080", "8080-9090")
:type proto: str :type proto: str
:param proto: Protocol ('tcp' or 'udp') :param proto: Protocol ('tcp', 'udp', 'dccp', 'sctp')
: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.
@ -194,7 +195,7 @@ def semanage_port_add(module, ports, proto, setype, do_reload, serange="s0", ses
:param ports: List of ports and port ranges to add (e.g. ["8080", "8080-9090"]) :param ports: List of ports and port ranges to add (e.g. ["8080", "8080-9090"])
:type proto: str :type proto: str
:param proto: Protocol ('tcp' or 'udp') :param proto: Protocol ('tcp', 'udp', 'dccp', 'sctp')
:type setype: str :type setype: str
:param setype: SELinux type :param setype: SELinux type
@ -245,7 +246,7 @@ def semanage_port_del(module, ports, proto, setype, do_reload, sestore="", local
:param ports: List of ports and port ranges to delete (e.g. ["8080", "8080-9090"]) :param ports: List of ports and port ranges to delete (e.g. ["8080", "8080-9090"])
:type proto: str :type proto: str
:param proto: Protocol ('tcp' or 'udp') :param proto: Protocol ('tcp', 'udp', 'dccp', 'sctp')
:type setype: str :type setype: str
:param setype: SELinux type. :param setype: SELinux type.
@ -281,7 +282,7 @@ def main():
argument_spec=dict( argument_spec=dict(
ignore_selinux_state=dict(type="bool", default=False), ignore_selinux_state=dict(type="bool", default=False),
ports=dict(type="list", elements="str", required=True), ports=dict(type="list", elements="str", required=True),
proto=dict(type="str", required=True, choices=["tcp", "udp"]), proto=dict(type="str", required=True, choices=["tcp", "udp", "dccp", "sctp"]),
setype=dict(type="str", required=True), setype=dict(type="str", required=True),
state=dict(type="str", default="present", choices=["absent", "present"]), state=dict(type="str", default="present", choices=["absent", "present"]),
reload=dict(type="bool", default=True), reload=dict(type="bool", default=True),