Lines Matching refs:pw

83 allowed_user(struct passwd * pw)  in allowed_user()  argument
97 if (!pw || !pw->pw_name) in allowed_user()
101 spw = getspnam(pw->pw_name); in allowed_user()
113 log("Account %.100s has expired", pw->pw_name); in allowed_user()
119 pw->pw_name); in allowed_user()
126 pw->pw_name); in allowed_user()
132 if (!pw || !pw->pw_name) in allowed_user()
140 shell = (pw->pw_shell[0] == '\0') ? _PATH_BSHELL : pw->pw_shell; in allowed_user()
145 pw->pw_name, shell); in allowed_user()
151 pw->pw_name, shell); in allowed_user()
163 if (match_user(pw->pw_name, hostname, ipaddr, in allowed_user()
166 pw->pw_name); in allowed_user()
173 if (match_user(pw->pw_name, hostname, ipaddr, in allowed_user()
179 pw->pw_name); in allowed_user()
185 if (ga_init(pw->pw_name, pw->pw_gid) == 0) { in allowed_user()
187 pw->pw_name); in allowed_user()
197 pw->pw_name); in allowed_user()
209 pw->pw_name); in allowed_user()
216 if (loginrestrictions(pw->pw_name, S_RLOGIN, NULL, &loginmsg) != 0) { in allowed_user()
226 log("Login restricted for %s: %.100s", pw->pw_name, loginmsg); in allowed_user()
388 expand_filename(const char *filename, struct passwd *pw) in expand_filename() argument
394 if (pw == 0) in expand_filename()
408 buffer_append(&buffer, pw->pw_dir, strlen(pw->pw_dir)); in expand_filename()
413 buffer_append(&buffer, pw->pw_name, in expand_filename()
414 strlen(pw->pw_name)); in expand_filename()
429 snprintf(file, MAXPATHLEN, "%s/%s", pw->pw_dir, cp); in expand_filename()
438 authorized_keys_file(struct passwd *pw) in authorized_keys_file() argument
440 return expand_filename(options.authorized_keys_file, pw); in authorized_keys_file()
444 authorized_keys_file2(struct passwd *pw) in authorized_keys_file2() argument
446 return expand_filename(options.authorized_keys_file2, pw); in authorized_keys_file2()
451 check_key_in_hostfiles(struct passwd *pw, Key *key, const char *host, in check_key_in_hostfiles() argument
464 user_hostfile = tilde_expand_filename(userfile, pw->pw_uid); in check_key_in_hostfiles()
467 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || in check_key_in_hostfiles()
471 pw->pw_name, user_hostfile); in check_key_in_hostfiles()
473 temporarily_use_uid(pw); in check_key_in_hostfiles()
501 secure_filename(FILE *f, const char *file, struct passwd *pw, in secure_filename() argument
510 if (pw == NULL) in secure_filename()
513 uid = pw->pw_uid; in secure_filename()
528 if (realpath(pw->pw_dir, homedir) != NULL) in secure_filename()
582 struct passwd *pw; in getpwnamallow() local
590 pw = getpwnam(user); in getpwnamallow()
591 if (pw == NULL) { in getpwnamallow()
596 if (!allowed_user(pw)) in getpwnamallow()
599 if ((lc = login_getclass(pw->pw_class)) == NULL) { in getpwnamallow()
604 if ((as = auth_open()) == NULL || auth_setpwd(as, pw) != 0 || in getpwnamallow()
605 auth_approval(as, lc, pw->pw_name, "ssh") <= 0) { in getpwnamallow()
607 pw = NULL; in getpwnamallow()
613 if (pw != NULL) in getpwnamallow()
614 return (pwcopy(pw)); in getpwnamallow()