p1 = subprocess.Popen(["/bin/echo", "%s:%s" %(user, password)],
stdout = subprocess.PIPE,
preexec_fn = self.chroot)
- p2 = subprocess.Popen(["/usr/sbin/chpasswd", "-m"],
+ p2 = subprocess.Popen(["/usr/sbin/chpasswd", "-c","SHA512"],
stdin = p1.stdout,
stdout = subprocess.PIPE,
preexec_fn = self.chroot)
@apply_wrapper
def apply(self, user):
for userconfig in user.userList:
+ #There exist root user already.
+ if userconfig.name == "root":
+ msger.debug("root user, just set root user groups attribution")
+ if userconfig.groups:
+ self.call(["/usr/sbin/usermod", "-a", "-G", "%s" % string.join(userconfig.groups, ","), "root"])
+ continue
self.addUser(userconfig)
class ServicesConfig(KickstartConfig):