Lines Matching defs:pw
173 * in: pw - struct containing data from our user's line in
422 struct passwd *pw;
433 pw = getpwuid(uid);
435 if (!(pw && pw->pw_name && pw->pw_name[0] && pw->pw_shell
436 && pw->pw_shell[0] && pw->pw_dir && pw->pw_dir[0])) {
442 *pw_copy = *pw;
443 pw = pw_copy;
444 pw->pw_name = strdup(pw->pw_name);
445 pw->pw_dir = strdup(pw->pw_dir);
446 pw->pw_shell = strdup(pw->pw_shell);
448 if (!(pw->pw_name && pw->pw_dir && pw->pw_shell)) {
453 if (verify_shell(pw->pw_shell) == 0) {
460 free(pw->pw_name);
461 free(pw->pw_dir);
462 free(pw->pw_shell);
477 char **old_environ, const struct passwd *pw)
522 rc |= setenv("HOME", pw->pw_dir, 1);
523 rc |= setenv("SHELL", pw->pw_shell, 1);
524 rc |= setenv("USER", pw->pw_name, 1);
525 rc |= setenv("LOGNAME", pw->pw_name, 1);
1003 struct passwd pw; /* struct derived from passwd file line */
1090 if (extract_pw_data(&pw))
1119 pam_status = pam_start(service_name, pw.pw_name, &pam_conversation,
1128 if (!authenticate_via_shadow_passwd(pw.pw_name))
1132 pw.pw_name);
1211 free(pw.pw_name);
1212 free(pw.pw_dir);
1213 free(pw.pw_shell);
1248 pw.pw_shell) < 0) {
1284 if (restore_environment(preserve_environment, old_environ, &pw)) {
1289 execv(pw.pw_shell, argv + optind - 1);
1316 free(pw.pw_name);
1317 free(pw.pw_dir);
1318 free(pw.pw_shell);