bin/getfacl/getfacl.c
71
struct passwd *pw;
bin/getfacl/getfacl.c
74
if ((pw = getpwuid(uid)) == NULL) {
bin/getfacl/getfacl.c
78
return (pw->pw_name);
bin/pax/cache.c
168
struct passwd *pw;
bin/pax/cache.c
197
if ((pw = getpwuid(uid)) == NULL) {
bin/pax/cache.c
215
return(pw->pw_name);
bin/pax/cache.c
217
(void)strncpy(ptr->name, pw->pw_name, UNMLEN - 1);
bin/pax/cache.c
301
struct passwd *pw;
bin/pax/cache.c
339
if ((pw = getpwnam(name)) == NULL)
bin/pax/cache.c
341
*uid = pw->pw_uid;
bin/pax/cache.c
346
if ((pw = getpwnam(name)) == NULL) {
bin/pax/cache.c
351
*uid = ptr->uid = pw->pw_uid;
bin/pax/sel_subs.c
103
struct passwd *pw;
bin/pax/sel_subs.c
126
if ((pw = getpwnam(str)) == NULL) {
bin/pax/sel_subs.c
130
uid = (uid_t)pw->pw_uid;
bin/pkill/pkill.c
702
struct passwd *pw;
bin/pkill/pkill.c
766
if ((pw = getpwnam(sp)) == NULL)
bin/pkill/pkill.c
768
li->li_number = pw->pw_uid;
bin/sh/expand.c
363
struct passwd *pw;
bin/sh/expand.c
392
pw = getpwnam(user);
bin/sh/expand.c
393
home = pw != NULL ? pw->pw_dir : NULL;
bin/sh/parser.c
1990
struct passwd *pw;
bin/sh/parser.c
2002
pw = getpwlogin();
bin/sh/parser.c
2003
if (pw == NULL || pw->pw_uid != euid)
bin/sh/parser.c
2004
pw = getpwuid(euid);
bin/sh/parser.c
2006
if (pw != NULL) {
bin/sh/parser.c
2007
strlcpy(cached_name, pw->pw_name,
crypto/heimdal/admin/add.c
127
krb5_data pw;
crypto/heimdal/admin/add.c
132
pw.data = (void*)opt->password_string;
crypto/heimdal/admin/add.c
133
pw.length = strlen(opt->password_string);
crypto/heimdal/admin/add.c
134
ret = krb5_string_to_key_data_salt(context, enctype, pw, salt,
crypto/heimdal/appl/afsutil/pagsh.c
171
struct passwd *pw = k_getpwuid(geteuid());
crypto/heimdal/appl/afsutil/pagsh.c
172
if (pw == NULL)
crypto/heimdal/appl/afsutil/pagsh.c
174
path = strdup(pw->pw_shell);
crypto/heimdal/appl/ftp/ftp/ftp.c
174
struct passwd *pw = k_getpwuid(getuid());
crypto/heimdal/appl/ftp/ftp/ftp.c
176
if (pw != NULL)
crypto/heimdal/appl/ftp/ftp/ftp.c
177
myname = pw->pw_name;
crypto/heimdal/appl/ftp/ftp/main.c
138
pw = k_getpwuid(getuid());
crypto/heimdal/appl/ftp/ftp/main.c
139
if (pw != NULL) {
crypto/heimdal/appl/ftp/ftp/main.c
140
strlcpy(homedir, pw->pw_dir, sizeof(homedir));
crypto/heimdal/appl/ftp/ftp/main.c
91
struct passwd *pw = NULL;
crypto/heimdal/appl/ftp/ftpd/extern.h
130
extern struct passwd *pw;
crypto/heimdal/appl/ftp/ftpd/ftpcmd.c
2076
const char *path = pw->pw_dir;
crypto/heimdal/appl/ftp/ftpd/ftpcmd.c
3166
(pw ? pw -> pw_name : "unknown"), ftpd_timeout);
crypto/heimdal/appl/ftp/ftpd/ftpcmd.y
1113
(pw ? pw -> pw_name : "unknown"), ftpd_timeout);
crypto/heimdal/appl/ftp/ftpd/ftpcmd.y
367
const char *path = pw->pw_dir;
crypto/heimdal/appl/ftp/ftpd/ftpd.c
1207
if (seteuid(pw->pw_uid) < 0)
crypto/heimdal/appl/ftp/ftpd/ftpd.c
1216
if (seteuid((uid_t)pw->pw_uid) < 0)
crypto/heimdal/appl/ftp/ftpd/ftpd.c
1613
printf(" Logged in as %s\r\n", pw->pw_name);
crypto/heimdal/appl/ftp/ftpd/ftpd.c
1990
if (seteuid(pw->pw_uid) < 0)
crypto/heimdal/appl/ftp/ftpd/ftpd.c
1994
if (seteuid(pw->pw_uid) < 0)
crypto/heimdal/appl/ftp/ftpd/ftpd.c
2037
if (seteuid(pw->pw_uid))
crypto/heimdal/appl/ftp/ftpd/ftpd.c
2041
if (seteuid(pw->pw_uid) < 0)
crypto/heimdal/appl/ftp/ftpd/ftpd.c
514
else if ((pw = sgetpwnam("ftp")) != NULL) {
crypto/heimdal/appl/ftp/ftpd/ftpd.c
540
if ((pw = sgetpwnam(name))) {
crypto/heimdal/appl/ftp/ftpd/ftpd.c
541
if ((shell = pw->pw_shell) == NULL || *shell == 0)
crypto/heimdal/appl/ftp/ftpd/ftpd.c
567
pw = (struct passwd *) NULL;
crypto/heimdal/appl/ftp/ftpd/ftpd.c
65
struct passwd *pw;
crypto/heimdal/appl/ftp/ftpd/ftpd.c
702
if (setegid((gid_t)pw->pw_gid) < 0) {
crypto/heimdal/appl/ftp/ftpd/ftpd.c
706
initgroups(pw->pw_name, pw->pw_gid);
crypto/heimdal/appl/ftp/ftpd/ftpd.c
713
ftpd_logwtmp(ttyline, pw->pw_name, remotehost);
crypto/heimdal/appl/ftp/ftpd/ftpd.c
716
dochroot = checkuser(_PATH_FTPCHROOT, pw->pw_name);
crypto/heimdal/appl/ftp/ftpd/ftpd.c
723
if (chroot(pw->pw_dir) < 0 || chdir("/") < 0) {
crypto/heimdal/appl/ftp/ftpd/ftpd.c
728
if (chroot(pw->pw_dir) < 0 || chdir("/") < 0) {
crypto/heimdal/appl/ftp/ftpd/ftpd.c
732
} else if (chdir(pw->pw_dir) < 0) {
crypto/heimdal/appl/ftp/ftpd/ftpd.c
735
pw->pw_name, pw->pw_dir);
crypto/heimdal/appl/ftp/ftpd/ftpd.c
740
if (seteuid((uid_t)pw->pw_uid) < 0) {
crypto/heimdal/appl/ftp/ftpd/ftpd.c
787
reply(code, "User %s logged in.", pw->pw_name);
crypto/heimdal/appl/ftp/ftpd/ftpd.c
789
snprintf(proctitle, sizeof(proctitle), "%s: %s", remotehost, pw->pw_name);
crypto/heimdal/appl/ftp/ftpd/ftpd.c
804
pw->pw_name);
crypto/heimdal/appl/ftp/ftpd/ftpd.c
823
pw = NULL;
crypto/heimdal/appl/ftp/ftpd/ftpd.c
889
if (pw == NULL)
crypto/heimdal/appl/ftp/ftpd/ftpd.c
898
rval = krb5_verify(pw, passwd);
crypto/heimdal/appl/ftp/ftpd/ftpd.c
901
rval = unix_verify_user(pw->pw_name, passwd);
crypto/heimdal/appl/ftp/ftpd/ftpd.c
932
pw = NULL;
crypto/heimdal/appl/login/shadow.c
64
check_shadow(const struct passwd *pw, const struct spwd *sp)
crypto/heimdal/appl/login/shadow.c
87
change_passwd(pw);
crypto/heimdal/appl/su/su.c
294
char *pw;
crypto/heimdal/appl/su/su.c
301
pw = crypt(pw_buf, su->pw_passwd);
crypto/heimdal/appl/su/su.c
303
if(strcmp(pw, su->pw_passwd) != 0) {
crypto/heimdal/appl/test/gssapi_client.c
136
gss_buffer_desc pw;
crypto/heimdal/appl/test/gssapi_client.c
138
pw.value = password;
crypto/heimdal/appl/test/gssapi_client.c
139
pw.length = strlen(password);
crypto/heimdal/appl/test/gssapi_client.c
143
&pw,
crypto/heimdal/kadmin/cpw.c
65
char pw[128];
crypto/heimdal/kadmin/cpw.c
67
random_password (pw, sizeof(pw));
crypto/heimdal/kadmin/cpw.c
68
ret = kadm5_chpass_principal(kadm_handle, principal, pw);
crypto/heimdal/kadmin/cpw.c
74
printf ("%s's password set to \"%s\"\n", princ_name, pw);
crypto/heimdal/kadmin/cpw.c
77
memset (pw, 0, sizeof(pw));
crypto/heimdal/kadmin/random_password.c
112
generate_password(char **pw, int num_classes, ...)
crypto/heimdal/kadmin/random_password.c
124
*pw = NULL;
crypto/heimdal/kadmin/random_password.c
138
*pw = malloc(len + 1);
crypto/heimdal/kadmin/random_password.c
139
if(*pw == NULL) {
crypto/heimdal/kadmin/random_password.c
149
(*pw)[i] = classes[j].str[RND(rbuf, sizeof(rbuf), &rleft)
crypto/heimdal/kadmin/random_password.c
157
(*pw)[len] = '\0';
crypto/heimdal/kadmin/random_password.c
50
static void generate_password(char **pw, int num_classes, ...);
crypto/heimdal/kadmin/random_password.c
54
random_password(char *pw, size_t len)
crypto/heimdal/kadmin/random_password.c
61
otp_print_stddict (newkey, pw, len);
crypto/heimdal/kadmin/random_password.c
62
strlwr(pw);
crypto/heimdal/kadmin/random_password.c
70
strlcpy(pw, pass, len);
crypto/heimdal/kcm/config.c
167
struct passwd *pw;
crypto/heimdal/kcm/config.c
174
pw = getpwuid(atoi(system_user));
crypto/heimdal/kcm/config.c
176
pw = getpwnam(system_user);
crypto/heimdal/kcm/config.c
178
if (pw == NULL) {
crypto/heimdal/kcm/config.c
182
system_user = strdup(pw->pw_name);
crypto/heimdal/kcm/config.c
187
uid = pw->pw_uid; uid_p = 1;
crypto/heimdal/kcm/config.c
188
gid = pw->pw_gid; gid_p = 1;
crypto/heimdal/kdc/main.c
75
struct passwd *pw;
crypto/heimdal/kdc/main.c
77
pw = getpwnam(runas_string);
crypto/heimdal/kdc/main.c
78
if (pw == NULL)
crypto/heimdal/kdc/main.c
81
if (initgroups(pw->pw_name, pw->pw_gid) < 0)
crypto/heimdal/kdc/main.c
85
if (setgid(pw->pw_gid) < 0)
crypto/heimdal/kdc/main.c
88
if (setuid(pw->pw_uid) < 0)
crypto/heimdal/kdc/main.c
96
if (capng_change_id(pw->pw_uid, pw->pw_gid,
crypto/heimdal/kdc/string2key.c
73
const char *pw,
crypto/heimdal/kdc/string2key.c
82
ret = krb5_string_to_key_salt(context, enctype, pw, salt, &key);
crypto/heimdal/lib/gssapi/krb5/pname_to_uid.c
51
struct passwd pw, *pwd;
crypto/heimdal/lib/gssapi/krb5/pname_to_uid.c
68
if (getpwnam_r(localname, &pw, pwbuf, sizeof(pwbuf), &pwd) != 0) {
crypto/heimdal/lib/gssapi/mech/gss_pname_to_uid.c
110
if (getpwnam_r(localname, &pw, pwbuf, sizeof(pwbuf), &pwd) != 0)
crypto/heimdal/lib/gssapi/mech/gss_pname_to_uid.c
80
struct passwd pw, *pwd;
crypto/heimdal/lib/hdb/ext.c
290
heim_octet_string pw;
crypto/heimdal/lib/hdb/ext.c
308
&pw);
crypto/heimdal/lib/hdb/ext.c
310
ret = der_copy_octet_string(&ext->data.u.password.password, &pw);
crypto/heimdal/lib/hdb/ext.c
317
xstr = pw.data;
crypto/heimdal/lib/hdb/ext.c
318
if (xstr[pw.length - 1] != '\0') {
crypto/heimdal/lib/hdb/ext.c
325
der_free_octet_string(&pw);
crypto/heimdal/lib/hx509/crypto.c
2897
const struct _hx509_password *pw;
crypto/heimdal/lib/hx509/crypto.c
2935
pw = _hx509_lock_get_passwords(lock);
crypto/heimdal/lib/hx509/crypto.c
2938
for (i = 0; i < pw->len + 1; i++) {
crypto/heimdal/lib/hx509/crypto.c
2942
if (i < pw->len)
crypto/heimdal/lib/hx509/crypto.c
2943
password = pw->val[i];
crypto/heimdal/lib/hx509/crypto.c
2944
else if (i < pw->len + 1)
crypto/heimdal/lib/hx509/ks_file.c
185
const struct _hx509_password *pw;
crypto/heimdal/lib/hx509/ks_file.c
264
pw = _hx509_lock_get_passwords(lock);
crypto/heimdal/lib/hx509/ks_file.c
265
if (pw != NULL) {
crypto/heimdal/lib/hx509/ks_file.c
269
for (i = 0; i < pw->len; i++) {
crypto/heimdal/lib/hx509/ks_file.c
270
password = pw->val[i];
crypto/heimdal/lib/hx509/ks_p12.c
613
const struct _hx509_password *pw;
crypto/heimdal/lib/hx509/ks_p12.c
615
pw = _hx509_lock_get_passwords(lock);
crypto/heimdal/lib/hx509/ks_p12.c
616
if (pw != NULL) {
crypto/heimdal/lib/hx509/ks_p12.c
628
ret = calculate_hash(&aspath, pw, pfx.macData);
crypto/heimdal/lib/hx509/softp11.c
830
struct passwd *pw = getpwuid(getuid());
crypto/heimdal/lib/hx509/softp11.c
831
if(pw != NULL)
crypto/heimdal/lib/hx509/softp11.c
832
home = pw->pw_dir;
crypto/heimdal/lib/kadm5/ent_setup.c
77
heim_utf8_string pw = tl_data->tl_data_contents;
crypto/heimdal/lib/kadm5/ent_setup.c
79
if (pw[tl_data->tl_data_length] != '\0')
crypto/heimdal/lib/kadm5/ent_setup.c
82
ret = hdb_entry_set_password(context, db, &ent->entry, pw);
crypto/heimdal/lib/kadm5/get_s.c
246
heim_utf8_string pw;
crypto/heimdal/lib/kadm5/get_s.c
249
context->db, &ent.entry, &pw);
crypto/heimdal/lib/kadm5/get_s.c
251
(void) add_tl_data(out, KRB5_TL_PASSWORD, pw, strlen(pw) + 1);
crypto/heimdal/lib/kadm5/get_s.c
252
free(pw);
crypto/heimdal/lib/kadm5/password_quality.c
106
pw = malloc(len);
crypto/heimdal/lib/kadm5/password_quality.c
107
if (pw == NULL) {
crypto/heimdal/lib/kadm5/password_quality.c
111
strlcpy(pw, pwd->data, len);
crypto/heimdal/lib/kadm5/password_quality.c
112
len = strlen(pw);
crypto/heimdal/lib/kadm5/password_quality.c
115
if (strcspn(pw, classes[i]) < len)
crypto/heimdal/lib/kadm5/password_quality.c
118
memset(pw, 0, pwd->length + 1);
crypto/heimdal/lib/kadm5/password_quality.c
119
free(pw);
crypto/heimdal/lib/kadm5/password_quality.c
98
char *pw;
crypto/heimdal/lib/krb5/config_file.c
442
struct passwd *pw = getpwuid(getuid());
crypto/heimdal/lib/krb5/config_file.c
443
if(pw != NULL)
crypto/heimdal/lib/krb5/config_file.c
444
home = pw->pw_dir;
crypto/heimdal/lib/krb5/get_default_principal.c
79
struct passwd *pw = getpwuid(uid);
crypto/heimdal/lib/krb5/get_default_principal.c
80
if(pw != NULL)
crypto/heimdal/lib/krb5/get_default_principal.c
81
user = pw->pw_name;
crypto/heimdal/lib/krb5/kuserok.c
253
struct passwd pw;
crypto/heimdal/lib/krb5/kuserok.c
255
if(getpwnam_r(luser, &pw, pwbuf, sizeof(pwbuf), &pwd) != 0)
crypto/heimdal/lib/krb5/salt-des.c
50
krb5_DES_AFS3_CMU_string_to_key (krb5_data pw,
crypto/heimdal/lib/krb5/salt-des.c
58
char c = ((i < pw.length) ? ((char*)pw.data)[i] : 0) ^
crypto/heimdal/lib/krb5/salt-des.c
79
krb5_DES_AFS3_Transarc_string_to_key (krb5_data pw,
crypto/heimdal/lib/krb5/salt-des.c
89
memcpy(password, pw.data, min(pw.length, sizeof(password)));
crypto/heimdal/lib/krb5/salt-des.c
90
if(pw.length < sizeof(password)) {
crypto/heimdal/lib/krb5/salt-des.c
91
int len = min(cell.length, sizeof(password) - pw.length);
crypto/heimdal/lib/krb5/salt-des.c
94
memcpy(password + pw.length, cell.data, len);
crypto/heimdal/lib/krb5/salt-des.c
95
for (i = pw.length; i < pw.length + len; ++i)
crypto/heimdal/lib/krb5/salt-des.c
98
passlen = min(sizeof(password), pw.length + cell.length);
crypto/heimdal/lib/krb5/salt.c
162
krb5_data pw;
crypto/heimdal/lib/krb5/salt.c
163
pw.data = rk_UNCONST(password);
crypto/heimdal/lib/krb5/salt.c
164
pw.length = strlen(password);
crypto/heimdal/lib/krb5/salt.c
165
return krb5_string_to_key_data(context, enctype, pw, principal, key);
crypto/heimdal/lib/krb5/salt.c
227
krb5_data pw;
crypto/heimdal/lib/krb5/salt.c
228
pw.data = rk_UNCONST(password);
crypto/heimdal/lib/krb5/salt.c
229
pw.length = strlen(password);
crypto/heimdal/lib/krb5/salt.c
230
return krb5_string_to_key_data_salt(context, enctype, pw, salt, key);
crypto/heimdal/lib/krb5/salt.c
241
krb5_data pw;
crypto/heimdal/lib/krb5/salt.c
242
pw.data = rk_UNCONST(password);
crypto/heimdal/lib/krb5/salt.c
243
pw.length = strlen(password);
crypto/heimdal/lib/krb5/salt.c
245
pw, salt, opaque, key);
crypto/heimdal/lib/roken/verify.c
48
struct passwd *pw;
crypto/heimdal/lib/roken/verify.c
50
pw = k_getpwnam(user);
crypto/heimdal/lib/roken/verify.c
51
if(pw == NULL)
crypto/heimdal/lib/roken/verify.c
53
if(strlen(pw->pw_passwd) == 0 && strlen(password) == 0)
crypto/heimdal/lib/roken/verify.c
55
if(strcmp(crypt(password, pw->pw_passwd), pw->pw_passwd) == 0)
crypto/krb5/src/clients/kinit/kinit.c
50
struct passwd *pw;
crypto/krb5/src/clients/kinit/kinit.c
52
pw = getpwuid(getuid());
crypto/krb5/src/clients/kinit/kinit.c
53
return (pw != NULL) ? pw->pw_name : NULL;
crypto/krb5/src/clients/kpasswd/kpasswd.c
144
pwlen = sizeof(pw);
crypto/krb5/src/clients/kpasswd/kpasswd.c
145
ret = krb5_read_password(context, P1, P2, pw, &pwlen);
crypto/krb5/src/clients/kpasswd/kpasswd.c
152
ret = krb5_change_password(context, &creds, pw, &result_code,
crypto/krb5/src/clients/kpasswd/kpasswd.c
23
struct passwd *pw;
crypto/krb5/src/clients/kpasswd/kpasswd.c
26
pw = getpwuid(getuid());
crypto/krb5/src/clients/kpasswd/kpasswd.c
27
if (pw != NULL) {
crypto/krb5/src/clients/kpasswd/kpasswd.c
28
ret = krb5_parse_name(context, pw->pw_name, me);
crypto/krb5/src/clients/kpasswd/kpasswd.c
30
com_err(program_name, ret, _("when parsing name %s"), pw->pw_name);
crypto/krb5/src/clients/kpasswd/kpasswd.c
54
char pw[1024];
crypto/krb5/src/kadmin/cli/kadmin.c
295
struct passwd *pw;
crypto/krb5/src/kadmin/cli/kadmin.c
525
} else if ((pw = getpwuid(getuid()))) {
crypto/krb5/src/kadmin/cli/kadmin.c
526
if (asprintf(&princstr, "%s/admin@%s", pw->pw_name,
crypto/krb5/src/lib/crypto/builtin/des/des_int.h
148
char *mit_afs_crypt(const char *pw, const char *salt, char *iobuf);
crypto/krb5/src/lib/gssapi/krb5/import_name.c
134
struct passwd *pw;
crypto/krb5/src/lib/gssapi/krb5/import_name.c
223
if (k5_getpwuid_r(uid, &pwx, pwbuf, sizeof(pwbuf), &pw) == 0)
crypto/krb5/src/lib/gssapi/krb5/import_name.c
224
stringrep = pw->pw_name;
crypto/krb5/src/lib/gssapi/mechglue/gssd_pname_to_uid.c
201
struct passwd pw;
crypto/krb5/src/lib/gssapi/mechglue/gssd_pname_to_uid.c
213
code = k5_getpwnam_r(localuser, &pw, pwbuf, sizeof(pwbuf), &pwd);
crypto/krb5/src/lib/kadm5/clnt/client_principal.c
27
char *pw)
crypto/krb5/src/lib/kadm5/clnt/client_principal.c
37
arg.passwd = pw;
crypto/krb5/src/lib/kadm5/clnt/client_principal.c
67
char *pw)
crypto/krb5/src/lib/kadm5/clnt/client_principal.c
77
arg.passwd = pw;
crypto/krb5/src/lib/kadm5/srv/svr_principal.c
1095
osa_pw_hist_ent *pw)
crypto/krb5/src/lib/kadm5/srv/svr_principal.c
1201
adb->old_keys[knext] = *pw;
crypto/krb5/src/lib/krb5/krb/gic_pwd.c
25
krb5_data pw;
crypto/krb5/src/lib/krb5/krb/gic_pwd.c
381
krb5_data pw;
crypto/krb5/src/lib/krb5/krb/gic_pwd.c
388
pw = string2data((char *)password);
crypto/krb5/src/lib/krb5/krb/gic_pwd.c
389
gakpw.password = &pw;
crypto/krb5/src/lib/krb5/krb/gic_pwd.c
79
pw = make_data(pwbuf, sizeof(pwbuf));
crypto/krb5/src/lib/krb5/krb/gic_pwd.c
82
prompt.reply = &pw;
crypto/krb5/src/lib/krb5/krb/gic_pwd.c
92
ret = krb5int_copy_data_contents(context, &pw, &gp->storage);
crypto/krb5/src/lib/krb5/krb/gic_pwd.c
93
zap(pw.data, pw.length);
crypto/krb5/src/lib/krb5/os/expand_path.c
312
struct passwd *pw, pwx;
crypto/krb5/src/lib/krb5/os/expand_path.c
315
if (k5_getpwuid_r(euid, &pwx, pwbuf, sizeof(pwbuf), &pw) != 0) {
crypto/krb5/src/lib/krb5/os/expand_path.c
320
*str = strdup(pw->pw_name);
crypto/krb5/src/util/profile/prof_file.c
193
struct passwd *pw, pwx;
crypto/krb5/src/util/profile/prof_file.c
197
if (!k5_getpwuid_r(uid, &pwx, pwbuf, sizeof(pwbuf), &pw)
crypto/krb5/src/util/profile/prof_file.c
198
&& pw != NULL && pw->pw_dir[0] != 0)
crypto/krb5/src/util/profile/prof_file.c
199
home_env = pw->pw_dir;
crypto/openssh/audit-bsm.c
264
uid = the_authctxt->pw->pw_uid;
crypto/openssh/audit-bsm.c
265
gid = the_authctxt->pw->pw_gid;
crypto/openssh/audit-bsm.c
310
info.ai_auid = the_authctxt->pw->pw_uid;
crypto/openssh/auth-krb5.c
119
temporarily_use_uid(authctxt->pw);
crypto/openssh/auth-krb5.c
156
temporarily_use_uid(authctxt->pw);
crypto/openssh/auth-krb5.c
161
authctxt->pw->pw_name)) {
crypto/openssh/auth-krb5.c
85
platform_client = platform_krb5_get_principal_name(authctxt->pw->pw_name);
crypto/openssh/auth-krb5.c
86
client = platform_client ? platform_client : authctxt->pw->pw_name;
crypto/openssh/auth-krb5.c
88
temporarily_use_uid(authctxt->pw);
crypto/openssh/auth-pam.c
1009
(sshpam_authctxt->pw->pw_uid != 0 ||
crypto/openssh/auth-pam.c
1369
if (!authctxt->valid || (authctxt->pw->pw_uid == 0 &&
crypto/openssh/auth-pam.c
290
if (setreuid(sshpam_authctxt->pw->pw_uid, -1) == -1)
crypto/openssh/auth-pam.c
927
(sshpam_authctxt->pw->pw_uid == 0 &&
crypto/openssh/auth-passwd.c
106
HANDLE hToken = cygwin_logon_user(pw, password);
crypto/openssh/auth-passwd.c
173
as = auth_usercheck(authctxt->pw->pw_name, authctxt->style, "auth-ssh",
crypto/openssh/auth-passwd.c
195
struct passwd *pw = authctxt->pw;
crypto/openssh/auth-passwd.c
199
char *pw_password = authctxt->valid ? shadow_pw(pw) : pw->pw_passwd;
crypto/openssh/auth-passwd.c
80
struct passwd *pw = authctxt->pw;
crypto/openssh/auth-passwd.c
90
if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
crypto/openssh/auth-rhosts.c
191
auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname,
crypto/openssh/auth-rhosts.c
204
temporarily_use_uid(pw);
crypto/openssh/auth-rhosts.c
215
pw->pw_dir, rhosts_files[rhosts_file_index]);
crypto/openssh/auth-rhosts.c
239
if (pw->pw_uid == 0)
crypto/openssh/auth-rhosts.c
243
client_user, pw->pw_name)) {
crypto/openssh/auth-rhosts.c
249
client_user, pw->pw_name)) {
crypto/openssh/auth-rhosts.c
260
if (stat(pw->pw_dir, &st) == -1) {
crypto/openssh/auth-rhosts.c
262
"no home directory %.200s", pw->pw_name, pw->pw_dir);
crypto/openssh/auth-rhosts.c
264
"no home directory %.200s", pw->pw_name, pw->pw_dir);
crypto/openssh/auth-rhosts.c
268
((st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
crypto/openssh/auth-rhosts.c
271
"bad ownership or modes for home directory.", pw->pw_name);
crypto/openssh/auth-rhosts.c
273
"bad ownership or modes for home directory.", pw->pw_name);
crypto/openssh/auth-rhosts.c
277
temporarily_use_uid(pw);
crypto/openssh/auth-rhosts.c
284
pw->pw_dir, rhosts_files[rhosts_file_index]);
crypto/openssh/auth-rhosts.c
298
((st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
crypto/openssh/auth-rhosts.c
301
"bad modes for %.200s", pw->pw_name, path);
crypto/openssh/auth-rhosts.c
320
client_user, pw->pw_name)) {
crypto/openssh/auth-rhosts.c
327
client_user, pw->pw_name);
crypto/openssh/auth-shadow.c
91
const char *user = ctxt->pw->pw_name;
crypto/openssh/auth-sia.c
103
pw->pw_name, host);
crypto/openssh/auth-sia.c
107
pw->pw_name, host);
crypto/openssh/auth-sia.c
112
permanently_set_uid(pw);
crypto/openssh/auth-sia.c
84
session_setup_sia(struct passwd *pw, char *tty)
crypto/openssh/auth-sia.c
91
if (sia_ses_init(&ent, saved_argc, saved_argv, host, pw->pw_name,
crypto/openssh/auth-sia.c
95
if (sia_make_entity_pwd(pw, ent) != SIASUCCESS) {
crypto/openssh/auth.c
100
allowed_user(struct ssh *ssh, struct passwd * pw)
crypto/openssh/auth.c
108
if (!pw || !pw->pw_name)
crypto/openssh/auth.c
111
if (!options.use_pam && platform_locked_account(pw)) {
crypto/openssh/auth.c
113
pw->pw_name);
crypto/openssh/auth.c
123
char *shell = xstrdup((pw->pw_shell[0] == '\0') ?
crypto/openssh/auth.c
124
_PATH_BSHELL : pw->pw_shell); /* empty = /bin/sh */
crypto/openssh/auth.c
128
"does not exist", pw->pw_name, shell);
crypto/openssh/auth.c
135
"is not executable", pw->pw_name, shell);
crypto/openssh/auth.c
151
r = match_user(pw->pw_name, hostname, ipaddr,
crypto/openssh/auth.c
159
pw->pw_name, hostname);
crypto/openssh/auth.c
167
r = match_user(pw->pw_name, hostname, ipaddr,
crypto/openssh/auth.c
178
"not listed in AllowUsers", pw->pw_name, hostname);
crypto/openssh/auth.c
184
if (ga_init(pw->pw_name, pw->pw_gid) == 0) {
crypto/openssh/auth.c
186
"not in any group", pw->pw_name, hostname);
crypto/openssh/auth.c
197
pw->pw_name, hostname);
crypto/openssh/auth.c
210
"in AllowGroups", pw->pw_name, hostname);
crypto/openssh/auth.c
217
if (!sys_auth_allowed_user(pw, loginmsg))
crypto/openssh/auth.c
389
expand_authorized_keys(const char *filename, struct passwd *pw)
crypto/openssh/auth.c
395
(unsigned long long)pw->pw_uid);
crypto/openssh/auth.c
396
file = percent_expand(filename, "h", pw->pw_dir,
crypto/openssh/auth.c
397
"u", pw->pw_name, "U", uidstr, (char *)NULL);
crypto/openssh/auth.c
406
i = snprintf(ret, sizeof(ret), "%s/%s", pw->pw_dir, file);
crypto/openssh/auth.c
414
authorized_principals_file(struct passwd *pw)
crypto/openssh/auth.c
418
return expand_authorized_keys(options.authorized_principals_file, pw);
crypto/openssh/auth.c
423
check_key_in_hostfiles(struct passwd *pw, struct sshkey *key, const char *host,
crypto/openssh/auth.c
435
user_hostfile = tilde_expand_filename(userfile, pw->pw_uid);
crypto/openssh/auth.c
438
((st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
crypto/openssh/auth.c
442
pw->pw_name, user_hostfile);
crypto/openssh/auth.c
446
temporarily_use_uid(pw);
crypto/openssh/auth.c
479
struct passwd *pw;
crypto/openssh/auth.c
497
pw = getpwnam(user);
crypto/openssh/auth.c
502
if (pw == NULL) {
crypto/openssh/auth.c
515
if (!allowed_user(ssh, pw))
crypto/openssh/auth.c
518
if ((lc = login_getpwclass(pw)) == NULL) {
crypto/openssh/auth.c
527
pw->pw_name, from_host, from_ip);
crypto/openssh/auth.c
533
debug("LOGIN %.200s REFUSED (TIME)", pw->pw_name);
crypto/openssh/auth.c
538
if ((as = auth_open()) == NULL || auth_setpwd(as, pw) != 0 ||
crypto/openssh/auth.c
539
auth_approval(as, lc, pw->pw_name, "ssh") <= 0) {
crypto/openssh/auth.c
541
pw = NULL;
crypto/openssh/auth.c
547
if (pw != NULL)
crypto/openssh/auth.c
548
return (pwcopy(pw));
crypto/openssh/auth.h
195
char *expand_authorized_keys(const char *, struct passwd *pw);
crypto/openssh/auth.h
66
struct passwd *pw; /* set if 'valid' */
crypto/openssh/auth2-hostbased.c
149
if (mm_hostbased_key_allowed(ssh, authctxt->pw, cuser,
crypto/openssh/auth2-hostbased.c
170
hostbased_key_allowed(struct ssh *ssh, struct passwd *pw,
crypto/openssh/auth2-hostbased.c
193
if (auth_rhosts2(pw, cuser, chost, chost) == 0) {
crypto/openssh/auth2-hostbased.c
204
if (auth_rhosts2(pw, cuser, resolvedname, ipaddr) == 0) {
crypto/openssh/auth2-hostbased.c
221
host_status = check_key_in_hostfiles(pw, key, lookup,
crypto/openssh/auth2-hostbased.c
227
host_status = check_key_in_hostfiles(pw, key, lookup,
crypto/openssh/auth2-pubkey.c
228
if (mm_user_key_allowed(ssh, pw, key, 1, &authopts) &&
crypto/openssh/auth2-pubkey.c
290
if (mm_user_key_allowed(ssh, pw, key, 0, NULL)) {
crypto/openssh/auth2-pubkey.c
323
match_principals_file(struct passwd *pw, char *file,
crypto/openssh/auth2-pubkey.c
335
temporarily_use_uid(pw);
crypto/openssh/auth2-pubkey.c
350
temporarily_use_uid(pw);
crypto/openssh/auth2-pubkey.c
352
if ((f = auth_openprincipals(gl.gl_pathv[i], pw,
crypto/openssh/auth2-pubkey.c
517
user_cert_trusted_ca(struct passwd *pw, struct sshkey *key,
crypto/openssh/auth2-pubkey.c
549
if ((principals_file = authorized_principals_file(pw)) != NULL) {
crypto/openssh/auth2-pubkey.c
550
if (match_principals_file(pw, principals_file,
crypto/openssh/auth2-pubkey.c
555
if (!found_principal && match_principals_command(pw, key,
crypto/openssh/auth2-pubkey.c
568
use_authorized_principals ? NULL : pw->pw_name, &reason) != 0)
crypto/openssh/auth2-pubkey.c
576
if (auth_authorise_keyopts(pw, cert_opts, 0,
crypto/openssh/auth2-pubkey.c
585
if (auth_authorise_keyopts(pw, principals_opts, 0,
crypto/openssh/auth2-pubkey.c
624
user_key_allowed2(struct passwd *pw, struct sshkey *key,
crypto/openssh/auth2-pubkey.c
635
temporarily_use_uid(pw);
crypto/openssh/auth2-pubkey.c
638
if ((f = auth_openkeyfile(file, pw, options.strict_modes)) != NULL) {
crypto/openssh/auth2-pubkey.c
639
found_key = auth_check_authkeys_file(pw, f, file,
crypto/openssh/auth2-pubkey.c
789
user_key_allowed(struct ssh *ssh, struct passwd *pw, struct sshkey *key,
crypto/openssh/auth2-pubkey.c
821
options.authorized_keys_files[i], pw);
crypto/openssh/auth2-pubkey.c
822
temporarily_use_uid(pw);
crypto/openssh/auth2-pubkey.c
839
success = user_key_allowed2(pw, key, gl.gl_pathv[j],
crypto/openssh/auth2-pubkey.c
853
if ((success = user_cert_trusted_ca(pw, key, remote_ip, remote_host,
crypto/openssh/auth2-pubkey.c
859
if ((success = user_key_command_allowed2(pw, key, remote_ip,
crypto/openssh/auth2-pubkey.c
97
struct passwd *pw = authctxt->pw;
crypto/openssh/auth2-pubkeyfile.c
104
loc, pw->pw_name, remote_host, remote_ip,
crypto/openssh/auth2-pubkeyfile.c
128
"address (%.200s).", loc, pw->pw_name, remote_ip);
crypto/openssh/auth2-pubkeyfile.c
264
auth_check_authkey_line(struct passwd *pw, struct sshkey *key,
crypto/openssh/auth2-pubkeyfile.c
326
if (auth_authorise_keyopts(pw, keyopts,
crypto/openssh/auth2-pubkeyfile.c
349
if (auth_authorise_keyopts(pw, certopts, 0,
crypto/openssh/auth2-pubkeyfile.c
368
keyopts->cert_principals == NULL ? pw->pw_name : NULL,
crypto/openssh/auth2-pubkeyfile.c
406
auth_check_authkeys_file(struct passwd *pw, FILE *f, char *file,
crypto/openssh/auth2-pubkeyfile.c
432
if (auth_check_authkey_line(pw, key, cp,
crypto/openssh/auth2-pubkeyfile.c
442
auth_openfile(const char *file, struct passwd *pw, int strict_modes,
crypto/openssh/auth2-pubkeyfile.c
453
pw->pw_name, file_type, file, strerror(errno));
crypto/openssh/auth2-pubkeyfile.c
456
pw->pw_name, file_type, file, strerror(errno));
crypto/openssh/auth2-pubkeyfile.c
467
pw->pw_name, file_type, file);
crypto/openssh/auth2-pubkeyfile.c
477
safe_path_fd(fileno(f), file, pw, line, sizeof(line)) != 0) {
crypto/openssh/auth2-pubkeyfile.c
489
auth_openkeyfile(const char *file, struct passwd *pw, int strict_modes)
crypto/openssh/auth2-pubkeyfile.c
491
return auth_openfile(file, pw, strict_modes, 1, "authorized keys");
crypto/openssh/auth2-pubkeyfile.c
495
auth_openprincipals(const char *file, struct passwd *pw, int strict_modes)
crypto/openssh/auth2-pubkeyfile.c
497
return auth_openfile(file, pw, strict_modes, 0,
crypto/openssh/auth2-pubkeyfile.c
55
auth_authorise_keyopts(struct passwd *pw, struct sshauthopt *opts,
crypto/openssh/auth2.c
294
authctxt->pw = mm_getpwnamallow(ssh, user);
crypto/openssh/auth2.c
296
if (authctxt->pw && strcmp(service, "ssh-connection")==0) {
crypto/openssh/auth2.c
302
authctxt->pw = fakepw();
crypto/openssh/auth2.c
384
if (authenticated && authctxt->pw->pw_uid == 0 &&
crypto/openssh/loginrec.c
291
struct passwd *pw;
crypto/openssh/loginrec.c
301
pw = getpwuid(uid);
crypto/openssh/loginrec.c
302
if (pw == NULL)
crypto/openssh/loginrec.c
306
if (strlcpy(li->username, pw->pw_name, sizeof(li->username)) >=
crypto/openssh/loginrec.c
309
(unsigned long)strlen(pw->pw_name),
crypto/openssh/loginrec.c
362
struct passwd *pw;
crypto/openssh/loginrec.c
374
pw = getpwnam(li->username);
crypto/openssh/loginrec.c
375
if (pw == NULL) {
crypto/openssh/loginrec.c
379
li->uid = pw->pw_uid;
crypto/openssh/logintest.c
100
pw = getpwuid(getuid());
crypto/openssh/logintest.c
101
strlcpy(username, pw->pw_name, sizeof(username));
crypto/openssh/logintest.c
87
struct passwd *pw;
crypto/openssh/misc.c
1203
struct passwd *pw;
crypto/openssh/misc.c
1235
if ((pw = getpwnam(user)) == NULL) {
crypto/openssh/misc.c
1239
} else if ((pw = getpwuid(uid)) == NULL) {
crypto/openssh/misc.c
1245
slash = (len = strlen(pw->pw_dir)) == 0 || pw->pw_dir[len - 1] != '/';
crypto/openssh/misc.c
1247
if ((r = xasprintf(&s, "%s%s%s", pw->pw_dir,
crypto/openssh/misc.c
2318
safe_path_fd(int fd, const char *file, struct passwd *pw,
crypto/openssh/misc.c
2329
return safe_path(file, &st, pw->pw_dir, pw->pw_uid, err, errlen);
crypto/openssh/misc.c
2761
struct passwd *pw, privdrop_fn *drop_privs, privrestore_fn *restore_privs)
crypto/openssh/misc.c
2772
if (drop_privs != NULL && (pw == NULL || restore_privs == NULL)) {
crypto/openssh/misc.c
2776
if (pw == NULL && (pw = getpwuid(getuid())) == NULL) {
crypto/openssh/misc.c
2784
tag, command, pw->pw_name, flags);
crypto/openssh/misc.c
2806
drop_privs(pw);
crypto/openssh/misc.c
2840
child_set_env(&env, &nenv, "USER", pw->pw_name);
crypto/openssh/misc.c
2841
child_set_env(&env, &nenv, "LOGNAME", pw->pw_name);
crypto/openssh/misc.c
2842
child_set_env(&env, &nenv, "HOME", pw->pw_dir);
crypto/openssh/misc.c
2873
initgroups(pw->pw_name, pw->pw_gid) == -1) {
crypto/openssh/misc.c
2875
pw->pw_name, (u_int)pw->pw_gid, strerror(errno));
crypto/openssh/misc.c
2878
if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1) {
crypto/openssh/misc.c
2879
error("%s: setresgid %u: %s", tag, (u_int)pw->pw_gid,
crypto/openssh/misc.c
2883
if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) == -1) {
crypto/openssh/misc.c
2884
error("%s: setresuid %u: %s", tag, (u_int)pw->pw_uid,
crypto/openssh/misc.c
505
pwcopy(struct passwd *pw)
crypto/openssh/misc.c
509
copy->pw_name = xstrdup(pw->pw_name);
crypto/openssh/misc.c
510
copy->pw_passwd = xstrdup(pw->pw_passwd == NULL ? "*" : pw->pw_passwd);
crypto/openssh/misc.c
512
copy->pw_gecos = xstrdup(pw->pw_gecos);
crypto/openssh/misc.c
514
copy->pw_uid = pw->pw_uid;
crypto/openssh/misc.c
515
copy->pw_gid = pw->pw_gid;
crypto/openssh/misc.c
517
copy->pw_expire = pw->pw_expire;
crypto/openssh/misc.c
520
copy->pw_change = pw->pw_change;
crypto/openssh/misc.c
523
copy->pw_class = xstrdup(pw->pw_class);
crypto/openssh/misc.c
525
copy->pw_dir = xstrdup(pw->pw_dir);
crypto/openssh/misc.c
526
copy->pw_shell = xstrdup(pw->pw_shell);
crypto/openssh/monitor.c
1302
allowed = user_key_allowed(ssh, authctxt->pw, key,
crypto/openssh/monitor.c
1314
allowed = hostbased_key_allowed(ssh, authctxt->pw,
crypto/openssh/monitor.c
1633
mm_record_login(struct ssh *ssh, Session *s, struct passwd *pw)
crypto/openssh/monitor.c
1652
record_login(s->pid, s->tty, pw->pw_name, pw->pw_uid,
crypto/openssh/monitor.c
1682
s->pw = authctxt->pw;
crypto/openssh/monitor.c
1687
pty_setowner(authctxt->pw, s->tty);
crypto/openssh/monitor.c
1697
mm_record_login(ssh, s, authctxt->pw);
crypto/openssh/monitor.c
328
if (authctxt->pw->pw_uid == 0 &&
crypto/openssh/monitor.c
648
postauth = (authctxt && authctxt->pw && authctxt->authenticated);
crypto/openssh/monitor.c
863
authctxt->pw = fakepw();
crypto/openssh/monitor.c
868
authctxt->pw = pwent;
crypto/openssh/monitor_wrap.c
329
if (len != sizeof(pw->id)) \
crypto/openssh/monitor_wrap.c
331
memcpy(&pw->id, p, len); \
crypto/openssh/monitor_wrap.c
338
struct passwd *pw;
crypto/openssh/monitor_wrap.c
359
pw = NULL;
crypto/openssh/monitor_wrap.c
364
pw = xcalloc(sizeof(*pw), 1);
crypto/openssh/monitor_wrap.c
373
if ((r = sshbuf_get_cstring(m, &pw->pw_name, NULL)) != 0 ||
crypto/openssh/monitor_wrap.c
374
(r = sshbuf_get_cstring(m, &pw->pw_passwd, NULL)) != 0 ||
crypto/openssh/monitor_wrap.c
376
(r = sshbuf_get_cstring(m, &pw->pw_gecos, NULL)) != 0 ||
crypto/openssh/monitor_wrap.c
379
(r = sshbuf_get_cstring(m, &pw->pw_class, NULL)) != 0 ||
crypto/openssh/monitor_wrap.c
381
(r = sshbuf_get_cstring(m, &pw->pw_dir, NULL)) != 0 ||
crypto/openssh/monitor_wrap.c
382
(r = sshbuf_get_cstring(m, &pw->pw_shell, NULL)) != 0)
crypto/openssh/monitor_wrap.c
393
return (pw);
crypto/openssh/monitor_wrap.c
484
mm_user_key_allowed(struct ssh *ssh, struct passwd *pw, struct sshkey *key,
crypto/openssh/monitor_wrap.c
492
mm_hostbased_key_allowed(struct ssh *ssh, struct passwd *pw,
crypto/openssh/openbsd-compat/openbsd-compat.h
358
char *shadow_pw(struct passwd *pw);
crypto/openssh/openbsd-compat/openbsd-compat.h
61
# define login_getpwclass(pw) login_getclass(pw->pw_class)
crypto/openssh/openbsd-compat/port-aix.c
179
char *authmsg = NULL, *msg = NULL, *name = ctxt->pw->pw_name;
crypto/openssh/openbsd-compat/port-aix.c
241
sys_auth_allowed_user(struct passwd *pw, struct sshbuf *loginmsg)
crypto/openssh/openbsd-compat/port-aix.c
252
if (pw->pw_uid == 0 || geteuid() != 0) {
crypto/openssh/openbsd-compat/port-aix.c
257
result = loginrestrictions(pw->pw_name, S_RLOGIN, NULL, &msg);
crypto/openssh/openbsd-compat/port-aix.c
277
logit("Login restricted for %s: %.100s", pw->pw_name, msg);
crypto/openssh/openbsd-compat/port-aix.c
76
aix_usrinfo(struct passwd *pw)
crypto/openssh/openbsd-compat/port-aix.c
82
len = sizeof("LOGNAME= NAME= ") + (2 * strlen(pw->pw_name));
crypto/openssh/openbsd-compat/port-aix.c
85
i = snprintf(cp, len, "LOGNAME=%s%cNAME=%s%c", pw->pw_name, '\0',
crypto/openssh/openbsd-compat/port-aix.c
86
pw->pw_name, '\0');
crypto/openssh/openbsd-compat/port-irix.c
49
irix_setusercontext(struct passwd *pw)
crypto/openssh/openbsd-compat/port-irix.c
61
jid = jlimit_startjob(pw->pw_name, pw->pw_uid, "interactive");
crypto/openssh/openbsd-compat/port-irix.c
74
if ((projid = getdfltprojuser(pw->pw_name)) == -1) {
crypto/openssh/openbsd-compat/port-irix.c
80
(int)projid, pw->pw_name, strerror(errno));
crypto/openssh/openbsd-compat/port-irix.c
84
debug("Setting sat id to %d", (int) pw->pw_uid);
crypto/openssh/openbsd-compat/port-irix.c
85
if (satsetid(pw->pw_uid))
crypto/openssh/openbsd-compat/port-irix.h
33
void irix_setusercontext(struct passwd *pw);
crypto/openssh/openbsd-compat/port-solaris.c
207
solaris_set_default_project(struct passwd *pw)
crypto/openssh/openbsd-compat/port-solaris.c
214
if ((defaultproject = getdefaultproj(pw->pw_name, &tempproject, &buf,
crypto/openssh/openbsd-compat/port-solaris.c
217
if (setproject(defaultproject->pj_name, pw->pw_name,
crypto/openssh/openbsd-compat/port-solaris.c
223
debug("getdefaultproj(%s): %s", pw->pw_name, strerror(errno));
crypto/openssh/openbsd-compat/port-uw.c
136
get_iaf_password(struct passwd *pw)
crypto/openssh/openbsd-compat/port-uw.c
141
if (!ia_openinfo(pw->pw_name,&uinfo)) {
crypto/openssh/openbsd-compat/port-uw.c
56
struct passwd *pw = authctxt->pw;
crypto/openssh/openbsd-compat/port-uw.c
61
char *pw_password = authctxt->valid ? shadow_pw(pw) : pw->pw_passwd;
crypto/openssh/openbsd-compat/port-uw.c
78
if (!nischeck(pw->pw_name)) {
crypto/openssh/openbsd-compat/port-uw.h
28
char * get_iaf_password(struct passwd *pw);
crypto/openssh/openbsd-compat/pwcache.c
56
struct passwd *pw;
crypto/openssh/openbsd-compat/pwcache.c
67
if ((pw = getpwuid(uid)) == NULL) {
crypto/openssh/openbsd-compat/pwcache.c
75
cp->name = strdup(pw ? pw->pw_name : nbuf);
crypto/openssh/openbsd-compat/xcrypt.c
129
shadow_pw(struct passwd *pw)
crypto/openssh/openbsd-compat/xcrypt.c
131
char *pw_password = pw->pw_passwd;
crypto/openssh/openbsd-compat/xcrypt.c
134
struct spwd *spw = getspnam(pw->pw_name);
crypto/openssh/openbsd-compat/xcrypt.c
141
return(get_iaf_password(pw));
crypto/openssh/openbsd-compat/xcrypt.c
146
if (issecure() && (spw = getpwanam(pw->pw_name)) != NULL)
crypto/openssh/openbsd-compat/xcrypt.c
149
struct pr_passwd *spw = getprpwnam(pw->pw_name);
crypto/openssh/openbsd-compat/xcrypt.c
73
struct passwd *pw;
crypto/openssh/openbsd-compat/xcrypt.c
82
while ((pw = getpwent()) != NULL) {
crypto/openssh/openbsd-compat/xcrypt.c
83
if ((passwd = shadow_pw(pw)) == NULL)
crypto/openssh/platform.c
102
platform_setusercontext_post_groups(struct passwd *pw)
crypto/openssh/platform.c
117
irix_setusercontext(pw);
crypto/openssh/platform.c
121
aix_usrinfo(pw);
crypto/openssh/platform.c
138
if (setpcred(pw->pw_name, creds) == -1)
crypto/openssh/platform.c
143
ssh_selinux_setup_exec_context(pw->pw_name);
crypto/openssh/platform.c
159
platform_locked_account(struct passwd *pw)
crypto/openssh/platform.c
162
char *passwd = pw->pw_passwd;
crypto/openssh/platform.c
169
spw = getspnam(pw->pw_name);
crypto/openssh/platform.c
177
iaf_passwd = passwd = get_iaf_password(pw);
crypto/openssh/platform.c
54
platform_setusercontext(struct passwd *pw)
crypto/openssh/platform.c
68
solaris_set_default_project(pw);
crypto/openssh/platform.c
91
if (getluid() == -1 && setluid(pw->pw_uid) == -1)
crypto/openssh/readconf.c
1125
process_config_line(Options *options, struct passwd *pw, const char *host,
crypto/openssh/readconf.c
1129
return process_config_line_depth(options, pw, host, original_host,
crypto/openssh/readconf.c
1135
process_config_line_depth(Options *options, struct passwd *pw, const char *host,
crypto/openssh/readconf.c
136
static int read_config_file_depth(const char *filename, struct passwd *pw,
crypto/openssh/readconf.c
139
static int process_config_line_depth(Options *options, struct passwd *pw,
crypto/openssh/readconf.c
1874
value = match_cfg_line(options, str, &ac, &av, pw, host,
crypto/openssh/readconf.c
2081
options, pw, host, original_host,
crypto/openssh/readconf.c
2128
pw, host, original_host, remote_command,
crypto/openssh/readconf.c
2551
read_config_file(const char *filename, struct passwd *pw, const char *host,
crypto/openssh/readconf.c
2557
return read_config_file_depth(filename, pw, host, original_host,
crypto/openssh/readconf.c
2563
read_config_file_depth(const char *filename, struct passwd *pw,
crypto/openssh/readconf.c
2604
if (process_config_line_depth(options, pw, host, original_host,
crypto/openssh/readconf.c
657
struct passwd *pw, const char *host_arg, const char *original_host,
crypto/openssh/readconf.c
666
ruser = options->user == NULL ? pw->pw_name : options->user;
crypto/openssh/readconf.c
684
(unsigned long long)pw->pw_uid);
crypto/openssh/readconf.c
692
"d", pw->pw_dir,
crypto/openssh/readconf.c
699
"u", pw->pw_name,
crypto/openssh/readconf.c
713
struct passwd *pw, const char *host_arg, const char *original_host,
crypto/openssh/readconf.c
725
ruser = options->user == NULL ? pw->pw_name : options->user;
crypto/openssh/readconf.c
835
criteria = xstrdup(pw->pw_name);
crypto/openssh/readconf.c
836
r = match_pattern_list(pw->pw_name, arg, 0) == 1;
crypto/openssh/readconf.c
884
options, pw, host_arg, original_host,
crypto/openssh/regress/misc/fuzz-harness/authkeys_fuzz.cc
34
struct passwd *pw = getpwuid(getuid());
crypto/openssh/regress/misc/fuzz-harness/authkeys_fuzz.cc
50
if (cp == NULL || pw == NULL || key == NULL || cert == NULL)
crypto/openssh/regress/misc/fuzz-harness/authkeys_fuzz.cc
64
(void) auth_check_authkey_line(pw, key, tmp, "127.0.0.1", "localhost",
crypto/openssh/regress/misc/fuzz-harness/authkeys_fuzz.cc
72
(void) auth_check_authkey_line(pw, cert, tmp, "127.0.0.1", "localhost",
crypto/openssh/regress/netcat.c
1461
static char pw[256];
crypto/openssh/regress/netcat.c
1465
if (readpassphrase(prompt, pw, sizeof(pw), RPP_REQUIRE_TTY) == NULL)
crypto/openssh/regress/netcat.c
1467
return (pw);
crypto/openssh/regress/unittests/sshkey/test_file.c
188
(const char *)sshbuf_ptr(pw), &k2, NULL), 0);
crypto/openssh/regress/unittests/sshkey/test_file.c
207
(const char *)sshbuf_ptr(pw), &k2, NULL), 0);
crypto/openssh/regress/unittests/sshkey/test_file.c
290
(const char *)sshbuf_ptr(pw), &k2, NULL), 0);
crypto/openssh/regress/unittests/sshkey/test_file.c
309
(const char *)sshbuf_ptr(pw), &k2, NULL), 0);
crypto/openssh/regress/unittests/sshkey/test_file.c
376
(const char *)sshbuf_ptr(pw), &k2, NULL), 0);
crypto/openssh/regress/unittests/sshkey/test_file.c
442
(const char *)sshbuf_ptr(pw), &k2, NULL), 0);
crypto/openssh/regress/unittests/sshkey/test_file.c
47
struct sshbuf *buf, *pw;
crypto/openssh/regress/unittests/sshkey/test_file.c
508
(const char *)sshbuf_ptr(pw), &k2, NULL), 0);
crypto/openssh/regress/unittests/sshkey/test_file.c
54
pw = load_text_file("pw");
crypto/openssh/regress/unittests/sshkey/test_file.c
562
sshbuf_free(pw);
crypto/openssh/regress/unittests/sshkey/test_file.c
78
(const char *)sshbuf_ptr(pw), &k2, NULL), 0);
crypto/openssh/regress/unittests/sshkey/test_file.c
97
(const char *)sshbuf_ptr(pw), &k2, NULL), 0);
crypto/openssh/servconf.c
1013
struct passwd *pw;
crypto/openssh/servconf.c
1018
if ((pw = getpwnam(user)) == NULL) {
crypto/openssh/servconf.c
1021
} else if (ga_init(pw->pw_name, pw->pw_gid) == 0) {
crypto/openssh/serverloop.c
446
struct passwd *pw = the_authctxt->pw;
crypto/openssh/serverloop.c
449
if (pw == NULL || !the_authctxt->valid)
crypto/openssh/serverloop.c
737
struct passwd *pw = the_authctxt->pw;
crypto/openssh/serverloop.c
741
if (pw == NULL || !the_authctxt->valid)
crypto/openssh/session.c
1018
child_set_env(&env, &envsize, "USER", pw->pw_name);
crypto/openssh/session.c
1019
child_set_env(&env, &envsize, "LOGNAME", pw->pw_name);
crypto/openssh/session.c
1021
child_set_env(&env, &envsize, "LOGIN", pw->pw_name);
crypto/openssh/session.c
1023
child_set_env(&env, &envsize, "HOME", pw->pw_dir);
crypto/openssh/session.c
1024
snprintf(buf, sizeof buf, "%.200s/%.50s", _PATH_MAILDIR, pw->pw_name);
crypto/openssh/session.c
1038
(void)setusercontext(lc, pw, pw->pw_uid, LOGIN_SETENV|LOGIN_SETPATH);
crypto/openssh/session.c
1057
read_etc_default_login(&env, &envsize, pw->pw_uid);
crypto/openssh/session.c
1062
s->pw->pw_uid == 0 ? SUPERUSER_PATH : _PATH_STDPATH);
crypto/openssh/session.c
1128
pw->pw_dir, _PATH_SSH_USER_DIR);
crypto/openssh/session.c
1216
xasprintf(&user_rc, "%s/%s", s->pw->pw_dir, _PATH_SSH_USER_RC);
crypto/openssh/session.c
1280
do_nologin(struct passwd *pw)
crypto/openssh/session.c
1288
if (login_getcapbool(lc, "ignorenologin", 0) || pw->pw_uid == 0)
crypto/openssh/session.c
1292
if (pw->pw_uid == 0)
crypto/openssh/session.c
1300
logit("User %.100s not allowed because %s exists", pw->pw_name, nl);
crypto/openssh/session.c
1365
do_setusercontext(struct passwd *pw)
crypto/openssh/session.c
1369
platform_setusercontext(pw);
crypto/openssh/session.c
1373
if (setusercontext(lc, pw, pw->pw_uid,
crypto/openssh/session.c
1379
if (setlogin(pw->pw_name) < 0)
crypto/openssh/session.c
1381
if (setgid(pw->pw_gid) < 0) {
crypto/openssh/session.c
1386
if (initgroups(pw->pw_name, pw->pw_gid) < 0) {
crypto/openssh/session.c
1393
platform_setusercontext_post_groups(pw);
crypto/openssh/session.c
1398
pw->pw_uid);
crypto/openssh/session.c
1400
(unsigned long long)pw->pw_uid);
crypto/openssh/session.c
1401
chroot_path = percent_expand(tmp, "h", pw->pw_dir,
crypto/openssh/session.c
1402
"u", pw->pw_name, "U", uidstr, (char *)NULL);
crypto/openssh/session.c
1403
safely_chroot(chroot_path, pw->pw_uid);
crypto/openssh/session.c
1413
if (setusercontext(lc, pw, pw->pw_uid, LOGIN_SETUSER) < 0) {
crypto/openssh/session.c
1421
(void) setusercontext(lc, pw, pw->pw_uid, LOGIN_SETUMASK);
crypto/openssh/session.c
1432
if (!in_chroot && set_id(pw->pw_name) != 0)
crypto/openssh/session.c
1433
fatal("set_id(%s) Failed", pw->pw_name);
crypto/openssh/session.c
1436
permanently_set_uid(pw);
crypto/openssh/session.c
1443
if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid)
crypto/openssh/session.c
1444
fatal("Failed to set uids to %u.", (u_int) pw->pw_uid);
crypto/openssh/session.c
1459
execl(_PATH_PASSWD_PROG, "passwd", s->pw->pw_name,
crypto/openssh/session.c
1526
struct passwd *pw = s->pw;
crypto/openssh/session.c
1536
do_setusercontext(pw);
crypto/openssh/session.c
1547
session_setup_sia(pw, s->ttyfd == -1 ? NULL : s->tty);
crypto/openssh/session.c
1553
do_nologin(pw);
crypto/openssh/session.c
1554
do_setusercontext(pw);
crypto/openssh/session.c
1576
shell = (pw->pw_shell[0] == '\0') ? _PATH_BSHELL : pw->pw_shell;
crypto/openssh/session.c
1620
if (k_afs_cell_of_file(pw->pw_dir, cell, sizeof(cell)) == 0)
crypto/openssh/session.c
1625
s->authctxt->krb5_fwd_ccache, NULL, NULL, pw->pw_dir);
crypto/openssh/session.c
1630
if (chdir(pw->pw_dir) == -1) {
crypto/openssh/session.c
1637
"directory %s: %s\n", pw->pw_dir,
crypto/openssh/session.c
1662
setproctitle("%s@%s", s->pw->pw_name, INTERNAL_SFTP_NAME);
crypto/openssh/session.c
1673
exit(sftp_server_main(i, argv, s->pw));
crypto/openssh/session.c
1811
s->pw = authctxt->pw;
crypto/openssh/session.c
1812
if (s->pw == NULL || !authctxt->valid)
crypto/openssh/session.c
183
auth_sock_cleanup_proc(struct passwd *pw)
crypto/openssh/session.c
186
temporarily_use_uid(pw);
crypto/openssh/session.c
195
auth_input_request_forwarding(struct ssh *ssh, struct passwd * pw)
crypto/openssh/session.c
1967
s->pw->pw_name);
crypto/openssh/session.c
1994
"subsystem not found", s->subsys, s->pw->pw_name);
crypto/openssh/session.c
206
temporarily_use_uid(pw);
crypto/openssh/session.c
2167
temporarily_use_uid(s->pw);
crypto/openssh/session.c
2201
return auth_input_request_forwarding(ssh, s->pw);
crypto/openssh/session.c
2283
record_logout(s->pid, s->tty, s->pw->pw_name);
crypto/openssh/session.c
2442
s->pw->pw_name,
crypto/openssh/session.c
245
temporarily_use_uid(pw);
crypto/openssh/session.c
2570
if (s->pw == NULL)
crypto/openssh/session.c
2573
setproctitle("%s@%s", s->pw->pw_name, session_tty_list());
crypto/openssh/session.c
2699
auth_sock_cleanup_proc(authctxt->pw);
crypto/openssh/session.c
2703
temporarily_use_uid(authctxt->pw);
crypto/openssh/session.c
271
prepare_auth_info_file(struct passwd *pw, struct sshbuf *info)
crypto/openssh/session.c
278
temporarily_use_uid(pw);
crypto/openssh/session.c
346
setproctitle("%s", authctxt->pw->pw_name);
crypto/openssh/session.c
370
prepare_auth_info_file(authctxt->pw, authctxt->session_info);
crypto/openssh/session.c
713
s->pw->pw_name,
crypto/openssh/session.c
722
char *shell = s->pw->pw_shell;
crypto/openssh/session.c
807
struct passwd *pw = s->pw;
crypto/openssh/session.c
813
snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir);
crypto/openssh/session.c
977
struct passwd *pw = s->pw;
crypto/openssh/session.h
35
struct passwd *pw;
crypto/openssh/sftp-server.c
1583
if (tilde_expand(path, pw->pw_uid, &npath) != 0) {
crypto/openssh/sftp-server.c
1710
user_pw = pw;
crypto/openssh/sftp-server.c
1820
client_addr, pw->pw_name);
crypto/openssh/sftp-server.c
1881
if (pw != NULL && client_addr != NULL) {
crypto/openssh/sftp-server.c
1884
pw->pw_name, client_addr);
crypto/openssh/sftp-server.c
1918
pw = pwcopy(user_pw);
crypto/openssh/sftp-server.c
1960
(unsigned long long)pw->pw_uid);
crypto/openssh/sftp-server.c
2014
pw->pw_name, client_addr);
crypto/openssh/sftp-server.c
69
static struct passwd *pw = NULL;
crypto/openssh/ssh-add.c
1018
struct passwd *pw;
crypto/openssh/ssh-add.c
1022
if ((pw = getpwuid(getuid())) == NULL) {
crypto/openssh/ssh-add.c
1030
snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir,
crypto/openssh/ssh-keygen.c
1085
do_gen_all_hostkeys(struct passwd *pw)
crypto/openssh/ssh-keygen.c
1161
snprintf(comment, sizeof comment, "%s@%s", pw->pw_name,
crypto/openssh/ssh-keygen.c
1338
do_known_hosts(struct passwd *pw, const char *name, int find_host,
crypto/openssh/ssh-keygen.c
1348
cp = tilde_expand_filename(_PATH_SSH_USER_HOSTFILE, pw->pw_uid);
crypto/openssh/ssh-keygen.c
1445
do_change_passphrase(struct passwd *pw)
crypto/openssh/ssh-keygen.c
1454
ask_filename(pw, "Enter file in which the key is");
crypto/openssh/ssh-keygen.c
1524
do_print_resource_record(struct passwd *pw, char *fname, char *hname,
crypto/openssh/ssh-keygen.c
1561
do_change_comment(struct passwd *pw, const char *identity_comment)
crypto/openssh/ssh-keygen.c
1570
ask_filename(pw, "Enter file in which the key is");
crypto/openssh/ssh-keygen.c
1795
do_ca_sign(struct passwd *pw, const char *ca_key_path, int prefer_agent,
crypto/openssh/ssh-keygen.c
1811
tmp = tilde_expand_filename(ca_key_path, pw->pw_uid);
crypto/openssh/ssh-keygen.c
1879
tmp = tilde_expand_filename(argv[i], pw->pw_uid);
crypto/openssh/ssh-keygen.c
2202
do_show_cert(struct passwd *pw)
crypto/openssh/ssh-keygen.c
2214
ask_filename(pw, "Enter file in which the key is");
crypto/openssh/ssh-keygen.c
2309
update_krl_from_file(struct passwd *pw, const char *file, int wild_ca,
crypto/openssh/ssh-keygen.c
2321
path = tilde_expand_filename(file, pw->pw_uid);
crypto/openssh/ssh-keygen.c
2463
do_gen_krl(struct passwd *pw, int updating, const char *ca_key_path,
crypto/openssh/ssh-keygen.c
2487
tmp = tilde_expand_filename(ca_key_path, pw->pw_uid);
crypto/openssh/ssh-keygen.c
2505
update_krl_from_file(pw, argv[i], wild_ca, ca, krl);
crypto/openssh/ssh-keygen.c
2519
do_check_krl(struct passwd *pw, int print_krl, int argc, char **argv)
crypto/openssh/ssh-keygen.c
256
ask_filename(struct passwd *pw, const char *prompt)
crypto/openssh/ssh-keygen.c
302
"%s/%s", pw->pw_dir, name);
crypto/openssh/ssh-keygen.c
3384
struct passwd *pw;
crypto/openssh/ssh-keygen.c
3419
pw = getpwuid(getuid());
crypto/openssh/ssh-keygen.c
3420
if (!pw)
crypto/openssh/ssh-keygen.c
3422
pw = pwcopy(pw);
crypto/openssh/ssh-keygen.c
347
do_convert_to_ssh2(struct passwd *pw, struct sshkey *k)
crypto/openssh/ssh-keygen.c
364
pw->pw_name, hostname);
crypto/openssh/ssh-keygen.c
3742
do_gen_krl(pw, update_krl, ca_key_path,
crypto/openssh/ssh-keygen.c
3747
do_check_krl(pw, print_fingerprint, argc, argv);
crypto/openssh/ssh-keygen.c
3755
do_ca_sign(pw, ca_key_path, prefer_agent,
crypto/openssh/ssh-keygen.c
3759
do_show_cert(pw);
crypto/openssh/ssh-keygen.c
3761
do_known_hosts(pw, rr_hostname, find_host,
crypto/openssh/ssh-keygen.c
3765
do_download(pw);
crypto/openssh/ssh-keygen.c
3778
do_fingerprint(pw);
crypto/openssh/ssh-keygen.c
3780
do_change_passphrase(pw);
crypto/openssh/ssh-keygen.c
3782
do_change_comment(pw, identity_comment);
crypto/openssh/ssh-keygen.c
3785
do_convert_to(pw);
crypto/openssh/ssh-keygen.c
3787
do_convert_from(pw);
crypto/openssh/ssh-keygen.c
3793
do_print_public(pw);
crypto/openssh/ssh-keygen.c
3798
n = do_print_resource_record(pw, identity_file,
crypto/openssh/ssh-keygen.c
3805
n += do_print_resource_record(pw,
crypto/openssh/ssh-keygen.c
3809
n += do_print_resource_record(pw,
crypto/openssh/ssh-keygen.c
3813
n += do_print_resource_record(pw,
crypto/openssh/ssh-keygen.c
3816
n += do_print_resource_record(pw,
crypto/openssh/ssh-keygen.c
3819
n += do_print_resource_record(pw,
crypto/openssh/ssh-keygen.c
3844
do_gen_all_hostkeys(pw);
crypto/openssh/ssh-keygen.c
3943
ask_filename(pw, "Enter file in which to save the key");
crypto/openssh/ssh-keygen.c
3958
snprintf(comment, sizeof comment, "%s@%s", pw->pw_name, hostname);
crypto/openssh/ssh-keygen.c
433
do_convert_to(struct passwd *pw)
crypto/openssh/ssh-keygen.c
440
ask_filename(pw, "Enter file in which the key is");
crypto/openssh/ssh-keygen.c
447
do_convert_to_ssh2(pw, k);
crypto/openssh/ssh-keygen.c
665
do_convert_from_ssh2(struct passwd *pw, struct sshkey **k, int *private)
crypto/openssh/ssh-keygen.c
788
do_convert_from(struct passwd *pw)
crypto/openssh/ssh-keygen.c
795
ask_filename(pw, "Enter file in which the key is");
crypto/openssh/ssh-keygen.c
801
do_convert_from_ssh2(pw, &k, &private);
crypto/openssh/ssh-keygen.c
851
do_print_public(struct passwd *pw)
crypto/openssh/ssh-keygen.c
859
ask_filename(pw, "Enter file in which the key is");
crypto/openssh/ssh-keygen.c
878
do_download(struct passwd *pw)
crypto/openssh/ssh-keygen.c
988
do_fingerprint(struct passwd *pw)
crypto/openssh/ssh-keygen.c
999
ask_filename(pw, "Enter file in which the key is");
crypto/openssh/ssh-keysign.c
147
if (strcmp(pw->pw_name, luser) != 0)
crypto/openssh/ssh-keysign.c
182
struct passwd *pw;
crypto/openssh/ssh-keysign.c
211
if ((pw = getpwuid(getuid())) == NULL)
crypto/openssh/ssh-keysign.c
213
pw = pwcopy(pw);
crypto/openssh/ssh-keysign.c
215
permanently_set_uid(pw);
crypto/openssh/ssh-keysign.c
225
(void)read_config_file(_PATH_HOST_CONFIG_FILE, pw, "", "", "",
crypto/openssh/ssh-keysign.c
278
if (valid_request(pw, host, &key, &pkalg, data, dlen) < 0)
crypto/openssh/ssh-keysign.c
65
valid_request(struct passwd *pw, char *host, struct sshkey **ret, char **pkalgp,
crypto/openssh/ssh.c
1084
if (process_config_line(&options, pw,
crypto/openssh/ssh.c
1221
process_config_files(options.host_arg, pw, 0, &want_final_pass);
crypto/openssh/ssh.c
1290
process_config_files(options.host_arg, pw, 1, NULL);
crypto/openssh/ssh.c
1305
options.user = xstrdup(pw->pw_name);
crypto/openssh/ssh.c
1441
(unsigned long long)pw->pw_uid);
crypto/openssh/ssh.c
1446
cinfo->homedir = xstrdup(pw->pw_dir);
crypto/openssh/ssh.c
1447
cinfo->locuser = xstrdup(pw->pw_name);
crypto/openssh/ssh.c
1838
options.port, pw, timeout_ms, cinfo);
crypto/openssh/ssh.c
562
process_config_files(const char *host_name, struct passwd *pw,
crypto/openssh/ssh.c
572
!read_config_file(config, pw, host, host_name, cmd,
crypto/openssh/ssh.c
579
r = snprintf(buf, sizeof buf, "%s/%s", pw->pw_dir,
crypto/openssh/ssh.c
582
(void)read_config_file(buf, pw, host, host_name, cmd,
crypto/openssh/ssh.c
587
(void)read_config_file(_PATH_HOST_CONFIG_FILE, pw,
crypto/openssh/ssh.c
681
struct passwd *pw;
crypto/openssh/ssh.c
716
pw = getpwuid(getuid());
crypto/openssh/ssh.c
717
if (!pw) {
crypto/openssh/ssh.c
722
pw = pwcopy(pw);
crypto/openssh/sshconnect.c
1601
struct sockaddr *hostaddr, u_short port, struct passwd *pw, int timeout_ms,
crypto/openssh/sshconnect.c
1608
local_user = xstrdup(pw->pw_name);
crypto/openssh/sshd-session.c
1336
temporarily_use_uid(authctxt->pw);
crypto/openssh/sshd-session.c
468
do_setusercontext(authctxt->pw);
crypto/openssh/sshpty.c
166
pty_setowner(struct passwd *pw, const char *tty)
crypto/openssh/sshpty.c
177
gid = (grp != NULL) ? grp->gr_gid : pw->pw_gid;
crypto/openssh/sshpty.c
190
ssh_selinux_setup_pty(pw->pw_name, tty);
crypto/openssh/sshpty.c
193
if (st.st_uid != pw->pw_uid || st.st_gid != gid) {
crypto/openssh/sshpty.c
194
if (chown(tty, pw->pw_uid, gid) == -1) {
crypto/openssh/sshpty.c
196
(st.st_uid == pw->pw_uid || st.st_uid == 0))
crypto/openssh/sshpty.c
198
tty, (u_int)pw->pw_uid, (u_int)gid,
crypto/openssh/sshpty.c
202
tty, (u_int)pw->pw_uid, (u_int)gid,
crypto/openssh/uidswap.c
100
if (user_groupslen == -1 || user_groups_uid != pw->pw_uid) {
crypto/openssh/uidswap.c
101
if (initgroups(pw->pw_name, pw->pw_gid) == -1)
crypto/openssh/uidswap.c
102
fatal("initgroups: %s: %.100s", pw->pw_name,
crypto/openssh/uidswap.c
117
user_groups_uid = pw->pw_uid;
crypto/openssh/uidswap.c
130
if (setegid(pw->pw_gid) == -1)
crypto/openssh/uidswap.c
131
fatal("setegid %u: %.100s", (u_int)pw->pw_gid,
crypto/openssh/uidswap.c
133
if (seteuid(pw->pw_uid) == -1)
crypto/openssh/uidswap.c
134
fatal("seteuid %u: %.100s", (u_int)pw->pw_uid,
crypto/openssh/uidswap.c
181
permanently_set_uid(struct passwd *pw)
crypto/openssh/uidswap.c
188
if (pw == NULL)
crypto/openssh/uidswap.c
192
debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid,
crypto/openssh/uidswap.c
193
(u_int)pw->pw_gid);
crypto/openssh/uidswap.c
195
if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1)
crypto/openssh/uidswap.c
196
fatal("setresgid %u: %.100s", (u_int)pw->pw_gid, strerror(errno));
crypto/openssh/uidswap.c
203
if (initgroups(pw->pw_name, pw->pw_gid) == -1)
crypto/openssh/uidswap.c
205
pw->pw_name, (u_int)pw->pw_gid, strerror(errno));
crypto/openssh/uidswap.c
208
if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) == -1)
crypto/openssh/uidswap.c
209
fatal("setresuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
crypto/openssh/uidswap.c
213
if (old_gid != pw->pw_gid && pw->pw_uid != 0 &&
crypto/openssh/uidswap.c
219
if (getgid() != pw->pw_gid || getegid() != pw->pw_gid) {
crypto/openssh/uidswap.c
222
(u_int)pw->pw_gid);
crypto/openssh/uidswap.c
227
if (old_uid != pw->pw_uid &&
crypto/openssh/uidswap.c
233
if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) {
crypto/openssh/uidswap.c
236
(u_int)pw->pw_uid);
crypto/openssh/uidswap.c
61
temporarily_use_uid(struct passwd *pw)
crypto/openssh/uidswap.c
68
(u_int)pw->pw_uid, (u_int)pw->pw_gid,
crypto/openssl/test/bioprinttest.c
180
static pw pw_params[] = {
crypto/openssl/test/bioprinttest.c
228
const pw *pwp = &pw_params[i];
kerberos5/lib/libgssapi_krb5/pname_to_uid.c
43
struct passwd pwd, *pw;
kerberos5/lib/libgssapi_krb5/pname_to_uid.c
60
pw = NULL;
kerberos5/lib/libgssapi_krb5/pname_to_uid.c
66
error = getpwnam_r(lname, &pwd, bufp, buflen, &pw);
kerberos5/lib/libgssapi_krb5/pname_to_uid.c
75
if (pw) {
kerberos5/lib/libgssapi_krb5/pname_to_uid.c
76
*uidp = pw->pw_uid;
lib/libc/gen/pw_scan.c
100
if (pw->pw_passwd[0])
lib/libc/gen/pw_scan.c
101
pw->pw_fields |= _PWF_PASSWD;
lib/libc/gen/pw_scan.c
106
pw->pw_fields |= _PWF_UID;
lib/libc/gen/pw_scan.c
108
if (pw->pw_name[0] != '+' && pw->pw_name[0] != '-') {
lib/libc/gen/pw_scan.c
110
warnx("no uid for user %s", pw->pw_name);
lib/libc/gen/pw_scan.c
136
pw->pw_uid = id;
lib/libc/gen/pw_scan.c
141
pw->pw_fields |= _PWF_GID;
lib/libc/gen/pw_scan.c
143
if (pw->pw_name[0] != '+' && pw->pw_name[0] != '-') {
lib/libc/gen/pw_scan.c
145
warnx("no gid for user %s", pw->pw_name);
lib/libc/gen/pw_scan.c
166
pw->pw_gid = id;
lib/libc/gen/pw_scan.c
169
if (!(pw->pw_class = strsep(&bp, ":"))) /* class */
lib/libc/gen/pw_scan.c
171
if (pw->pw_class[0])
lib/libc/gen/pw_scan.c
172
pw->pw_fields |= _PWF_CLASS;
lib/libc/gen/pw_scan.c
177
pw->pw_fields |= _PWF_CHANGE;
lib/libc/gen/pw_scan.c
178
pw->pw_change = atol(p);
lib/libc/gen/pw_scan.c
183
pw->pw_fields |= _PWF_EXPIRE;
lib/libc/gen/pw_scan.c
184
pw->pw_expire = atol(p);
lib/libc/gen/pw_scan.c
186
if (!(pw->pw_gecos = strsep(&bp, ":"))) /* gecos */
lib/libc/gen/pw_scan.c
188
if (pw->pw_gecos[0])
lib/libc/gen/pw_scan.c
189
pw->pw_fields |= _PWF_GECOS;
lib/libc/gen/pw_scan.c
191
if (!(pw->pw_dir = strsep(&bp, ":"))) /* directory */
lib/libc/gen/pw_scan.c
193
if (pw->pw_dir[0])
lib/libc/gen/pw_scan.c
194
pw->pw_fields |= _PWF_DIR;
lib/libc/gen/pw_scan.c
196
if (!(pw->pw_shell = strsep(&bp, ":"))) /* shell */
lib/libc/gen/pw_scan.c
199
p = pw->pw_shell;
lib/libc/gen/pw_scan.c
213
pw->pw_fields |= _PWF_SHELL;
lib/libc/gen/pw_scan.c
81
__pw_scan(char *bp, struct passwd *pw, int flags)
lib/libc/gen/pw_scan.c
91
pw->pw_fields = 0;
lib/libc/gen/pw_scan.c
92
if (!(pw->pw_name = strsep(&bp, ":"))) /* login */
lib/libc/gen/pw_scan.c
94
root = !strcmp(pw->pw_name, "root");
lib/libc/gen/pw_scan.c
95
if (pw->pw_name[0] && (pw->pw_name[0] != '+' || pw->pw_name[1] == '\0'))
lib/libc/gen/pw_scan.c
96
pw->pw_fields |= _PWF_NAME;
lib/libc/gen/pw_scan.c
98
if (!(pw->pw_passwd = strsep(&bp, ":"))) /* passwd */
lib/libc/net/rcmdsh.c
131
if (setuid(pw->pw_uid) == -1) {
lib/libc/net/rcmdsh.c
133
pw->pw_uid, strerror(errno));
lib/libc/net/rcmdsh.c
143
if (pw->pw_shell[0] == '\0')
lib/libc/net/rcmdsh.c
146
rshprog = pw->pw_shell;
lib/libc/net/rcmdsh.c
66
struct passwd *pw;
lib/libc/net/rcmdsh.c
75
if ((pw = getpwnam(locuser)) == NULL) {
lib/libcrypt/crypt-md5.c
112
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
lib/libcrypt/crypt-md5.c
120
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
lib/libcrypt/crypt-md5.c
125
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
lib/libcrypt/crypt-md5.c
45
crypt_md5(const char *pw, const char *salt, char *buffer)
lib/libcrypt/crypt-md5.c
69
MD5Update(&ctx, (const u_char *)pw, strlen(pw));
lib/libcrypt/crypt-md5.c
79
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
lib/libcrypt/crypt-md5.c
81
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
lib/libcrypt/crypt-md5.c
83
for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE)
lib/libcrypt/crypt-md5.c
91
for (i = strlen(pw); i; i >>= 1)
lib/libcrypt/crypt-md5.c
95
MD5Update(&ctx, (const u_char *)pw, 1);
lib/libcrypt/crypt-nthash.c
49
crypt_nthash(const char *pw, const char *salt __unused, char *buffer)
lib/libcrypt/crypt-nthash.c
63
for (s = pw; unipwLen < sizeof(unipw) / 2 && *s; s++)
lib/libcrypt/crypt.h
35
int crypt_des(const char *pw, const char *salt, char *buf);
lib/libcrypt/crypt.h
36
int crypt_md5(const char *pw, const char *salt, char *buf);
lib/libcrypt/crypt.h
37
int crypt_nthash(const char *pw, const char *salt, char *buf);
lib/libcrypt/crypt.h
38
int crypt_blowfish(const char *pw, const char *salt, char *buf);
lib/libcrypt/crypt.h
39
int crypt_sha256 (const char *pw, const char *salt, char *buf);
lib/libcrypt/crypt.h
40
int crypt_sha512 (const char *pw, const char *salt, char *buf);
lib/libcrypt/tests/crypt_tests.c
20
char *pw;
lib/libcrypt/tests/crypt_tests.c
22
pw = crypt(LEET, want);
lib/libcrypt/tests/crypt_tests.c
23
ATF_CHECK_STREQ(pw, want);
lib/libcrypt/tests/crypt_tests.c
36
char *pw;
lib/libcrypt/tests/crypt_tests.c
38
pw = crypt(LEET, want);
lib/libcrypt/tests/crypt_tests.c
39
ATF_CHECK(strcmp(pw, want) != 0);
lib/libpam/modules/pam_rhosts/pam_rhosts.c
56
struct passwd *pw;
lib/libpam/modules/pam_rhosts/pam_rhosts.c
65
if ((pw = getpwnam(user)) == NULL)
lib/libpam/modules/pam_rhosts/pam_rhosts.c
67
if (pw->pw_uid == 0 &&
lib/librpcsec_gss/svc_rpcsec_gss.c
567
struct passwd pwd, *pw;
lib/librpcsec_gss/svc_rpcsec_gss.c
579
getpwuid_r(uid, &pwd, buf, sizeof(buf), &pw);
lib/librpcsec_gss/svc_rpcsec_gss.c
580
if (pw) {
lib/librpcsec_gss/svc_rpcsec_gss.c
582
uc->uid = pw->pw_uid;
lib/librpcsec_gss/svc_rpcsec_gss.c
583
uc->gid = pw->pw_gid;
lib/librpcsec_gss/svc_rpcsec_gss.c
585
getgrouplist(pw->pw_name, pw->pw_gid, uc->gidlist, &len);
lib/librpcsvc/xcrypt.c
122
passwd2des(char *pw, char *key)
lib/librpcsvc/xcrypt.c
127
for (i = 0; *pw; i = (i+1)%8) {
lib/librpcsvc/xcrypt.c
128
key[i] ^= *pw++ << 1;
lib/libutil/pw_util.c
396
pw_make(const struct passwd *pw)
lib/libutil/pw_util.c
400
asprintf(&line, "%s:%s:%ju:%ju:%s:%ju:%ju:%s:%s:%s", pw->pw_name,
lib/libutil/pw_util.c
401
pw->pw_passwd, (uintmax_t)pw->pw_uid, (uintmax_t)pw->pw_gid,
lib/libutil/pw_util.c
402
pw->pw_class, (uintmax_t)pw->pw_change, (uintmax_t)pw->pw_expire,
lib/libutil/pw_util.c
403
pw->pw_gecos, pw->pw_dir, pw->pw_shell);
lib/libutil/pw_util.c
411
pw_make_v7(const struct passwd *pw)
lib/libutil/pw_util.c
415
asprintf(&line, "%s:*:%ju:%ju:%s:%s:%s", pw->pw_name,
lib/libutil/pw_util.c
416
(uintmax_t)pw->pw_uid, (uintmax_t)pw->pw_gid,
lib/libutil/pw_util.c
417
pw->pw_gecos, pw->pw_dir, pw->pw_shell);
lib/libutil/pw_util.c
426
pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw)
lib/libutil/pw_util.c
435
if (old_pw == NULL && pw == NULL)
lib/libutil/pw_util.c
440
if (pw == NULL) {
lib/libutil/pw_util.c
443
if ((line = pw_make(pw)) == NULL)
lib/libutil/pw_util.c
449
spw = pw;
lib/libutil/pw_util.c
602
pw_dup(const struct passwd *pw)
lib/libutil/pw_util.c
609
if (pw->pw_name != NULL)
lib/libutil/pw_util.c
610
len += strlen(pw->pw_name) + 1;
lib/libutil/pw_util.c
611
if (pw->pw_passwd != NULL)
lib/libutil/pw_util.c
612
len += strlen(pw->pw_passwd) + 1;
lib/libutil/pw_util.c
613
if (pw->pw_class != NULL)
lib/libutil/pw_util.c
614
len += strlen(pw->pw_class) + 1;
lib/libutil/pw_util.c
615
if (pw->pw_gecos != NULL)
lib/libutil/pw_util.c
616
len += strlen(pw->pw_gecos) + 1;
lib/libutil/pw_util.c
617
if (pw->pw_dir != NULL)
lib/libutil/pw_util.c
618
len += strlen(pw->pw_dir) + 1;
lib/libutil/pw_util.c
619
if (pw->pw_shell != NULL)
lib/libutil/pw_util.c
620
len += strlen(pw->pw_shell) + 1;
lib/libutil/pw_util.c
623
memcpy(npw, pw, sizeof(*npw));
lib/libutil/pw_util.c
625
if (pw->pw_name != NULL) {
lib/libutil/pw_util.c
627
dst = stpcpy(npw->pw_name, pw->pw_name) + 1;
lib/libutil/pw_util.c
629
if (pw->pw_passwd != NULL) {
lib/libutil/pw_util.c
631
dst = stpcpy(npw->pw_passwd, pw->pw_passwd) + 1;
lib/libutil/pw_util.c
633
if (pw->pw_class != NULL) {
lib/libutil/pw_util.c
635
dst = stpcpy(npw->pw_class, pw->pw_class) + 1;
lib/libutil/pw_util.c
637
if (pw->pw_gecos != NULL) {
lib/libutil/pw_util.c
639
dst = stpcpy(npw->pw_gecos, pw->pw_gecos) + 1;
lib/libutil/pw_util.c
641
if (pw->pw_dir != NULL) {
lib/libutil/pw_util.c
643
dst = stpcpy(npw->pw_dir, pw->pw_dir) + 1;
lib/libutil/pw_util.c
645
if (pw->pw_shell != NULL) {
lib/libutil/pw_util.c
647
dst = stpcpy(npw->pw_shell, pw->pw_shell) + 1;
lib/libutil/pw_util.c
659
pw_initpwd(struct passwd *pw)
lib/libutil/pw_util.c
662
__pw_initpwd(pw);
lib/libutil/pw_util.c
668
struct passwd pw, *ret;
lib/libutil/pw_util.c
673
__pw_initpwd(&pw);
lib/libutil/pw_util.c
674
if (!__pw_scan(bp, &pw, flags)) {
lib/libutil/pw_util.c
678
ret = pw_dup(&pw);
libexec/ulog-helper/ulog-helper.c
52
const struct passwd *pw;
libexec/ulog-helper/ulog-helper.c
63
if ((login = getlogin()) != NULL && (pw = getpwnam(login)) != NULL &&
libexec/ulog-helper/ulog-helper.c
64
pw->pw_uid == uid)
libexec/ulog-helper/ulog-helper.c
66
if ((pw = getpwuid(uid)) != NULL)
libexec/ulog-helper/ulog-helper.c
67
return (pw->pw_name);
sbin/devfs/rule.c
313
struct passwd *pw;
sbin/devfs/rule.c
375
pw = getpwnam(av[1]);
sbin/devfs/rule.c
376
if (pw != NULL)
sbin/devfs/rule.c
377
dr->dr_uid = pw->pw_uid;
sbin/devfs/rule.c
423
struct passwd *pw;
sbin/devfs/rule.c
442
pw = getpwuid(dr->dr_uid);
sbin/devfs/rule.c
443
if (pw == NULL)
sbin/devfs/rule.c
446
fprintf(fp, " user %s", pw->pw_name);
sbin/dhclient/dhclient.c
379
struct passwd *pw;
sbin/dhclient/dhclient.c
486
if ((pw = getpwnam("_dhcp")) == NULL) {
sbin/dhclient/dhclient.c
488
if ((pw = getpwnam("nobody")) == NULL)
sbin/dhclient/dhclient.c
560
if (setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
sbin/dhclient/dhclient.c
561
seteuid(pw->pw_uid) || setuid(pw->pw_uid))
sbin/fsck_ffs/inode.c
1347
struct passwd *pw;
sbin/fsck_ffs/inode.c
1355
if ((pw = getpwuid((int)DIP(dp, di_uid))) != NULL)
sbin/fsck_ffs/inode.c
1356
printf("%s ", pw->pw_name);
sbin/fsdb/fsdbutil.c
109
struct passwd *pw;
sbin/fsdb/fsdbutil.c
177
if ((pw = getpwuid(DIP(dp, di_uid))))
sbin/fsdb/fsdbutil.c
178
printf("OWNER=%s ", pw->pw_name);
sbin/hastd/subr.c
156
struct passwd *pw;
sbin/hastd/subr.c
167
pw = getpwnam(HAST_USER);
sbin/hastd/subr.c
168
if (pw == NULL) {
sbin/hastd/subr.c
182
jailst.path = pw->pw_dir;
sbin/hastd/subr.c
200
"Unable to jail to directory to %s", pw->pw_dir);
sbin/hastd/subr.c
201
if (chroot(pw->pw_dir) == -1) {
sbin/hastd/subr.c
204
pw->pw_dir);
sbin/hastd/subr.c
213
if (setgid(pw->pw_gid) == -1) {
sbin/hastd/subr.c
215
(unsigned int)pw->pw_gid);
sbin/hastd/subr.c
218
if (setuid(pw->pw_uid) == -1) {
sbin/hastd/subr.c
220
(unsigned int)pw->pw_uid);
sbin/hastd/subr.c
279
PJDLOG_VERIFY(ruid == pw->pw_uid);
sbin/hastd/subr.c
280
PJDLOG_VERIFY(euid == pw->pw_uid);
sbin/hastd/subr.c
281
PJDLOG_VERIFY(suid == pw->pw_uid);
sbin/hastd/subr.c
283
PJDLOG_VERIFY(rgid == pw->pw_gid);
sbin/hastd/subr.c
284
PJDLOG_VERIFY(egid == pw->pw_gid);
sbin/hastd/subr.c
285
PJDLOG_VERIFY(sgid == pw->pw_gid);
sbin/mdmfs/mdmfs.c
657
struct passwd *pw;
sbin/mdmfs/mdmfs.c
680
pw = getpwnam(user);
sbin/mdmfs/mdmfs.c
681
if (pw == NULL)
sbin/mdmfs/mdmfs.c
683
*uid = pw->pw_uid;
sbin/mknod/mknod.c
89
struct passwd *pw;
sbin/mknod/mknod.c
93
return ((pw = getpwnam(s)) == NULL) ? id(s, "user") : pw->pw_uid;
sbin/mount/mount.c
651
struct passwd *pw;
sbin/mount/mount.c
669
if ((pw = getpwuid(sfp->f_owner)) != NULL)
sbin/mount/mount.c
670
xo_emit("{:mounter/%hs}", pw->pw_name);
sbin/mount_cd9660/mount_cd9660.c
297
struct passwd *pw;
sbin/mount_cd9660/mount_cd9660.c
301
if ((pw = getpwnam(s)) != NULL)
sbin/mount_cd9660/mount_cd9660.c
302
uid = pw->pw_uid;
sbin/mount_msdosfs/mount_msdosfs.c
250
struct passwd *pw;
sbin/mount_msdosfs/mount_msdosfs.c
254
if ((pw = getpwnam(s)) != NULL)
sbin/mount_msdosfs/mount_msdosfs.c
255
uid = pw->pw_uid;
sbin/mount_unionfs/mount_unionfs.c
101
if ((pw = getpwnam(s)) != NULL)
sbin/mount_unionfs/mount_unionfs.c
102
snprintf(buf, bufsize, "%d", pw->pw_uid);
sbin/mount_unionfs/mount_unionfs.c
98
struct passwd *pw;
sbin/quotacheck/quotacheck.c
125
struct passwd *pw;
sbin/quotacheck/quotacheck.c
178
while ((pw = getpwent()) != NULL)
sbin/quotacheck/quotacheck.c
179
(void) addid((u_long)pw->pw_uid, USRQUOTA, pw->pw_name,
sbin/reboot/reboot.c
262
const struct passwd *pw;
sbin/reboot/reboot.c
420
user = (pw = getpwuid(getuid())) ?
sbin/reboot/reboot.c
421
pw->pw_name : "???";
sbin/shutdown/shutdown.c
104
struct passwd *pw;
sbin/shutdown/shutdown.c
240
whom = (pw = getpwuid(getuid())) ? pw->pw_name : "???";
stand/ficl/words.c
1163
UNS32 *pw;
stand/ficl/words.c
1167
pw = (UNS32 *)stackPopPtr(pVM->pStack);
stand/ficl/words.c
1168
PUSHUNS((FICL_UNS)*pw);
stand/ficl/words.c
1174
UNS32 *pw;
stand/ficl/words.c
1178
pw = (UNS32 *)stackPopPtr(pVM->pStack);
stand/ficl/words.c
1179
*pw = (UNS32)(stackPop(pVM->pStack).u);
stand/ficl/words.c
1184
UNS16 *pw;
stand/ficl/words.c
1188
pw = (UNS16 *)stackPopPtr(pVM->pStack);
stand/ficl/words.c
1189
PUSHUNS((FICL_UNS)*pw);
stand/ficl/words.c
1195
UNS16 *pw;
stand/ficl/words.c
1199
pw = (UNS16 *)stackPopPtr(pVM->pStack);
stand/ficl/words.c
1200
*pw = (UNS16)(stackPop(pVM->pStack).u);
stand/libsa/geli/geliboot.c
376
geli_passphrase(struct geli_dev *gdev, char *pw)
stand/libsa/geli/geliboot.c
383
if (i == 0 && pw[0] != '\0') {
stand/libsa/geli/geliboot.c
384
if (geli_probe(gdev, pw, NULL) == 0) {
stand/libsa/geli/geliboot.c
389
pwgets(pw, GELI_PW_MAXLEN,
stand/libsa/geli/geliboot.c
392
if (geli_probe(gdev, pw, NULL) == 0) {
stand/libsa/geli/geliboot.h
84
int geli_passphrase(struct geli_dev *gdev, char *pw);
sys/dev/pci/pci_pci.c
187
pcib_is_window_open(struct pcib_window *pw)
sys/dev/pci/pci_pci.c
190
return (pw->valid && pw->base < pw->limit);
sys/geom/geom_subr.c
1016
pw = pp->acw - cp->acw;
sys/geom/geom_subr.c
1030
else if (dce > 0 && pw > 0)
sys/geom/geom_subr.c
957
int pw, pe;
tests/sys/fs/fusefs/utils.cc
552
struct passwd *pw;
tests/sys/fs/fusefs/utils.cc
559
pw = getpwnam("tests");
tests/sys/fs/fusefs/utils.cc
560
if (pw == NULL) {
tests/sys/fs/fusefs/utils.cc
562
pw = getpwnam("nobody");
tests/sys/fs/fusefs/utils.cc
564
if (pw == NULL)
tests/sys/fs/fusefs/utils.cc
570
*uid = pw->pw_uid;
usr.bin/at/at.c
460
struct passwd *pw;
usr.bin/at/at.c
515
pw = getpwuid(buf.st_uid);
usr.bin/at/at.c
519
pw ? pw->pw_name : "???",
usr.bin/bintrans/uudecode.c
191
struct passwd *pw;
usr.bin/bintrans/uudecode.c
233
pw = NULL;
usr.bin/bintrans/uudecode.c
238
pw = getpwnam(q + 1);
usr.bin/bintrans/uudecode.c
241
if (pw != NULL) {
usr.bin/bintrans/uudecode.c
242
n = strlen(pw->pw_dir);
usr.bin/bintrans/uudecode.c
253
q = memcpy(p - n, pw->pw_dir, n);
usr.bin/calendar/calendar.c
201
while ((pw = getpwent()) != NULL) {
usr.bin/calendar/calendar.c
204
if (chdir(pw->pw_dir) == -1)
usr.bin/calendar/calendar.c
212
lc = login_getpwclass(pw);
usr.bin/calendar/calendar.c
213
if (setusercontext(lc, pw, pw->pw_uid,
usr.bin/calendar/calendar.c
216
setenv("HOME", pw->pw_dir, 1);
usr.bin/calendar/calendar.c
50
struct passwd *pw;
usr.bin/calendar/calendar.h
51
extern struct passwd *pw;
usr.bin/calendar/io.c
715
write(pdes[1], pw->pw_name, strlen(pw->pw_name));
usr.bin/calendar/io.c
717
write(pdes[1], pw->pw_name, strlen(pw->pw_name));
usr.bin/chpass/chpass.c
132
if ((pw = getpwuid(uid)) == NULL)
usr.bin/chpass/chpass.c
136
if ((pw = getpwnam(*argv)) == NULL)
usr.bin/chpass/chpass.c
138
if (uid != 0 && uid != pw->pw_uid)
usr.bin/chpass/chpass.c
143
if ((pw = pw_dup(pw)) == NULL ||
usr.bin/chpass/chpass.c
144
(old_pw = pw_dup(pw)) == NULL)
usr.bin/chpass/chpass.c
149
if (pw != NULL && (pw->pw_fields & _PWF_SOURCE) == _PWF_NIS) {
usr.bin/chpass/chpass.c
163
if (p_shell(arg, pw, (ENTRY *)NULL) == -1)
usr.bin/chpass/chpass.c
170
if (p_expire(arg, pw, (ENTRY *)NULL) == -1)
usr.bin/chpass/chpass.c
177
pw = &lpw;
usr.bin/chpass/chpass.c
179
if (!__pw_scan(arg, pw, _PWSCAN_WARN|_PWSCAN_MASTER))
usr.bin/chpass/chpass.c
189
pw->pw_passwd = arg;
usr.bin/chpass/chpass.c
203
free(pw);
usr.bin/chpass/chpass.c
204
pw = edit(pw_tempname(), old_pw);
usr.bin/chpass/chpass.c
206
if (pw == NULL)
usr.bin/chpass/chpass.c
212
if (pw_equal(old_pw, pw) &&
usr.bin/chpass/chpass.c
213
strcmp(old_pw->pw_passwd, pw->pw_passwd) == 0)
usr.bin/chpass/chpass.c
227
pw->pw_fields |= (old_pw->pw_fields & _PWF_SOURCE);
usr.bin/chpass/chpass.c
228
switch (pw->pw_fields & _PWF_SOURCE) {
usr.bin/chpass/chpass.c
237
ypclnt_passwd(ypclnt, pw, password) == -1) {
usr.bin/chpass/chpass.c
257
if (pw_copy(pfd, tfd, pw, old_pw) == -1) {
usr.bin/chpass/chpass.c
261
if (pw_mkdb(pw->pw_name) == -1) {
usr.bin/chpass/chpass.c
70
struct passwd lpw, *old_pw, *pw;
usr.bin/chpass/chpass.c
80
pw = old_pw = NULL;
usr.bin/chpass/edit.c
102
display(const char *tfn, struct passwd *pw)
usr.bin/chpass/edit.c
113
"#Changing user information for %s.\n", pw->pw_name);
usr.bin/chpass/edit.c
115
(void)fprintf(fp, "Login: %s\n", pw->pw_name);
usr.bin/chpass/edit.c
116
(void)fprintf(fp, "Password: %s\n", pw->pw_passwd);
usr.bin/chpass/edit.c
117
(void)fprintf(fp, "Uid [#]: %lu\n", (unsigned long)pw->pw_uid);
usr.bin/chpass/edit.c
119
(unsigned long)pw->pw_gid);
usr.bin/chpass/edit.c
121
ttoa(pw->pw_change));
usr.bin/chpass/edit.c
123
ttoa(pw->pw_expire));
usr.bin/chpass/edit.c
124
(void)fprintf(fp, "Class: %s\n", pw->pw_class);
usr.bin/chpass/edit.c
125
(void)fprintf(fp, "Home directory: %s\n", pw->pw_dir);
usr.bin/chpass/edit.c
127
*pw->pw_shell ? pw->pw_shell : _PATH_BSHELL);
usr.bin/chpass/edit.c
131
else if (ok_shell(pw->pw_shell))
usr.bin/chpass/edit.c
137
else if ((!list[E_SHELL].restricted && ok_shell(pw->pw_shell)) ||
usr.bin/chpass/edit.c
145
*pw->pw_shell ? pw->pw_shell : _PATH_BSHELL);
usr.bin/chpass/edit.c
149
if ((bp = gecos = strdup(pw->pw_gecos)) == NULL) {
usr.bin/chpass/edit.c
192
verify(const char *tfn, struct passwd *pw)
usr.bin/chpass/edit.c
202
if ((pw = pw_dup(pw)) == NULL)
usr.bin/chpass/edit.c
207
free(pw);
usr.bin/chpass/edit.c
213
free(pw);
usr.bin/chpass/edit.c
254
if ((ep->func)(val, pw, ep))
usr.bin/chpass/edit.c
268
free(pw);
usr.bin/chpass/edit.c
273
pw->pw_gecos = p;
usr.bin/chpass/edit.c
274
buf = pw_make(pw);
usr.bin/chpass/edit.c
275
free(pw);
usr.bin/chpass/edit.c
285
free(pw);
usr.bin/chpass/edit.c
61
static int display(const char *tfn, struct passwd *pw);
usr.bin/chpass/edit.c
62
static struct passwd *verify(const char *tfn, struct passwd *pw);
usr.bin/chpass/edit.c
65
edit(const char *tfn, struct passwd *pw)
usr.bin/chpass/edit.c
71
if (display(tfn, pw) == -1)
usr.bin/chpass/edit.c
78
return (pw_dup(pw));
usr.bin/chpass/edit.c
82
if ((npw = verify(tfn, pw)) != NULL)
usr.bin/chpass/field.c
116
pw->pw_uid = id;
usr.bin/chpass/field.c
122
p_gid(char *p, struct passwd *pw, ENTRY *ep __unused)
usr.bin/chpass/field.c
137
pw->pw_gid = gr->gr_gid;
usr.bin/chpass/field.c
146
pw->pw_gid = id;
usr.bin/chpass/field.c
152
p_class(char *p, struct passwd *pw, ENTRY *ep __unused)
usr.bin/chpass/field.c
154
if (!(pw->pw_class = strdup(p))) {
usr.bin/chpass/field.c
164
p_change(char *p, struct passwd *pw, ENTRY *ep __unused)
usr.bin/chpass/field.c
166
if (!atot(p, &pw->pw_change))
usr.bin/chpass/field.c
174
p_expire(char *p, struct passwd *pw, ENTRY *ep __unused)
usr.bin/chpass/field.c
176
if (!atot(p, &pw->pw_expire))
usr.bin/chpass/field.c
184
p_gecos(char *p, struct passwd *pw __unused, ENTRY *ep)
usr.bin/chpass/field.c
195
p_hdir(char *p, struct passwd *pw, ENTRY *ep __unused)
usr.bin/chpass/field.c
201
if (!(pw->pw_dir = strdup(p))) {
usr.bin/chpass/field.c
210
p_shell(char *p, struct passwd *pw, ENTRY *ep __unused)
usr.bin/chpass/field.c
215
pw->pw_shell = strdup(_PATH_BSHELL);
usr.bin/chpass/field.c
219
if (!master_mode && pw->pw_shell && !ok_shell(pw->pw_shell)) {
usr.bin/chpass/field.c
220
warnx("%s: current shell non-standard", pw->pw_shell);
usr.bin/chpass/field.c
228
pw->pw_shell = strdup(p);
usr.bin/chpass/field.c
231
pw->pw_shell = dup_shell(p);
usr.bin/chpass/field.c
232
if (!pw->pw_shell) {
usr.bin/chpass/field.c
236
if (stat(pw->pw_shell, &sbuf) < 0) {
usr.bin/chpass/field.c
239
pw->pw_shell);
usr.bin/chpass/field.c
241
warn("WARNING: can't stat shell '%s'", pw->pw_shell);
usr.bin/chpass/field.c
246
pw->pw_shell);
usr.bin/chpass/field.c
250
warnx("WARNING: shell '%s' is not executable", pw->pw_shell);
usr.bin/chpass/field.c
59
p_login(char *p, struct passwd *pw, ENTRY *ep __unused)
usr.bin/chpass/field.c
69
if (!(pw->pw_name = strdup(p))) {
usr.bin/chpass/field.c
85
p_passwd(char *p, struct passwd *pw, ENTRY *ep __unused)
usr.bin/chpass/field.c
87
if (!(pw->pw_passwd = strdup(p))) {
usr.bin/chpass/field.c
97
p_uid(char *p, struct passwd *pw, ENTRY *ep __unused)
usr.bin/enigma/enigma.c
34
setup(char *pw)
usr.bin/enigma/enigma.c
47
strlcpy(salt, pw, sizeof(salt));
usr.bin/enigma/enigma.c
48
cryptpw = crypt(pw, salt);
usr.bin/env/env.c
137
pw = getpwnam(login_name);
usr.bin/env/env.c
138
if (pw == NULL) {
usr.bin/env/env.c
143
pw = getpwuid(uid);
usr.bin/env/env.c
145
if (pw == NULL)
usr.bin/env/env.c
159
lc = login_getpwclass(pw);
usr.bin/env/env.c
168
setclassenvironment(lc, pw, 1);
usr.bin/env/env.c
169
setclassenvironment(lc, pw, 0);
usr.bin/env/env.c
172
if ((lc = login_getuserclass(pw)) != NULL) {
usr.bin/env/env.c
173
setclassenvironment(lc, pw, 1);
usr.bin/env/env.c
174
setclassenvironment(lc, pw, 0);
usr.bin/env/env.c
65
struct passwd *pw;
usr.bin/env/env.c
76
pw = NULL;
usr.bin/finger/finger.c
149
struct passwd *pw;
usr.bin/finger/finger.c
154
if ((pw = getpwnam(UNPRIV_NAME)) && pw->pw_uid > 0) {
usr.bin/finger/finger.c
155
if (setgid(pw->pw_gid) != 0)
usr.bin/finger/finger.c
157
if (setuid(pw->pw_uid) != 0)
usr.bin/finger/finger.c
223
struct passwd *pw;
usr.bin/finger/finger.c
235
if ((pw = getpwnam(user->ut_user)) == NULL)
usr.bin/finger/finger.c
237
if (hide(pw))
usr.bin/finger/finger.c
239
pn = enter_person(pw);
usr.bin/finger/finger.c
264
struct passwd *pw;
usr.bin/finger/finger.c
332
if (((pw = getpwnam(*p)) != NULL) && !hide(pw))
usr.bin/finger/finger.c
333
enter_person(pw);
usr.bin/finger/finger.c
339
while ((pw = getpwent()) != NULL) {
usr.bin/finger/finger.c
344
else if (match(pw, *p) && !hide(pw)) {
usr.bin/finger/finger.c
345
enter_person(pw);
usr.bin/finger/util.c
148
enter_person(struct passwd *pw)
usr.bin/finger/util.c
157
key.data = pw->pw_name;
usr.bin/finger/util.c
158
key.size = strlen(pw->pw_name);
usr.bin/finger/util.c
171
userinfo(pn, pw);
usr.bin/finger/util.c
185
struct passwd *pw;
usr.bin/finger/util.c
193
if ((pw = getpwnam(name)) && hide(pw))
usr.bin/finger/util.c
317
userinfo(PERSON *pn, struct passwd *pw)
usr.bin/finger/util.c
325
pn->uid = pw->pw_uid;
usr.bin/finger/util.c
326
if ((pn->name = strdup(pw->pw_name)) == NULL)
usr.bin/finger/util.c
328
if ((pn->dir = strdup(pw->pw_dir)) == NULL)
usr.bin/finger/util.c
330
if ((pn->shell = strdup(pw->pw_shell)) == NULL)
usr.bin/finger/util.c
334
(void)strncpy(bp = tbuf, pw->pw_gecos, sizeof(tbuf));
usr.bin/finger/util.c
344
(void)strncpy(t, pw->pw_name,
usr.bin/finger/util.c
364
(void)snprintf(tbuf, sizeof(tbuf), "%s/%s", _PATH_MAILDIR, pw->pw_name);
usr.bin/finger/util.c
384
hide(struct passwd *pw)
usr.bin/finger/util.c
389
if (invoker_root || !pw->pw_dir)
usr.bin/finger/util.c
392
snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir, _PATH_NOFINGER);
usr.bin/finger/util.c
58
match(struct passwd *pw, const char *user)
usr.bin/finger/util.c
63
if (!strcasecmp(pw->pw_name, user))
usr.bin/finger/util.c
70
(void)strncpy(p = tbuf, pw->pw_gecos, sizeof(tbuf));
usr.bin/finger/util.c
81
(void)strncpy(t, pw->pw_name,
usr.bin/getent/getent.c
380
struct passwd *pw;
usr.bin/getent/getent.c
388
pw->pw_name, pw->pw_passwd, pw->pw_uid, \
usr.bin/getent/getent.c
389
pw->pw_gid, pw->pw_gecos, pw->pw_dir, pw->pw_shell)
usr.bin/getent/getent.c
394
while ((pw = getpwent()) != NULL)
usr.bin/getent/getent.c
399
pw = getpwuid((uid_t)id);
usr.bin/getent/getent.c
401
pw = getpwnam(argv[i]);
usr.bin/getent/getent.c
402
if (pw != NULL)
usr.bin/id/id.c
154
pw = *argv ? who(*argv) : NULL;
usr.bin/id/id.c
156
if (Mflag && pw != NULL)
usr.bin/id/id.c
175
id = pw ? pw->pw_gid : rflag ? getgid() : getegid();
usr.bin/id/id.c
184
id = pw ? pw->pw_uid : rflag ? getuid() : geteuid();
usr.bin/id/id.c
185
if (nflag && (pw = getpwuid(id)))
usr.bin/id/id.c
186
(void)printf("%s\n", pw->pw_name);
usr.bin/id/id.c
193
dir(pw);
usr.bin/id/id.c
198
group(pw, nflag);
usr.bin/id/id.c
208
pline(pw);
usr.bin/id/id.c
213
pretty(pw);
usr.bin/id/id.c
218
shell(pw);
usr.bin/id/id.c
222
id_print(pw);
usr.bin/id/id.c
227
pretty(struct passwd *pw)
usr.bin/id/id.c
233
if (pw) {
usr.bin/id/id.c
234
(void)printf("uid\t%s\n", pw->pw_name);
usr.bin/id/id.c
236
group(pw, true);
usr.bin/id/id.c
241
pw = getpwuid(rid = getuid());
usr.bin/id/id.c
242
if (pw == NULL || strcmp(login, pw->pw_name))
usr.bin/id/id.c
244
if (pw)
usr.bin/id/id.c
245
(void)printf("uid\t%s\n", pw->pw_name);
usr.bin/id/id.c
250
if ((pw = getpwuid(eid)))
usr.bin/id/id.c
251
(void)printf("euid\t%s\n", pw->pw_name);
usr.bin/id/id.c
267
id_print(struct passwd *pw)
usr.bin/id/id.c
278
print_dbinfo = pw != NULL;
usr.bin/id/id.c
280
uid = pw->pw_uid;
usr.bin/id/id.c
281
gid = pw->pw_gid;
usr.bin/id/id.c
286
pw = getpwuid(uid);
usr.bin/id/id.c
295
getgrouplist(pw->pw_name, gid, groups, &ngroups);
usr.bin/id/id.c
305
if (pw != NULL)
usr.bin/id/id.c
306
printf("uid=%u(%s)", uid, pw->pw_name);
usr.bin/id/id.c
314
if ((pw = getpwuid(euid)))
usr.bin/id/id.c
315
(void)printf("(%s)", pw->pw_name);
usr.bin/id/id.c
385
group(struct passwd *pw, bool nflag)
usr.bin/id/id.c
397
if (pw) {
usr.bin/id/id.c
399
(void) getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups);
usr.bin/id/id.c
451
struct passwd *pw;
usr.bin/id/id.c
459
if ((pw = getpwnam(u)))
usr.bin/id/id.c
460
return(pw);
usr.bin/id/id.c
462
if (*u && !*ep && (pw = getpwuid(id)))
usr.bin/id/id.c
463
return(pw);
usr.bin/id/id.c
469
pline(struct passwd *pw)
usr.bin/id/id.c
471
if (pw == NULL) {
usr.bin/id/id.c
472
if ((pw = getpwuid(getuid())) == NULL)
usr.bin/id/id.c
475
(void)printf("%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s\n", pw->pw_name,
usr.bin/id/id.c
476
pw->pw_passwd, pw->pw_uid, pw->pw_gid, pw->pw_class,
usr.bin/id/id.c
477
(long)pw->pw_change, (long)pw->pw_expire, pw->pw_gecos,
usr.bin/id/id.c
478
pw->pw_dir, pw->pw_shell);
usr.bin/id/id.c
482
dir(struct passwd *pw)
usr.bin/id/id.c
484
if (pw == NULL) {
usr.bin/id/id.c
485
if ((pw = getpwuid(getuid())) == NULL)
usr.bin/id/id.c
488
printf("%s\n", pw->pw_dir);
usr.bin/id/id.c
492
shell(struct passwd *pw)
usr.bin/id/id.c
494
if (pw == NULL) {
usr.bin/id/id.c
495
if ((pw = getpwuid(getuid())) == NULL)
usr.bin/id/id.c
498
printf("%s\n", pw->pw_shell);
usr.bin/id/id.c
69
struct passwd *pw;
usr.bin/killall/killall.c
271
pw = getpwnam(user);
usr.bin/killall/killall.c
272
if (pw == NULL)
usr.bin/killall/killall.c
274
uid = pw->pw_uid;
usr.bin/killall/killall.c
281
pw = getpwuid(uid);
usr.bin/killall/killall.c
282
if (pw)
usr.bin/killall/killall.c
283
user = pw->pw_name;
usr.bin/killall/killall.c
96
struct passwd *pw;
usr.bin/lock/lock.c
111
if (!(pw = getpwuid(getuid())))
usr.bin/lock/lock.c
151
pam_err = pam_start("lock", pw->pw_name, &pamc, &pamh);
usr.bin/lock/lock.c
199
if (pw != NULL)
usr.bin/lock/lock.c
200
(void)printf("lock: %s using %s on %s.", pw->pw_name,
usr.bin/lock/lock.c
85
struct passwd *pw;
usr.bin/lock/lock.c
99
pw = NULL;
usr.bin/mail/getname.c
44
struct passwd *pw;
usr.bin/mail/getname.c
46
if ((pw = getpwuid(uid)) == NULL)
usr.bin/mail/getname.c
48
return (pw->pw_name);
usr.bin/mail/getname.c
58
struct passwd *pw;
usr.bin/mail/getname.c
60
if ((pw = getpwnam(name)) == NULL)
usr.bin/mail/getname.c
62
return (pw->pw_uid);
usr.bin/mdo/mdo.c
504
struct passwd *pw = NULL;
usr.bin/mdo/mdo.c
611
uid = parse_user_pwd(user_name, &pw, &pw_alloc);
usr.bin/mdo/mdo.c
649
if (pw == NULL)
usr.bin/mdo/mdo.c
655
pw->pw_gid;
usr.bin/mdo/mdo.c
719
if (pw == NULL)
usr.bin/mdo/mdo.c
736
getgrouplist(user_name, pw->pw_gid, groups, &ngroups);
usr.bin/rwall/rwall.c
117
struct passwd *pw;
usr.bin/rwall/rwall.c
133
pw = getpwuid(getuid());
usr.bin/rwall/rwall.c
134
whom = pw ? pw->pw_name : "???";
usr.bin/talk/get_names.c
70
struct passwd *pw;
usr.bin/talk/get_names.c
72
if ((pw = getpwuid(getuid())) == NULL)
usr.bin/talk/get_names.c
74
my_name = pw->pw_name;
usr.bin/wall/wall.c
141
pw = getpwnam(utmp->ut_user);
usr.bin/wall/wall.c
142
if (!pw)
usr.bin/wall/wall.c
147
if (g->gid == pw->pw_gid)
usr.bin/wall/wall.c
180
struct passwd *pw;
usr.bin/wall/wall.c
202
whom = (pw = getpwuid(getuid())) ? pw->pw_name : "???";
usr.bin/wall/wall.c
94
struct passwd *pw;
usr.sbin/bhyve/slirp/slirp-helper.c
409
struct passwd *pw;
usr.sbin/bhyve/slirp/slirp-helper.c
414
pw = getpwnam("nobody");
usr.sbin/bhyve/slirp/slirp-helper.c
415
if (pw == NULL)
usr.sbin/bhyve/slirp/slirp-helper.c
417
if (initgroups(pw->pw_name, pw->pw_gid) != 0)
usr.sbin/bhyve/slirp/slirp-helper.c
419
if (setgid(pw->pw_gid) != 0)
usr.sbin/bhyve/slirp/slirp-helper.c
421
if (setuid(pw->pw_uid) != 0)
usr.sbin/bluetooth/sdpd/server.c
350
struct passwd *pw;
usr.sbin/bluetooth/sdpd/server.c
361
pw = getpwuid(uid);
usr.sbin/bluetooth/sdpd/server.c
362
if (pw != NULL)
usr.sbin/bluetooth/sdpd/server.c
363
priv = (strcmp(pw->pw_name, "root") == 0);
usr.sbin/chown/chown.c
225
struct passwd *pw;
usr.sbin/chown/chown.c
229
uid = ((pw = getpwnam(s)) != NULL) ? pw->pw_uid : id(s, "user");
usr.sbin/chroot/chroot.c
78
struct passwd *pw;
usr.sbin/chroot/chroot.c
81
pw = getpwnam(user);
usr.sbin/chroot/chroot.c
82
if (pw != NULL)
usr.sbin/chroot/chroot.c
83
return (pw->pw_uid);
usr.sbin/cron/cron/database.c
240
struct passwd *pw = NULL;
usr.sbin/cron/cron/database.c
246
if (strcmp(fname, SYS_NAME) != 0 && !(pw = getpwnam(uname))) {
usr.sbin/cron/cron/database.c
290
u = load_user(crontab_fd, pw, fname);
usr.sbin/cron/cron/externs.h
87
#define MY_UID(pw) getuid()
usr.sbin/cron/cron/externs.h
88
#define MY_GID(pw) getgid()
usr.sbin/cron/cron/user.c
100
e = load_entry(file, log_error, pw, envp);
usr.sbin/cron/cron/user.c
51
load_user(int crontab_fd, struct passwd *pw, const char *name)
usr.sbin/cron/crontab/crontab.c
122
if (!(pw = getpwuid(getuid())))
usr.sbin/cron/crontab/crontab.c
124
bzero(pw->pw_passwd, strlen(pw->pw_passwd));
usr.sbin/cron/crontab/crontab.c
125
(void) strncpy(User, pw->pw_name, (sizeof User)-1);
usr.sbin/cron/crontab/crontab.c
139
if (!(pw = getpwnam(optarg)))
usr.sbin/cron/crontab/crontab.c
141
bzero(pw->pw_passwd, strlen(pw->pw_passwd));
usr.sbin/cron/crontab/crontab.c
142
(void) strncpy(User, pw->pw_name, (sizeof User)-1);
usr.sbin/cron/crontab/crontab.c
53
static struct passwd *pw;
usr.sbin/cron/crontab/crontab.c
554
e = load_entry(tmp, check_error, pw, envp);
usr.sbin/cron/lib/entry.c
302
if (!pw) {
usr.sbin/cron/lib/entry.c
352
pw = getpwnam(username);
usr.sbin/cron/lib/entry.c
353
if (pw == NULL) {
usr.sbin/cron/lib/entry.c
358
pw->pw_gid = grp->gr_gid;
usr.sbin/cron/lib/entry.c
359
Debug(DPARS, ("load_entry()...uid %d, gid %d\n",pw->pw_uid,pw->pw_gid))
usr.sbin/cron/lib/entry.c
366
if (pw->pw_expire && time(NULL) >= pw->pw_expire) {
usr.sbin/cron/lib/entry.c
372
e->uid = pw->pw_uid;
usr.sbin/cron/lib/entry.c
373
e->gid = pw->pw_gid;
usr.sbin/cron/lib/entry.c
401
len = snprintf(envstr, sizeof(envstr), "HOME=%s", pw->pw_dir);
usr.sbin/cron/lib/entry.c
413
len = snprintf(envstr, sizeof(envstr), "LOGNAME=%s", pw->pw_name);
usr.sbin/cron/lib/entry.c
424
len = snprintf(envstr, sizeof(envstr), "USER=%s", pw->pw_name);
usr.sbin/cron/lib/entry.c
93
load_entry(FILE *file, void (*error_func)(const char *), struct passwd *pw,
usr.sbin/daemon/daemon.c
664
struct passwd *pw = NULL;
usr.sbin/daemon/daemon.c
666
pw = getpwnam(user);
usr.sbin/daemon/daemon.c
667
if (pw == NULL) {
usr.sbin/daemon/daemon.c
671
if (setusercontext(NULL, pw, pw->pw_uid, LOGIN_SETALL) != 0) {
usr.sbin/daemon/daemon.c
675
setenv("USER", pw->pw_name, 1);
usr.sbin/daemon/daemon.c
676
setenv("HOME", pw->pw_dir, 1);
usr.sbin/daemon/daemon.c
677
setenv("SHELL", *pw->pw_shell ? pw->pw_shell : _PATH_BSHELL, 1);
usr.sbin/edquota/edquota.c
326
struct passwd *pw;
usr.sbin/edquota/edquota.c
333
if ((pw = getpwnam(name)))
usr.sbin/edquota/edquota.c
334
return (pw->pw_uid);
usr.sbin/gssd/gssd.c
1142
struct passwd pwd, *pw;
usr.sbin/gssd/gssd.c
1156
pw = NULL;
usr.sbin/gssd/gssd.c
1163
&pw);
usr.sbin/gssd/gssd.c
1172
if (pw) {
usr.sbin/gssd/gssd.c
1175
result->gid = pw->pw_gid;
usr.sbin/gssd/gssd.c
1176
getgrouplist(pw->pw_name, pw->pw_gid,
usr.sbin/gssd/gssd.c
1514
struct passwd *pw;
usr.sbin/gssd/gssd.c
1519
pw = getpwuid(uid);
usr.sbin/gssd/gssd.c
1576
if (pw != NULL && strcmp(pname,
usr.sbin/gssd/gssd.c
1577
pw->pw_name) == 0)
usr.sbin/gssd/gssd.c
1673
struct passwd *pw;
usr.sbin/gssd/gssd.c
1675
pw = getpwuid(uid);
usr.sbin/gssd/gssd.c
1676
if (pw == NULL) {
usr.sbin/gssd/gssd.c
1695
principal_desc.value = (void *)pw->pw_name;
usr.sbin/gssd/gssd.c
1696
principal_desc.length = strlen(pw->pw_name);
usr.sbin/gssd/gssd.c
764
struct passwd pwd, *pw;
usr.sbin/gssd/gssd.c
774
pw = NULL;
usr.sbin/gssd/gssd.c
781
&pw);
usr.sbin/gssd/gssd.c
790
if (pw) {
usr.sbin/gssd/gssd.c
791
*gidp = pw->pw_gid;
usr.sbin/gssd/gssd.c
792
getgrouplist(pw->pw_name, pw->pw_gid,
usr.sbin/inetd/builtins.c
355
struct passwd *pw = NULL;
usr.sbin/inetd/builtins.c
571
pw = getpwuid(uc.cr_uid);
usr.sbin/inetd/builtins.c
572
if (pw == NULL)
usr.sbin/inetd/builtins.c
576
snprintf(idbuf, sizeof(idbuf), "%u", (unsigned)pw->pw_uid);
usr.sbin/inetd/builtins.c
578
strlcpy(idbuf, pw->pw_name, sizeof(idbuf));
usr.sbin/inetd/builtins.c
585
if (asprintf(&p, "%s/.noident", pw->pw_dir) == -1)
usr.sbin/inetd/builtins.c
607
if (initgroups(pw->pw_name, pw->pw_gid) == -1)
usr.sbin/inetd/builtins.c
609
if (setegid(pw->pw_gid) == -1)
usr.sbin/inetd/builtins.c
611
if (seteuid(pw->pw_uid) == -1)
usr.sbin/inetd/builtins.c
620
if (asprintf(&p, "%s/.fakeid", pw->pw_dir) == -1)
usr.sbin/inetd/inetd.c
1666
struct passwd *pw;
usr.sbin/inetd/inetd.c
1679
if ((pw = getpwnam(user)) == NULL) {
usr.sbin/inetd/inetd.c
1683
sep->se_sockuid = pw->pw_uid;
usr.sbin/lpr/lpr/lpr.c
121
struct passwd *pw;
usr.sbin/lpr/lpr/lpr.c
283
if ((pw = getpwuid(userid)) == NULL)
usr.sbin/lpr/lpr/lpr.c
285
lpr_username = pw->pw_name;
usr.sbin/mountd/mountd.c
3661
struct passwd *pw;
usr.sbin/mountd/mountd.c
3674
pw = getpwnam(name);
usr.sbin/mountd/mountd.c
3676
pw = getpwuid((uid_t)name_ul);
usr.sbin/mountd/mountd.c
3677
if (pw != NULL) {
usr.sbin/mountd/mountd.c
3678
cr->cr_uid = pw->pw_uid;
usr.sbin/mountd/mountd.c
3692
if (pw == NULL) {
usr.sbin/mountd/mountd.c
3699
if (getgrouplist(pw->pw_name, pw->pw_gid,
usr.sbin/ppp/auth.c
127
struct passwd *pw;
usr.sbin/ppp/auth.c
131
pw = getpwnam(name);
usr.sbin/ppp/auth.c
133
if (pw) {
usr.sbin/ppp/auth.c
134
cryptpw = crypt(key, pw->pw_passwd);
usr.sbin/ppp/auth.c
136
result = (cryptpw != NULL) && !strcmp(cryptpw, pw->pw_passwd);
usr.sbin/pw/pw_nis.c
42
struct passwd *pw = NULL;
usr.sbin/pw/pw_nis.c
47
pw = pw_dup(pwd);
usr.sbin/pw/pw_nis.c
62
if (pw_copy(pfd, tfd, pw, old_pw) == -1) {
usr.sbin/pw/pw_nis.c
74
free(pw);
usr.sbin/pw/pw_vpw.c
103
free(pw);
usr.sbin/pw/pw_vpw.c
104
pw = NULL;
usr.sbin/pw/pw_vpw.c
111
return (pw);
usr.sbin/pw/pw_vpw.c
63
struct passwd *pw;
usr.sbin/pw/pw_vpw.c
68
pw = NULL;
usr.sbin/pw/pw_vpw.c
91
pw = pw_scan(line, pwd_scanflag);
usr.sbin/pw/pw_vpw.c
92
if (pw == NULL)
usr.sbin/pw/pw_vpw.c
96
if (uid == pw->pw_uid)
usr.sbin/pw/pw_vpw.c
99
if (strcmp(nam, pw->pw_name) == 0)
usr.sbin/pw/pwupd.c
109
if (pw_copy(pfd, tfd, pw, old_pw) == -1) {
usr.sbin/pw/pwupd.c
120
if (pw_mkdb(pw != NULL ? pw->pw_name : NULL) == -1) {
usr.sbin/pw/pwupd.c
124
free(pw);
usr.sbin/pw/pwupd.c
86
struct passwd *pw = NULL;
usr.sbin/pw/pwupd.c
94
pw = pw_dup(pwd);
usr.sbin/pwd_mkdb/pwd_mkdb.c
528
scan(FILE *fp, struct passwd *pw)
usr.sbin/pwd_mkdb/pwd_mkdb.c
564
if (!__pw_scan(line, pw, _PWSCAN_WARN|_PWSCAN_MASTER)) {
usr.sbin/repquota/repquota.c
145
while ((pw = getpwent()) != 0)
usr.sbin/repquota/repquota.c
146
(void) addid((u_long)pw->pw_uid, USRQUOTA, pw->pw_name);
usr.sbin/repquota/repquota.c
99
struct passwd *pw;
usr.sbin/rpc.lockd/kern.c
129
struct passwd *pw;
usr.sbin/rpc.lockd/kern.c
163
pw = getpwnam(DAEMON_USERNAME);
usr.sbin/rpc.lockd/kern.c
164
if (pw == NULL) {
usr.sbin/rpc.lockd/kern.c
168
daemon_uid = pw->pw_uid;
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
247
find_domain(struct x_passwd *pw)
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
276
key.data = pw->pw_name;
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
277
key.size = strlen(pw->pw_name);
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
285
if (yp_password.pw_uid == (uid_t)pw->pw_uid &&
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
286
yp_password.pw_gid == (gid_t)pw->pw_gid) {
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
316
update_inplace(struct passwd *pw, char *domain)
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
336
"%llu", (unsigned long long)pw->pw_uid);
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
340
key.data = pw->pw_name;
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
341
key.size = strlen(pw->pw_name);
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
377
if (strncmp(data.data, pw->pw_name,
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
378
strlen(pw->pw_name))) {
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
380
in map %s@%s with wrong name (%.*s)", pw->pw_uid, maps[i], domain,
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
393
asprintf(&pwbuf, ":%d:%d:", pw->pw_uid, pw->pw_gid);
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
400
in map %s@%s with wrong UID", pw->pw_name, maps[i], domain);
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
410
pw->pw_name, pw->pw_passwd, pw->pw_uid,
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
411
pw->pw_gid, pw->pw_class, pw->pw_change,
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
412
pw->pw_expire, pw->pw_gecos, pw->pw_dir,
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
413
pw->pw_shell);
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
417
pw->pw_name, *(ptr+1) == '*' ? "*" : pw->pw_passwd,
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
418
pw->pw_uid, pw->pw_gid, pw->pw_gecos, pw->pw_dir,
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
419
pw->pw_shell);
usr.sbin/rwhod/rwhod.c
294
struct passwd *pw;
usr.sbin/rwhod/rwhod.c
297
pw = getpwnam(UNPRIV_USER);
usr.sbin/rwhod/rwhod.c
298
if (pw == NULL) {
usr.sbin/rwhod/rwhod.c
302
*uid = pw->pw_uid;
usr.sbin/spi/spi.c
815
void *pr, *pw;
usr.sbin/spi/spi.c
821
pw = malloc(icount);
usr.sbin/spi/spi.c
823
if (!pw) {
usr.sbin/spi/spi.c
828
bzero(pw, icount);
usr.sbin/spi/spi.c
832
memcpy(pw, popt->pcmd, popt->ncmd);
usr.sbin/spi/spi.c
843
err = _read_write(hdev, pw, pr, icount, popt->lsb);
usr.sbin/spi/spi.c
851
free(pw);
usr.sbin/spi/spi.c
860
void *pw;
usr.sbin/spi/spi.c
864
pw = prep_write_buffer(popt);
usr.sbin/spi/spi.c
866
if (!pw) {
usr.sbin/spi/spi.c
871
err = _read_write(hdev, pw, NULL, popt->count + popt->ncmd, popt->lsb);
usr.sbin/spi/spi.c
875
free(pw);
usr.sbin/spi/spi.c
884
void *pr, *pw;
usr.sbin/spi/spi.c
888
pw = prep_write_buffer(popt);
usr.sbin/spi/spi.c
891
if (!pw) {
usr.sbin/spi/spi.c
905
err = _read_write(hdev, pw, pr, icount, popt->lsb);
usr.sbin/spi/spi.c
913
free(pw);
usr.sbin/ypldap/ldapclient.c
350
struct passwd *pw;
usr.sbin/ypldap/ldapclient.c
368
if ((pw = getpwnam(YPLDAP_USER)) == NULL)
usr.sbin/ypldap/ldapclient.c
373
ypldap_dns(pipe_dns, pw);
usr.sbin/ypldap/ldapclient.c
377
if (chroot(pw->pw_dir) == -1)
usr.sbin/ypldap/ldapclient.c
389
setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) ||
usr.sbin/ypldap/ldapclient.c
390
setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid))
usr.sbin/ypldap/ypldap.c
502
struct passwd *pw;
usr.sbin/ypldap/ypldap.c
601
if ((pw = getpwnam(YPLDAP_USER)) == NULL)
usr.sbin/ypldap/ypldap.c
606
setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) ||
usr.sbin/ypldap/ypldap.c
607
setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid))
usr.sbin/ypldap/ypldap_dns.c
73
ypldap_dns(int pipe_ntp[2], struct passwd *pw)
usr.sbin/ypldap/ypldap_dns.c
95
setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) ||
usr.sbin/ypldap/ypldap_dns.c
96
setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid))