Lines Matching refs:pwd
45 struct passwd pwd; local
67 pwd.pw_name = s;
68 pwd.pw_passwd = "x";
69 pwd.pw_gecos = TT.gecos ? TT.gecos : "Linux User,";
70 pwd.pw_dir = TT.dir ? TT.dir : xmprintf("/home/%s", *toys.optargs);
82 pwd.pw_shell = TT.shell;
93 pwd.pw_uid = TT.uid;
100 if (getgrnam(pwd.pw_name)) error_exit("group '%s' in use", pwd.pw_name);
104 pwd.pw_gid = TT.gid;
108 char *s = xmprintf("-g%ld", pwd.pw_gid);
111 error_msg("addgroup -g%ld fail", pwd.pw_gid);
122 entry = xmprintf("%s:%s:%ld:%ld:%s:%s:%s", pwd.pw_name, pwd.pw_passwd,
123 pwd.pw_uid, pwd.pw_gid, pwd.pw_gecos, pwd.pw_dir, pwd.pw_shell);
124 if (update_password("/etc/passwd", pwd.pw_name, entry)) error_exit("updating passwd file failed");
128 entry = xmprintf("%s:!!:%u::::::", pwd.pw_name,
130 else entry = xmprintf("%s:!!:%u:%ld:%ld:%ld:::", pwd.pw_name,
132 update_password("/etc/shadow", pwd.pw_name, entry);
137 char *skel = "/etc/skel", *p = pwd.pw_dir;
153 if (xrun((char *[]){"passwd", pwd.pw_name, 0})) error_exit("passwd");