Lines Matching refs:pwd
45 struct passwd pwd; local
64 pwd.pw_name = s;
65 pwd.pw_passwd = "x";
66 pwd.pw_gecos = TT.gecos ? TT.gecos : "Linux User,";
67 pwd.pw_dir = TT.dir ? TT.dir : xmprintf("/home/%s", *toys.optargs);
79 pwd.pw_shell = TT.shell;
90 pwd.pw_uid = TT.uid;
97 if (getgrnam(pwd.pw_name)) error_exit("group '%s' in use", pwd.pw_name);
101 pwd.pw_gid = TT.gid;
105 char *s = xmprintf("-g%ld", (long)pwd.pw_gid);
108 error_msg("addgroup -g%ld fail", (long)pwd.pw_gid);
119 entry = xmprintf("%s:%s:%ld:%ld:%s:%s:%s", pwd.pw_name, pwd.pw_passwd,
120 (long)pwd.pw_uid, (long)pwd.pw_gid, pwd.pw_gecos, pwd.pw_dir,
121 pwd.pw_shell);
122 if (update_password("/etc/passwd", pwd.pw_name, entry)) error_exit("updating passwd file failed");
126 entry = xmprintf("%s:!!:%u::::::", pwd.pw_name,
128 else entry = xmprintf("%s:!!:%u:0:99999:7:::", pwd.pw_name,
130 update_password("/etc/shadow", pwd.pw_name, entry);
135 char *skel = "/etc/skel", *p = pwd.pw_dir;
151 if (xrun((char *[]){"passwd", pwd.pw_name, 0})) error_exit("passwd");