| /freebsd-13-stable/lib/libc/tests/nss/ |
| HD | getpw_test.c | 126 free_passwd(struct passwd *pwd) in free_passwd() argument 128 free(pwd->pw_name); in free_passwd() 129 free(pwd->pw_passwd); in free_passwd() 130 free(pwd->pw_class); in free_passwd() 131 free(pwd->pw_gecos); in free_passwd() 132 free(pwd->pw_dir); in free_passwd() 133 free(pwd->pw_shell); in free_passwd() 137 sdump_passwd(struct passwd *pwd, char *buffer, size_t buflen) in sdump_passwd() argument 140 pwd->pw_name, pwd->pw_passwd, pwd->pw_uid, pwd->pw_gid, in sdump_passwd() 141 (uintmax_t)pwd->pw_change, pwd->pw_class, pwd->pw_gecos, in sdump_passwd() [all …]
|
| /freebsd-13-stable/usr.bin/logins/ |
| HD | logins.c | 203 struct passwd *pwd; in get_users() local 211 if ((pwd = getpwent()) == NULL) in get_users() 213 pwds[npwds].pw_name = xstrdup(pwd->pw_name); in get_users() 214 pwds[npwds].pw_passwd = xstrdup(pwd->pw_passwd); in get_users() 215 pwds[npwds].pw_uid = pwd->pw_uid; in get_users() 216 pwds[npwds].pw_gid = pwd->pw_gid; in get_users() 217 pwds[npwds].pw_change = pwd->pw_change; in get_users() 218 pwds[npwds].pw_class = xstrdup(pwd->pw_class); in get_users() 219 pwds[npwds].pw_gecos = xstrdup(pwd->pw_gecos); in get_users() 220 pwds[npwds].pw_dir = xstrdup(pwd->pw_dir); in get_users() [all …]
|
| /freebsd-13-stable/usr.sbin/pw/ |
| HD | pw_user.c | 73 static int print_user(struct passwd *pwd, bool pretty, bool v7); 150 create_and_populate_homedir(struct userconf *cnf, struct passwd *pwd, in create_and_populate_homedir() argument 156 mkdir_home_parents(conf.rootfd, pwd->pw_dir); in create_and_populate_homedir() 164 copymkdir(conf.rootfd, pwd->pw_dir, skelfd, homemode, pwd->pw_uid, in create_and_populate_homedir() 165 pwd->pw_gid, 0); in create_and_populate_homedir() 167 pwd->pw_name, (uintmax_t)pwd->pw_uid, pwd->pw_dir); in create_and_populate_homedir() 171 pw_set_passwd(struct passwd *pwd, int fd, bool precrypted, bool update) in pw_set_passwd() argument 180 if (!pwd->pw_passwd || *pwd->pw_passwd != '*') { in pw_set_passwd() 181 pwd->pw_passwd = "*"; /* No access */ in pw_set_passwd() 197 pwd->pw_name); in pw_set_passwd() [all …]
|
| HD | pwupd.c | 84 pw_update(struct passwd * pwd, char const * user) in pw_update() argument 93 if (pwd != NULL) in pw_update() 94 pw = pw_dup(pwd); in pw_update() 131 addpwent(struct passwd * pwd) in addpwent() argument 134 return (pw_update(pwd, NULL)); in addpwent() 138 chgpwent(char const * login, struct passwd * pwd) in chgpwent() argument 141 return (pw_update(pwd, login)); in chgpwent() 145 delpwent(struct passwd * pwd) in delpwent() argument 148 return (pw_update(NULL, pwd->pw_name)); in delpwent()
|
| /freebsd-13-stable/crypto/heimdal/appl/login/ |
| HD | login.c | 142 otp_verify(struct passwd *pwd, const char *password) in otp_verify() argument 156 krb5_verify(struct passwd *pwd, const char *password) in krb5_verify() argument 161 ret = krb5_parse_name(context, pwd->pw_name, &princ); in krb5_verify() 180 krb5_start_session (const struct passwd *pwd) in krb5_start_session() argument 187 (unsigned)pwd->pw_uid); in krb5_start_session() 208 krb5_get_afs_tokens (const struct passwd *pwd) in krb5_get_afs_tokens() argument 220 pw_dir = pwd->pw_dir; in krb5_get_afs_tokens() 229 cell, NULL, pwd->pw_uid, pwd->pw_dir); in krb5_get_afs_tokens() 231 pwd->pw_uid, pwd->pw_dir); in krb5_get_afs_tokens() 315 do_login(const struct passwd *pwd, char *tty, char *ttyn) in do_login() argument [all …]
|
| /freebsd-13-stable/contrib/netbsd-tests/lib/librumphijack/ |
| HD | h_cwd.c | 43 static char pwd[1024]; variable 84 if (getcwd(pwd, sizeof(pwd)) == NULL) in simple() 86 if (strcmp(pwd, prefix) != 0) in simple() 92 if (getcwd(pwd, sizeof(pwd)) == NULL) in simple() 94 if (strcmp(pwd, makepath("dir")) != 0) in simple() 100 if (getcwd(pwd, sizeof(pwd)) == NULL) in simple() 102 if (strcmp(pwd, makepath("dir/dir")) != 0) in simple() 106 if (getcwd(pwd, sizeof(pwd)) == NULL) in simple() 108 if (strcmp(pwd, makepath("dir")) != 0) in simple() 113 if (getcwd(pwd, sizeof(pwd)) == NULL) in simple() [all …]
|
| /freebsd-13-stable/usr.sbin/jexec/ |
| HD | jexec.c | 63 const struct passwd *pwd = NULL; in main() local 97 get_user_info(username, &pwd, &lcap); in main() 112 get_user_info(username, &pwd, &lcap); in main() 121 if (setgid(pwd->pw_gid) != 0) in main() 123 if (setusercontext(lcap, pwd, pwd->pw_uid, username in main() 128 setenv("USER", pwd->pw_name, 1); in main() 129 setenv("HOME", pwd->pw_dir, 1); in main() 131 *pwd->pw_shell ? pwd->pw_shell : _PATH_BSHELL, 1); in main() 132 if (clean && chdir(pwd->pw_dir) < 0) in main() 133 err(1, "chdir: %s", pwd->pw_dir); in main() [all …]
|
| /freebsd-13-stable/lib/libutil/ |
| HD | login_class.c | 140 substvar(const char * var, const struct passwd * pwd, int hlen, int pch, int nlen) in substvar() argument 150 if (pwd != NULL) { in substvar() 164 if (pwd != NULL) { in substvar() 177 memmove(p, pwd->pw_dir, hlen); in substvar() 184 memmove(p, pwd->pw_name, nlen); in substvar() 197 setclassenvironment(login_cap_t *lc, const struct passwd * pwd, int paths) in setclassenvironment() argument 200 int hlen = pwd ? strlen(pwd->pw_dir) : 0; in setclassenvironment() 201 int nlen = pwd ? strlen(pwd->pw_name) : 0; in setclassenvironment() 204 if (hlen && pwd->pw_dir[hlen-1] != '/') in setclassenvironment() 211 char * np = substvar(var, pwd, hlen, pch, nlen); in setclassenvironment() [all …]
|
| /freebsd-13-stable/lib/nss_tacplus/ |
| HD | nss_tacplus.c | 112 tacplus_getpwnam_r(const char *name, struct passwd *pwd, char *buffer, in tacplus_getpwnam_r() argument 150 memset(pwd, 0, sizeof(*pwd)); in tacplus_getpwnam_r() 153 pwd->pw_name = tacplus_copystr(name, &buffer, &bufsize); in tacplus_getpwnam_r() 154 if (pwd->pw_name == NULL) in tacplus_getpwnam_r() 158 pwd->pw_passwd = tacplus_copystr("*", &buffer, &bufsize); in tacplus_getpwnam_r() 163 pwd->pw_uid = DEF_UID; in tacplus_getpwnam_r() 164 pwd->pw_gid = DEF_GID; in tacplus_getpwnam_r() 186 pwd->pw_uid = num; in tacplus_getpwnam_r() 195 pwd->pw_gid = num; in tacplus_getpwnam_r() 197 pwd->pw_class = tacplus_copystr(value, &buffer, in tacplus_getpwnam_r() [all …]
|
| /freebsd-13-stable/lib/libpam/modules/pam_unix/ |
| HD | pam_unix.c | 92 struct passwd *pwd; in pam_sm_authenticate() local 103 pwd = getpwnam(user); in pam_sm_authenticate() 107 if (pwd != NULL) { in pam_sm_authenticate() 109 realpw = pwd->pw_passwd; in pam_sm_authenticate() 117 lc = login_getpwclass(pwd); in pam_sm_authenticate() 156 struct passwd *pwd; in pam_sm_acct_mgmt() local 169 if (user == NULL || (pwd = getpwnam(user)) == NULL) in pam_sm_acct_mgmt() 182 if (*pwd->pw_passwd == '\0' && in pam_sm_acct_mgmt() 186 if (strncmp(pwd->pw_passwd, LOCKED_PREFIX, LOCKED_PREFIX_LEN) == 0) in pam_sm_acct_mgmt() 189 lc = login_getpwclass(pwd); in pam_sm_acct_mgmt() [all …]
|
| /freebsd-13-stable/lib/libcasper/services/cap_pwd/ |
| HD | cap_pwd.c | 92 passwd_unpack(const nvlist_t *nvl, struct passwd *pwd, char *buffer, in passwd_unpack() argument 100 explicit_bzero(pwd, sizeof(*pwd)); in passwd_unpack() 102 error = passwd_unpack_string(nvl, "pw_name", &pwd->pw_name, &buffer, in passwd_unpack() 106 pwd->pw_uid = (uid_t)nvlist_get_number(nvl, "pw_uid"); in passwd_unpack() 107 pwd->pw_gid = (gid_t)nvlist_get_number(nvl, "pw_gid"); in passwd_unpack() 108 pwd->pw_change = (time_t)nvlist_get_number(nvl, "pw_change"); in passwd_unpack() 109 error = passwd_unpack_string(nvl, "pw_passwd", &pwd->pw_passwd, &buffer, in passwd_unpack() 113 error = passwd_unpack_string(nvl, "pw_class", &pwd->pw_class, &buffer, in passwd_unpack() 117 error = passwd_unpack_string(nvl, "pw_gecos", &pwd->pw_gecos, &buffer, in passwd_unpack() 121 error = passwd_unpack_string(nvl, "pw_dir", &pwd->pw_dir, &buffer, in passwd_unpack() [all …]
|
| /freebsd-13-stable/lib/libc/gen/ |
| HD | getpwent.c | 260 struct passwd *pwd; in pwd_marshal_func() local 282 pwd = va_arg(ap, struct passwd *); in pwd_marshal_func() 287 strlen(pwd->pw_name) + 1; in pwd_marshal_func() 288 if (pwd->pw_passwd != NULL) in pwd_marshal_func() 289 desired_size += strlen(pwd->pw_passwd) + 1; in pwd_marshal_func() 290 if (pwd->pw_class != NULL) in pwd_marshal_func() 291 desired_size += strlen(pwd->pw_class) + 1; in pwd_marshal_func() 292 if (pwd->pw_gecos != NULL) in pwd_marshal_func() 293 desired_size += strlen(pwd->pw_gecos) + 1; in pwd_marshal_func() 294 if (pwd->pw_dir != NULL) in pwd_marshal_func() [all …]
|
| HD | pw_scan.c | 67 __pw_initpwd(struct passwd *pwd) in __pw_initpwd() argument 71 memset(pwd, 0, sizeof(*pwd)); in __pw_initpwd() 72 pwd->pw_uid = (uid_t)-1; /* Considered least likely to lead to */ in __pw_initpwd() 73 pwd->pw_gid = (gid_t)-1; /* a security issue. */ in __pw_initpwd() 74 pwd->pw_name = nul; in __pw_initpwd() 75 pwd->pw_passwd = nul; in __pw_initpwd() 76 pwd->pw_class = nul; in __pw_initpwd() 77 pwd->pw_gecos = nul; in __pw_initpwd() 78 pwd->pw_dir = nul; in __pw_initpwd() 79 pwd->pw_shell = nul; in __pw_initpwd()
|
| /freebsd-13-stable/usr.sbin/pwd_mkdb/ |
| HD | pwd_mkdb.c | 82 static struct passwd pwd; /* password structure */ variable 202 while (scan(fp, &pwd)) in main() 203 if (!is_comment && strlen(pwd.pw_name) >= MAXLOGNAME) { in main() 204 warnx("%s: username too long", pwd.pw_name); in main() 353 for (cnt = 1; scan(fp, &pwd); ++cnt) { in main() 355 (pwd.pw_name[0] == '+' || pwd.pw_name[0] == '-')) { in main() 372 (!username || (strcmp(username, pwd.pw_name) == 0))) { in main() 375 COMPACT(pwd.pw_name); in main() 377 SCALAR(pwd.pw_uid); in main() 378 SCALAR(pwd.pw_gid); in main() [all …]
|
| /freebsd-13-stable/usr.bin/login/ |
| HD | login.c | 121 struct passwd *pwd; variable 294 if (failures > (pwd ? 0 : 1)) in main() 326 (void)getpwnam_r(username, &pwres, pwbuf, sizeof(pwbuf), &pwd); in main() 327 if (pwd != NULL && pwd->pw_uid == 0) in main() 335 if (pwd != NULL && fflag && in main() 336 (uid == (uid_t)0 || uid == (uid_t)pwd->pw_uid)) { in main() 349 if (pwd != NULL && rval == 0) in main() 365 pwd = NULL; in main() 415 lc = login_getpwclass(pwd); in main() 416 lc_user = login_getuserclass(pwd); in main() [all …]
|
| /freebsd-13-stable/lib/libypclnt/ |
| HD | ypclnt_passwd.c | 118 ypclnt_passwd(ypclnt_t *ypclnt, const struct passwd *pwd, const char *passwd) in ypclnt_passwd() argument 122 return (yppasswd_remote(ypclnt, pwd, passwd)); in ypclnt_passwd() 124 return (yppasswd_local(ypclnt, pwd)); in ypclnt_passwd() 137 yppasswd_local(ypclnt_t *ypclnt, const struct passwd *pwd) in yppasswd_local() argument 148 yppwd.newpw.pw_uid = pwd->pw_uid; in yppasswd_local() 149 yppwd.newpw.pw_gid = pwd->pw_gid; in yppasswd_local() 150 yppwd.newpw.pw_change = pwd->pw_change; in yppasswd_local() 151 yppwd.newpw.pw_expire = pwd->pw_expire; in yppasswd_local() 152 yppwd.newpw.pw_fields = pwd->pw_fields; in yppasswd_local() 155 if ((yppwd.newpw.pw_name = strdup(pwd->pw_name)) == NULL || in yppasswd_local() [all …]
|
| /freebsd-13-stable/bin/sh/tests/parameters/ |
| HD | pwd2.0 | 7 TP=$(pwd) 12 [ "$(pwd)" = "$TP/link" ] 13 [ "$(pwd -P)" = "$TP/test1" ] 14 [ "$(${SH} -c pwd)" = "$TP/link" ] 15 [ "$(${SH} -c pwd\ -P)" = "$TP/test1" ] 17 [ "$(pwd)" = "$TP" ] 20 [ "$(pwd)" = "$TP/test1" ] 21 [ "$(pwd -P)" = "$TP/test1" ] 22 [ "$(${SH} -c pwd)" = "$TP/test1" ] 23 [ "$(${SH} -c pwd\ -P)" = "$TP/test1" ]
|
| /freebsd-13-stable/lib/libcasper/services/cap_pwd/tests/ |
| HD | pwd_test.c | 885 passwd_fields(const struct passwd *pwd) in passwd_fields() argument 891 if (pwd->pw_name != NULL && pwd->pw_name[0] != '\0') in passwd_fields() 896 if (pwd->pw_passwd != NULL && pwd->pw_passwd[0] != '\0') in passwd_fields() 898 else if ((pwd->pw_fields & _PWF_PASSWD) != 0) in passwd_fields() 903 if (pwd->pw_uid != (uid_t)-1) in passwd_fields() 908 if (pwd->pw_gid != (gid_t)-1) in passwd_fields() 913 if (pwd->pw_change != 0 || (pwd->pw_fields & _PWF_CHANGE) != 0) in passwd_fields() 918 if (pwd->pw_class != NULL && pwd->pw_class[0] != '\0') in passwd_fields() 920 else if ((pwd->pw_fields & _PWF_CLASS) != 0) in passwd_fields() 925 if (pwd->pw_gecos != NULL && pwd->pw_gecos[0] != '\0') in passwd_fields() [all …]
|
| /freebsd-13-stable/usr.bin/newgrp/ |
| HD | newgrp.c | 55 static struct passwd *pwd; variable 80 if ((pwd = getpwuid(getuid())) == NULL) in main() 136 initres = initgroups(pwd->pw_name, pwd->pw_gid); in restoregrps() 137 setres = setgid(pwd->pw_gid); in restoregrps() 172 if (pwd->pw_gid == grp->gr_gid) in addgroup() 175 if (strcmp(*p, pwd->pw_name) == 0) { in addgroup() 264 shell = pwd->pw_shell; in loginshell() 267 if (chdir(pwd->pw_dir) < 0) { in loginshell() 268 warn("%s", pwd->pw_dir); in loginshell() 280 lc = login_getpwclass(pwd); in loginshell() [all …]
|
| /freebsd-13-stable/usr.bin/su/ |
| HD | su.c | 152 struct passwd *pwd = NULL; in main() local 259 pwd = getpwnam(username); in main() 260 if (pwd == NULL || pwd->pw_uid != ruid) in main() 261 pwd = getpwuid(ruid); in main() 262 if (pwd == NULL) { in main() 271 username = strdup(pwd->pw_name); in main() 276 if (pwd->pw_shell != NULL && *pwd->pw_shell != '\0') { in main() 278 strlcpy(shellbuf, pwd->pw_shell, in main() 323 pwd = getpwnam(user); in main() 324 if (pwd == NULL) { in main() [all …]
|
| /freebsd-13-stable/stand/lua/ |
| HD | password.lua | 89 local function doPrompt(prompt, pwd) 107 if pwd == nil or pwd == read_pwd then 117 local function compare(prompt, pwd) 118 if pwd == nil then 121 doPrompt(prompt, pwd) 133 local pwd = loader.getenv("password") 134 if pwd ~= nil then 143 compare("Loader password:", pwd)
|
| /freebsd-13-stable/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/ |
| HD | argon2.c | 87 const uint32_t parallelism, const void *pwd, const size_t pwdlen, in argon2_hash() argument 115 context.pwd = (uint8_t *) pwd; in argon2_hash() 160 const uint32_t parallelism, const void *pwd, in argon2i_hash_encoded() argument 165 return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen, in argon2i_hash_encoded() 171 const uint32_t parallelism, const void *pwd, in argon2i_hash_raw() argument 175 return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen, in argon2i_hash_raw() 181 const uint32_t parallelism, const void *pwd, in argon2id_hash_encoded() argument 186 return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen, in argon2id_hash_encoded() 192 const uint32_t parallelism, const void *pwd, in argon2id_hash_raw() argument 196 return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen, in argon2id_hash_raw() [all …]
|
| /freebsd-13-stable/contrib/openpam/lib/libpam/ |
| HD | openpam_borrow_cred.c | 61 const struct passwd *pwd) in openpam_borrow_cred() argument 67 ENTERI(pwd->pw_uid); in openpam_borrow_cred() 74 if (geteuid() != 0 && geteuid() != pwd->pw_uid) { in openpam_borrow_cred() 95 if (geteuid() == pwd->pw_uid) in openpam_borrow_cred() 97 if (initgroups(pwd->pw_name, pwd->pw_gid) < 0 || in openpam_borrow_cred() 98 setegid(pwd->pw_gid) < 0 || seteuid(pwd->pw_uid) < 0) { in openpam_borrow_cred()
|
| /freebsd-13-stable/crypto/heimdal/lib/roken/ |
| HD | get_default_username.c | 64 struct passwd *pwd; in get_default_username() local 67 pwd = k_getpwnam (user); in get_default_username() 68 if (pwd != NULL && pwd->pw_uid == uid) in get_default_username() 71 pwd = k_getpwuid (uid); in get_default_username() 72 if (pwd != NULL) in get_default_username() 73 return pwd->pw_name; in get_default_username()
|
| /freebsd-13-stable/usr.bin/top/ |
| HD | username.c | 73 struct passwd *pwd; in userid() local 79 if ((pwd = getpwnam(username_)) == NULL) in userid() 85 enter_user(pwd->pw_uid, username_, 1); in userid() 88 return(pwd->pw_uid); in userid() 124 struct passwd *pwd; in get_user() local 127 if ((pwd = getpwuid(uid)) != NULL) in get_user() 129 return(enter_user(pwd->pw_uid, pwd->pw_name, 1)); in get_user()
|