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

David Shea dshea at redhat.com
Tue Mar 11 20:53:09 UTC 2014


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
-- 
1.8.5.3



More information about the anaconda-patches mailing list