Re: [PATCH rhel5-branch] Allow blocking the ssh port through kickstart (#485086).

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

 



Ack.

Chris Lumens <clumens@xxxxxxxxxx> wrote:

> ---
>  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@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

-- 
David Cantrell <dcantrell@xxxxxxxxxx>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Honolulu, HI | UTC-10

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


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux