• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/OpenSSH-186/openssh/

Lines Matching refs:pw

96 allowed_user(struct passwd * pw)
105 /* Shouldn't be called if pw is NULL, but better safe than sorry... */
106 if (!pw || !pw->pw_name)
111 spw = getspnam(pw->pw_name);
119 passwd = pw->pw_passwd;
123 passwd = get_iaf_password(pw);
151 pw->pw_name);
162 char *shell = xstrdup((pw->pw_shell[0] == '\0') ?
163 _PATH_BSHELL : pw->pw_shell); /* empty = /bin/sh */
167 "does not exist", pw->pw_name, shell);
174 "is not executable", pw->pw_name, shell);
190 if (match_user(pw->pw_name, hostname, ipaddr,
194 pw->pw_name, hostname);
201 if (match_user(pw->pw_name, hostname, ipaddr,
207 "not listed in AllowUsers", pw->pw_name, hostname);
213 if (ga_init(pw) == 0) {
215 "not in any group", pw->pw_name, hostname);
226 pw->pw_name, hostname);
239 "in AllowGroups", pw->pw_name, hostname);
246 if (!sys_auth_allowed_user(pw, &loginmsg))
340 expand_authorized_keys(const char *filename, struct passwd *pw)
345 file = percent_expand(filename, "h", pw->pw_dir,
346 "u", pw->pw_name, (char *)NULL);
355 i = snprintf(ret, sizeof(ret), "%s/%s", pw->pw_dir, file);
363 authorized_principals_file(struct passwd *pw)
368 return expand_authorized_keys(options.authorized_principals_file, pw);
373 check_key_in_hostfiles(struct passwd *pw, Key *key, const char *host,
385 user_hostfile = tilde_expand_filename(userfile, pw->pw_uid);
388 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
392 pw->pw_name, user_hostfile);
396 temporarily_use_uid(pw);
495 secure_filename(FILE *f, const char *file, struct passwd *pw,
506 return auth_secure_path(file, &st, pw->pw_dir, pw->pw_uid, err, errlen);
510 auth_openfile(const char *file, struct passwd *pw, int strict_modes,
531 pw->pw_name, file_type, file);
541 secure_filename(f, file, pw, line, sizeof(line)) != 0) {
553 auth_openkeyfile(const char *file, struct passwd *pw, int strict_modes)
555 return auth_openfile(file, pw, strict_modes, 1, "authorized keys");
559 auth_openprincipals(const char *file, struct passwd *pw, int strict_modes)
561 return auth_openfile(file, pw, strict_modes, 0,
574 struct passwd *pw;
584 pw = getpwnam(user);
596 if (pw != NULL && strcmp(user, pw->pw_name) != 0) {
598 user, pw->pw_name);
599 pw = NULL;
602 if (pw == NULL) {
614 if (!allowed_user(pw))
617 if ((lc = login_getclass(pw->pw_class)) == NULL) {
622 if ((as = auth_open()) == NULL || auth_setpwd(as, pw) != 0 ||
623 auth_approval(as, lc, pw->pw_name, "ssh") <= 0) {
625 pw = NULL;
631 if (pw != NULL)
632 return (pwcopy(pw));