[rhel7/master] Fix noselinux cmdline default (#1137049)

Vratislav Podzimek vpodzime at redhat.com
Thu Sep 4 08:06:21 UTC 2014


On Wed, 2014-09-03 at 17:16 -0700, Brian C. Lane wrote:
> Commit fc8f719114 change the cmdline noselinux behavior but didn't set
> the default to the new -1 value so it would always enable selinux, even
> if the kickstart used selinux --disabled and no cmdline option was
> passed.
> 
> This fixes things so that they work as expected. kickstart selinux
> commands work, cmdline overrides only if it has been passed.
> 
> Resolves: rhbz#1137049
> ---
>  anaconda | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/anaconda b/anaconda
> index ffce0f0..d451ad3 100755
> --- a/anaconda
> +++ b/anaconda
> @@ -277,8 +277,9 @@ def parseOptions(argv=None, cmdline=None):
>      op.add_option("--loglevel")
>      op.add_option("--syslog")
>  
> -    op.add_option("--noselinux", dest="selinux", action="store_false", default=True)
> -    op.add_option("--selinux", action="store_true")
> +    from pykickstart.constants import SELINUX_DISABLED, SELINUX_ENFORCING
> +    op.add_option("--noselinux", dest="selinux", action="store_const", const=SELINUX_DISABLED, default=constants.SELINUX_DEFAULT)
> +    op.add_option("--selinux", action="store_const", const=SELINUX_ENFORCING)
>  
>      op.add_option("--nompath", dest="mpath", action="store_false", default=True)
>      op.add_option("--mpath", action="store_true")
ACK.

-- 
Vratislav Podzimek

Anaconda Rider | RHCE | Red Hat, Inc. | Brno - Czech Republic




More information about the anaconda-patches mailing list