FC4: system-config-securitylevel dies on unknown service

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



G'day,

Quick note...  the FC4 system-config-security-level dies with the
attached traceback if any services are marked as permitted but do not
exist in /etc/services.  Also attached is a diff that fixes it.

PK

--- traceback ---
Traceback (most recent call last):
  File "/usr/share/system-config-securitylevel/system-config-securitylevel.py", line 18, in ?
    app.stand_alone()
  File "/usr/share/system-config-securitylevel/securitylevel.py", line 453, in stand_alone
    self.readFile()
  File "/usr/share/system-config-securitylevel/securitylevel.py", line 353, in readFile
    protoname = socket.getservbyport(int(service), protocol)
socket.error: port/proto not found
--- end traceback ---


--- /usr/share/system-config-securitylevel/securitylevel.py.old 2005-05-18 12:06:05.000000000 -0600
+++ /usr/share/system-config-securitylevel/securitylevel.py     2005-06-15 14:09:09.000000000 -0600
@@ -350,7 +350,11 @@
                    elif service == '25' or service == 'smtp':
                        service = 'smtp'
                     else:
-                        protoname = socket.getservbyport(int(service), protocol)
+                        try:
+                            protoname = socket.getservbyport(int(service), protocol)
+                        except:
+                            protoname=service
+
                         portsList.append(protoname + ":" + protocol)
                         continue
                     servicesList.append(service)

Attachment: pgpf5FBEoiZi9.pgp
Description: PGP signature


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux