[PATCH 1/2] Set GECOS field for new user accounts specific in ks files

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

 



Honor the --gecos argument to the user command in kickstart files.
---
 anaconda.spec.in |    2 +-
 instdata.py      |    3 ++-
 users.py         |    5 ++++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/anaconda.spec.in b/anaconda.spec.in
index 7d1e144..696a68c 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -26,7 +26,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 %define libnlver 1.0
 %define libselinuxver 1.6
 %define mkinitrdver 5.1.2-1
-%define pykickstartver 1.56
+%define pykickstartver 1.58
 %define rpmpythonver 4.2-0.61
 %define slangver 2.0.6-2
 %define yumver 2.9.2
diff --git a/instdata.py b/instdata.py
index 7e44177..488616b 100644
--- a/instdata.py
+++ b/instdata.py
@@ -198,7 +198,8 @@ class InstallData:
                                              uid=ud.uid,
                                              algo=self.getPassAlgo(),
                                              lock=ud.lock,
-                                             root=self.anaconda.rootPath):
+                                             root=self.anaconda.rootPath,
+                                             gecos=ud.gecos):
                     log.error("User %s already exists, not creating." % ud.name)
 
 
diff --git a/users.py b/users.py
index 6534a00..57e68fa 100644
--- a/users.py
+++ b/users.py
@@ -121,7 +121,7 @@ class Users:
 
     def createUser (self, name=None, password=None, isCrypted=False, groups=[],
                     homedir=None, shell=None, uid=None, algo=None, lock=False,
-                    root="/mnt/sysimage"):
+                    root="/mnt/sysimage", gecos=None):
         childpid = os.fork()
 
         if not childpid:
@@ -153,6 +153,9 @@ class Users:
                 if uid >= 0:
                     userEnt.set(libuser.UIDNUMBER, uid)
 
+                if gecos:
+                    userEnt.set(libuser.GECOS, gecos)
+
                 self.admin.addUser(userEnt)
                 self.admin.addGroup(groupEnt)
 
-- 
1.6.3.3

_______________________________________________
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