summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2008-12-11 15:40:54 -0500
committerChris Lumens <clumens@redhat.com>2008-12-11 15:40:54 -0500
commite1c31e881c8dd6e33de43758b143eccf8300fb1c (patch)
tree971784c970364a16c0647f4b9ba561b7329ce5a9
parent5719316ade2ca92a8b8098cc2c0b300988c5e37f (diff)
downloadanaconda-e1c31e881c8dd6e33de43758b143eccf8300fb1c.tar.gz
anaconda-e1c31e881c8dd6e33de43758b143eccf8300fb1c.tar.xz
anaconda-e1c31e881c8dd6e33de43758b143eccf8300fb1c.zip
Make sure ssh doesn't get duplicated in the open port list (#474937).
Since ssh is always opened by anaconda, it can be listed twice if the kickstart file lists ssh as an allowed port. Make sure to only add ssh to the open port list if it's not already specified by the kickstart file.
-rw-r--r--firewall.py7
-rw-r--r--kickstart.py3
2 files changed, 8 insertions, 2 deletions
diff --git a/firewall.py b/firewall.py
index f3e689d95..ef543e6dd 100644
--- a/firewall.py
+++ b/firewall.py
@@ -35,7 +35,7 @@ class Firewall:
self.enabled = 1
self.trustdevs = []
self.portlist = []
- self.servicelist = ["ssh"]
+ self.servicelist = []
def writeKS(self, f):
f.write("firewall")
@@ -54,7 +54,10 @@ class Firewall:
if not self.enabled:
args.append("--disabled")
return args
-
+
+ if not "ssh" in self.servicelist and not "22:tcp" in self.portlist:
+ args += ["--service=ssh"]
+
for dev in self.trustdevs:
args = args + [ "--trust=%s" %(dev,) ]
diff --git a/kickstart.py b/kickstart.py
index 4d70d5195..961da30e6 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -247,6 +247,9 @@ class Firewall(commands.firewall.F10_Firewall):
for port in self.ports:
self.handler.id.firewall.portlist.append (port)
+ for svc in self.services:
+ self.handler.id.firewall.servicelist.append (svc)
+
class Firstboot(commands.firstboot.FC3_Firstboot):
def parse(self, args):
commands.firstboot.FC3_Firstboot.parse(self, args)