[PATCH] setupEnvironment() check that PATH exists before appending otherwise create PATH

Chris Lumens clumens at redhat.com
Thu Aug 28 20:05:00 UTC 2014


> diff --git a/anaconda b/anaconda
> index 7fb9370..8a275fb 100755
> --- a/anaconda
> +++ b/anaconda
> @@ -542,7 +542,10 @@ def setupEnvironment():
>      os.environ["LVM_SUPPRESS_FD_WARNINGS"] = "1"
>  
>      # make sure we have /sbin and /usr/sbin in our path
> -    os.environ["PATH"] += ":/sbin:/usr/sbin"
> +    if os.environ["PATH"]:
> +        os.environ["PATH"] += ":/sbin:/usr/sbin"
> +    else:
> +        os.environ["PATH"] = "/sbin:/usr/sbin"
>  
>      # we can't let the LD_PRELOAD hang around because it will leak into
>      # rpm %post and the like.  ick :/

Why wouldn't you have $PATH?

- Chris


More information about the anaconda-patches mailing list