Lines Matching refs:pwd
139 struct passwd *pwd = NULL; in main() local
246 pwd = getpwnam(username); in main()
247 if (pwd == NULL || pwd->pw_uid != ruid) in main()
248 pwd = getpwuid(ruid); in main()
249 if (pwd == NULL) { in main()
258 username = strdup(pwd->pw_name); in main()
263 if (pwd->pw_shell != NULL && *pwd->pw_shell != '\0') { in main()
265 strlcpy(shellbuf, pwd->pw_shell, in main()
310 pwd = getpwnam(user); in main()
311 if (pwd == NULL) { in main()
351 lc = login_getpwclass(pwd); in main()
370 if (ruid != 0 && !chshell(pwd->pw_shell)) in main()
373 else if (pwd->pw_shell && *pwd->pw_shell) { in main()
374 shell = pwd->pw_shell; in main()
397 if (setusercontext(lc, pwd, pwd->pw_uid, LOGIN_SETGROUP) < 0) in main()
491 if ((asme || (!asthem && class == NULL)) && pwd->pw_uid) in main()
493 if (setusercontext(lc, pwd, pwd->pw_uid, setwhat) < 0) in main()
502 if (asthem || pwd->pw_uid) in main()
503 setenv("USER", pwd->pw_name, 1); in main()
504 setenv("HOME", pwd->pw_dir, 1); in main()
517 setusercontext(lc, pwd, pwd->pw_uid, in main()
524 if (chdir(p ? p : pwd->pw_dir) < 0) in main()