[PATCH] Import /etc/login.defs in libuser.conf (#979815)

Vratislav Podzimek vpodzime at redhat.com
Wed Mar 12 06:53:46 UTC 2014


On Tue, 2014-03-11 at 16:53 -0400, David Shea wrote:
> Only import if the file is available, so this mainly affects addons that
> use createLuserConf after shadow-utils is installed.
> ---
>  pyanaconda/users.py | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/pyanaconda/users.py b/pyanaconda/users.py
> index 0988c11..f7f19e8 100644
> --- a/pyanaconda/users.py
> +++ b/pyanaconda/users.py
> @@ -70,6 +70,14 @@ directory = %(instPath)s/etc
>  directory = %(instPath)s/etc
>  """ % {"instPath": instPath, "algo": algoname}
>  
> +    # Import login.defs if installed
> +    if os.path.exists(os.path.normpath(instPath + "/etc/login.defs")):
> +        buf += """
> +[import]
> +login_defs = %(instPath)s/etc/login.defs
> +""" % {"instPath": instPath}
> +
> +
>      fd.write(buf)
>      fd.close()
>      os.environ["LIBUSER_CONF"] = fn
ACK.

-- 
Vratislav Podzimek

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



More information about the anaconda-patches mailing list