Lines Matching refs:passwd
89 verify_password(passwd* passwd, spwd* spwd, const char* plainPassword) in verify_password() argument
91 if (passwd == NULL) in verify_password()
95 const char* requiredPassword = passwd->pw_passwd; in verify_password()
127 authenticate_user(const char* prompt, passwd* passwd, spwd* spwd, int maxTries, in authenticate_user() argument
131 if (verify_password(passwd, spwd, "")) in authenticate_user()
143 bool ok = verify_password(passwd, spwd, plainPassword); in authenticate_user()
156 authenticate_user(const char* prompt, const char* user, passwd** _passwd, in authenticate_user()
159 struct passwd* passwd = getpwnam(user); in authenticate_user() local
162 status_t error = authenticate_user(prompt, passwd, spwd, maxTries, in authenticate_user()
166 *_passwd = passwd; in authenticate_user()
176 setup_environment(struct passwd* passwd, bool preserveEnvironment, bool chngdir) in setup_environment() argument
187 if (passwd->pw_shell) in setup_environment()
188 setenv("SHELL", passwd->pw_shell, true); in setup_environment()
189 if (passwd->pw_dir) in setup_environment()
190 setenv("HOME", passwd->pw_dir, true); in setup_environment()
192 setenv("USER", passwd->pw_name, true); in setup_environment()
202 if (passwd->pw_gid && setgid(passwd->pw_gid) != 0) in setup_environment()
205 if (passwd->pw_uid && setuid(passwd->pw_uid) != 0) in setup_environment()