Skip to contentSkip to conversation

semanage: swap tcp and udp protocol numbers

PATCH Applied Miroslav Vadkerti 3 participants 5 messages Aug 10, 2016 – Aug 15, 2016 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 semanage: swap tcp and udp protocol numbers

The tcp/udp protocol numbers were accidentaly swapped in the original patch 'semanage: add auditing of changes in records'.

---
 policycoreutils/semanage/seobject.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
policycoreutils/semanage/seobject.py +2 -2
index 317b421..786ed0e 100644
@@ -88,8 +88,8 @@ file_type_str_to_option = {"all files": "a",
                            "symbolic link": "l",
                            "named pipe": "p"}
 
-proto_to_audit = {"tcp": 17,
-                  "udp": 6,
+proto_to_audit = {"tcp": 6,
+                  "udp": 17,
                   "ipv4": 4,
                   "ipv6": 41}
 
Signature · 1 line
1.8.3.1
Applied
#1 lore raw
Quoted 4 lines · Miroslav Vadkerti

The tcp/udp protocol numbers were accidentaly swapped in the original patch 'semanage: add auditing of changes in records'.

Applied.

Thanks,
Jim

Quoted 20 lines
---
 policycoreutils/semanage/seobject.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
policycoreutils/semanage/seobject.py +2 -2
index 317b421..786ed0e 100644
@@ -88,8 +88,8 @@ file_type_str_to_option = {"all files": "a",
                            "symbolic link": "l",
                            "named pipe": "p"}
 
-proto_to_audit = {"tcp": 17,
-                  "udp": 6,
+proto_to_audit = {"tcp": 6,
+                  "udp": 17,
                   "ipv4": 4,
                   "ipv6": 41}
 
Signature · 2 lines
James Carter <[email protected]>
National Security Agency
#2 lore raw
In reply to Miroslav Vadkerti
Quoted 13 lines · Miroslav Vadkerti

The tcp/udp protocol numbers were accidentaly swapped in the original patch 'semanage: add auditing of changes in records'.

---
 policycoreutils/semanage/seobject.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
policycoreutils/semanage/seobject.py +0 -0
index 317b421..786ed0e 100644

policycoreutils/semanage/seobject.py file_type_str_to_option = {"all files": "a", · line 94

Quoted 9 lines
policycoreutils/semanage/seobject.py +2 -2
@@ -88,8 +88,8 @@ file_type_str_to_option = {"all files": "a",
                            "symbolic link": "l",
                            "named pipe": "p"}
 
-proto_to_audit = {"tcp": 17,
-                  "udp": 6,
+proto_to_audit = {"tcp": 6,
+                  "udp": 17,
                   "ipv4": 4,
                   "ipv6": 41}

I realize this has already been merged, but why not use existing constants such as socket.IPPROTO_TCP and socket.AF_INET rather than hard coding the protocol numbers?

Signature · 1 line
Chris PeBenito
#3 lore raw
Quoted 19 lines · Chris PeBenito
Quoted 17 lines · Miroslav Vadkerti

The tcp/udp protocol numbers were accidentaly swapped in the original patch 'semanage: add auditing of changes in records'.

---
 policycoreutils/semanage/seobject.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
policycoreutils/semanage/seobject.py +0 -0
index 317b421..786ed0e 100644
@@ -88,8 +88,8 @@ file_type_str_to_option = {"all files": "a",
                            "symbolic link": "l",
                            "named pipe": "p"}
 
Quoted 11 lines

policycoreutils/semanage/seobject.py file_type_str_to_option = {"all files": "a", · line 95

Quoted 7 lines
policycoreutils/semanage/seobject.py +2 -2
-proto_to_audit = {"tcp": 17,
-                  "udp": 6,
+proto_to_audit = {"tcp": 6,
+                  "udp": 17,
                   "ipv4": 4,
                   "ipv6": 41}
 

I realize this has already been merged, but why not use existing constants such as socket.IPPROTO_TCP and socket.AF_INET rather than hard coding the protocol numbers?

​Yes, ot we could directly use socket.getprotobyname(protocolname) instead of the dictionary. I will supply a patch today, thanks!​

Quoted 5 lines

--
Chris PeBenito

Signature · 4 lines
Miroslav Vadkerti :: Senior QE / RHCSS :: BaseOS QE Security
IRC mvadkert #qe #urt #brno #rpmdiff :: GPG 0x25881087
Desk Phone +420 532 294 129 :: Mobile +420 773 944 252
Red Hat Czech s.r.o, Purkyňova 99/71, 612 00, Brno, CR
#4 lore raw
Quoted 35 lines · Miroslav Vadkerti
Quoted 19 lines · Chris PeBenito
Quoted 17 lines · Miroslav Vadkerti

The tcp/udp protocol numbers were accidentaly swapped in the original patch 'semanage: add auditing of changes in records'.

---
 policycoreutils/semanage/seobject.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
policycoreutils/semanage/seobject.py +0 -0
index 317b421..786ed0e 100644
@@ -88,8 +88,8 @@ file_type_str_to_option = {"all files": "a",
                            "symbolic link": "l",
                            "named pipe": "p"}
 
Quoted 11 lines

policycoreutils/semanage/seobject.py file_type_str_to_option = {"all files": "a", · line 95

Quoted 7 lines
policycoreutils/semanage/seobject.py +2 -2
-proto_to_audit = {"tcp": 17,
-                  "udp": 6,
+proto_to_audit = {"tcp": 6,
+                  "udp": 17,
                   "ipv4": 4,
                   "ipv6": 41}
 

I realize this has already been merged, but why not use existing constants such as socket.IPPROTO_TCP and socket.AF_INET rather than hard coding the protocol numbers?

Quoted 3 lines

​Yes, ot we could directly use socket.getprotobyname(protocolname) instead of the dictionary. I will supply a patch today, thanks!​

​The patch using socket.getprotobyname(protocolname) has been submmited, but it is based on top of this patch, so if possible please this one also so there is no conflict.

Thanks!
/M

Quoted 18 lines
Quoted 8 lines

--
Chris PeBenito

--
Miroslav Vadkerti :: Senior QE / RHCSS :: BaseOS QE Security IRC mvadkert #qe #urt #brno #rpmdiff :: GPG 0x25881087 Desk Phone +420 532 294 129 :: Mobile +420 773 944 252 Red Hat Czech s.r.o, Purkyňova 99/71, 612 00, Brno, CR

Signature · 4 lines
Miroslav Vadkerti :: Senior QE / RHCSS :: BaseOS QE Security
IRC mvadkert #qe #urt #brno #rpmdiff :: GPG 0x25881087
Desk Phone +420 532 294 129 :: Mobile +420 773 944 252
Red Hat Czech s.r.o, Purkyňova 99/71, 612 00, Brno, CR