Lines Matching defs:pw

85 allowed_user(struct ssh *ssh, struct passwd * pw)
92 /* Shouldn't be called if pw is NULL, but better safe than sorry... */
93 if (!pw || !pw->pw_name)
102 char *shell = xstrdup((pw->pw_shell[0] == '\0') ?
103 _PATH_BSHELL : pw->pw_shell); /* empty = /bin/sh */
107 "does not exist", pw->pw_name, shell);
114 "is not executable", pw->pw_name, shell);
130 r = match_user(pw->pw_name, hostname, ipaddr,
138 pw->pw_name, hostname);
146 r = match_user(pw->pw_name, hostname, ipaddr,
157 "not listed in AllowUsers", pw->pw_name, hostname);
163 if (ga_init(pw->pw_name, pw->pw_gid) == 0) {
165 "not in any group", pw->pw_name, hostname);
176 pw->pw_name, hostname);
189 "in AllowGroups", pw->pw_name, hostname);
335 expand_authorized_keys(const char *filename, struct passwd *pw)
341 (unsigned long long)pw->pw_uid);
342 file = percent_expand(filename, "h", pw->pw_dir,
343 "u", pw->pw_name, "U", uidstr, (char *)NULL);
352 i = snprintf(ret, sizeof(ret), "%s/%s", pw->pw_dir, file);
360 authorized_principals_file(struct passwd *pw)
364 return expand_authorized_keys(options.authorized_principals_file, pw);
369 check_key_in_hostfiles(struct passwd *pw, struct sshkey *key, const char *host,
381 user_hostfile = tilde_expand_filename(userfile, pw->pw_uid);
384 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
388 pw->pw_name, user_hostfile);
392 temporarily_use_uid(pw);
418 struct passwd *pw;
432 pw = getpwnam(user);
433 if (pw == NULL) {
438 if (!allowed_user(ssh, pw))
440 if ((lc = login_getclass(pw->pw_class)) == NULL) {
444 if ((as = auth_open()) == NULL || auth_setpwd(as, pw) != 0 ||
445 auth_approval(as, lc, pw->pw_name, "ssh") <= 0) {
447 pw = NULL;
451 if (pw != NULL)
452 return (pwcopy(pw));