FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Directory

 
 
LinkBack Thread Tools
 
Old 03-08-2011, 05:17 PM
Chris Lumens
 
Default Allow blocking the ssh port through kickstart (#485086).

---
installclass.py | 7 +++++--
kickstart.py | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/installclass.py b/installclass.py
index 9a34363..36665cf 100644
--- a/installclass.py
+++ b/installclass.py
@@ -305,13 +305,16 @@ class BaseInstallClass:
def setSELinux(self, id, sel):
id.security.setSELinux(sel)

- def setFirewall(self, id, enable = 1, trusts = [], ports = []):
+ def setFirewall(self, id, enable = 1, trusts = [], ports = [], disableSsh = False):
id.firewall.enabled = enable
id.firewall.trustdevs = trusts

for port in ports:
id.firewall.portlist.append (port)
-
+
+ if disableSsh:
+ id.firewall.portlist.remove("22:tcp")
+
def setMiscXSettings(self, id, depth = None, resolution = None,
desktop = None, runlevel = None):

diff --git a/kickstart.py b/kickstart.py
index 46c6c1f..5f40e61 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -197,7 +197,7 @@ class AnacondaKSHandlers(KickstartHandlers):
KickstartHandlers.doFirewall(self, args)
dict = self.ksdata.firewall
self.id.instClass.setFirewall(self.id, dict["enabled"], dict["trusts"],
- dict["ports"])
+ dict["ports"], disableSsh=dict["disableSsh"])

def doFirstboot(self, args):
KickstartHandlers.doFirstboot(self, args)
--
1.7.4.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 08:09 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org