Home
last modified time | relevance | path

Searched refs:pwd (Results 1 – 25 of 181) sorted by relevance

12345678

/illumos-gate/usr/src/lib/libtecla/common/
H A Dhomedir.c279 if(!pwd) { in _hd_lookup_home_dir()
287 home_dir = pwd->pw_dir; in _hd_lookup_home_dir()
368 &pwd) == 0 && pwd != NULL) {
369 waserr = callback_fn(data, pwd->pw_name, pwd->pw_dir,
376 &pwd) == 0 && pwd != NULL &&
378 waserr = callback_fn(data, pwd->pw_name, pwd->pw_dir,
404 waserr = callback_fn(data, pwd->pw_name, pwd->pw_dir,
419 if(pwd) {
465 if(pwd && cwd && stat(cwd, &cwdstat)==0 && stat(pwd, &pwdstat)==0 &&
467 return pwd;
[all …]
/illumos-gate/usr/src/lib/passwdutil/
H A Dnis_attr.c77 struct passwd *pwd; member
114 pwd->pw_shell = nis; in nis_to_pwd()
115 if (pwd->pw_shell[0]) in nis_to_pwd()
116 pwd->pw_shell[strlen(pwd->pw_shell)-1] = '\0'; in nis_to_pwd()
178 free(buf->pwd); in nis_user_to_authenticate()
202 pw = nisbuf->pwd; in nis_getattr()
271 free(nisbuf->pwd); in nis_getattr()
309 free(nisbuf->pwd); in nis_getpwnam()
319 free(nisbuf->pwd); in nis_getpwnam()
397 nisbuf->pwd->pw_passwd, nisbuf->pwd); in nis_update()
[all …]
H A Dnss_attr.c66 struct passwd *pwd; member
113 if (pwbuf->pwd == NULL) in nss_getpwnam()
114 pwbuf->pwd = (struct passwd *) in nss_getpwnam()
116 if (pwbuf->pwd == NULL) { in nss_getpwnam()
140 if (pwbuf->pwd) in nss_getpwnam()
141 free(pwbuf->pwd); in nss_getpwnam()
158 if (pwbuf->pwd) { in nss_getpwnam()
184 struct passwd pwd; in nss_getpwnam() local
202 if (pwbuf->pwd) free(pwbuf->pwd); in nss_getpwnam()
231 pw = pwbuf->pwd; in nss_getattr()
[all …]
H A Dldap_attr.c102 struct passwd *pwd; member
155 if (p->pwd) in free_ldapbuf()
156 free_pwd(p->pwd); in free_ldapbuf()
301 pw = ldapbuf->pwd; in ldap_getattr()
557 char *pwd, *val; in ldap_update() local
596 ldapbuf->pwd); in ldap_update()
708 pwd = malloc(len); in ldap_update()
709 if (pwd == NULL) { in ldap_update()
716 spw->sp_pwdp = pwd; in ldap_update()
735 pwd = malloc(len); in ldap_update()
[all …]
/illumos-gate/usr/src/lib/libpkg/common/
H A Dncgrpw.c184 struct passwd *pwd; in cpwnam() local
246 return (pwd); in cpwnam()
399 return (pwd); in cpwuid()
500 if (pwd) { in dup_pw_ent()
506 } else if ((pwd->pw_name = strdup(pwd->pw_name)) == NULL) { in dup_pw_ent()
517 } else if ((pwd->pw_passwd = strdup(pwd->pw_passwd)) == NULL) { in dup_pw_ent()
528 } else if ((pwd->pw_age = strdup(pwd->pw_age)) == NULL) { in dup_pw_ent()
539 } else if ((pwd->pw_comment = strdup(pwd->pw_comment)) == in dup_pw_ent()
551 } else if ((pwd->pw_gecos = strdup(pwd->pw_gecos)) == NULL) { in dup_pw_ent()
562 } else if ((pwd->pw_dir = strdup(pwd->pw_dir)) == NULL) { in dup_pw_ent()
[all …]
/illumos-gate/usr/src/lib/libnisdb/yptol/
H A Dshim_changepasswd.c816 sfree(pwd->pw_name); in decode_pwd_entry()
818 pwd->pw_name = temp; in decode_pwd_entry()
828 pwd->pw_passwd = temp; in decode_pwd_entry()
839 pwd->adjunct = TRUE; in decode_pwd_entry()
941 sfree(pwd->pw_name); in free_pwd_entry()
947 sfree(pwd->pw_gecos); in free_pwd_entry()
953 sfree(pwd->pw_dir); in free_pwd_entry()
959 sfree(pwd->pwd_str); in free_pwd_entry()
965 sfree(pwd); in free_pwd_entry()
1013 if (pwd->adjunct) { in create_pwd_str()
[all …]
/illumos-gate/usr/src/cmd/bnu/
H A Dgetpwinfo.c50 register struct passwd *pwd; local
55 pwd = getpwnam(login_name);
56 if (pwd != NULL && pwd->pw_uid == uid)
61 if ((pwd = getpwuid(uid)) == NULL) {
62 if ((pwd = getpwuid(UUCPUID)) == NULL)
68 (void) strcpy(name, pwd->pw_name);
86 register struct passwd *pwd; local
88 if ((pwd = getpwnam(name)) == NULL) {
94 (void) strcpy(path, pwd->pw_dir);
95 *uid = pwd->pw_uid;
/illumos-gate/usr/src/cmd/idmap/idmapd/
H A Ddirectory_provider_nsswitch.c82 struct passwd *pwd = NULL; in directory_provider_nsswitch_get() local
131 if (pwd == NULL) { in directory_provider_nsswitch_get()
190 pwd = getpwnam(name); in directory_provider_nsswitch_get()
227 if (pwd == NULL && grp == NULL) in directory_provider_nsswitch_get()
250 struct passwd *pwd, in directory_provider_nsswitch_populate() argument
262 if (pwd != NULL && grp != NULL) { in directory_provider_nsswitch_populate()
297 if (pwd != NULL) { in directory_provider_nsswitch_populate()
302 const char *p = pwd->pw_name; in directory_provider_nsswitch_populate()
317 const char *p = pwd->pw_gecos; in directory_provider_nsswitch_populate()
332 const char *p = pwd->pw_name; in directory_provider_nsswitch_populate()
[all …]
/illumos-gate/usr/src/lib/libcmdutils/common/
H A Duid.c52 struct passwd *pwd; in findnextuid() local
56 for (pwd = getpwent(); pwd != NULL; pwd = getpwent()) { in findnextuid()
57 if (isreserveduid(pwd->pw_uid)) /* Skip reserved IDs */ in findnextuid()
59 if (pwd->pw_uid >= uid) { in findnextuid()
60 if (pwd->pw_uid == stop) { /* Overflow check */ in findnextuid()
64 uid = pwd->pw_uid + 1; in findnextuid()
67 if (pwd == NULL && errno != 0) { in findnextuid()
/illumos-gate/usr/src/lib/pam_modules/authtok_get/
H A Dauthtok_get.c59 char *pwd; in read_authtok() local
101 if (pwd != NULL) { in read_authtok()
118 if (pwd == NULL) { in read_authtok()
127 (void) memset(pwd, 0, strlen(pwd)); in read_authtok()
128 free(pwd); in read_authtok()
151 char *pwd; in verify_authtok() local
172 if (strcmp(authtok, pwd) != 0) { in verify_authtok()
181 (void) memset(pwd, 0, strlen(pwd)); in verify_authtok()
182 free(pwd); in verify_authtok()
190 (void) memset(pwd, 0, strlen(pwd)); in verify_authtok()
[all …]
/illumos-gate/usr/src/cmd/su/
H A Dsu.c144 struct passwd pwd; variable
445 update_audit(&pwd); in main()
453 uid = pwd.pw_uid; in main()
454 gid = pwd.pw_gid; in main()
455 dir = strdup(pwd.pw_dir); in main()
457 name = strdup(pwd.pw_name); in main()
829 if (adt_set_user(ah, pwd->pw_uid, pwd->pw_gid, pwd->pw_uid, in audit_success()
1040 if (pwd != NULL) { in audit_failure()
1042 if (adt_set_user(ah, pwd->pw_uid, pwd->pw_gid, pwd->pw_uid, in audit_failure()
1060 if (pwd == NULL) { in audit_failure()
[all …]
/illumos-gate/usr/src/tools/cscope-fast/
H A Dmygetwd.c45 char *pwd; /* PWD environment variable value */ in mygetwd() local
55 if ((pwd = getenv("PWD")) != NULL && *pwd != '\0' && in mygetwd()
56 stat(pwd, &tmp_sb) == 0 && in mygetwd()
58 (void) strcpy(dir, pwd); in mygetwd()
59 return (pwd); in mygetwd()
/illumos-gate/usr/src/cmd/login/
H A Dlogin.c551 if (pwd->pw_uid == 0) { in main()
576 if (di_devperm_login((const char *)ttyn, pwd->pw_uid, pwd->pw_gid, in main()
610 if (pwd->pw_uid == 0) { in main()
1171 if (pwd == NULL || pwd->pw_uid != 0 || zflag != B_FALSE || in check_for_console()
1605 pwd = &nouser; in process_rlogin()
1612 if (pwd == NULL) { in process_rlogin()
1613 pwd = &nouser; in process_rlogin()
1761 pwd->pw_dir = "/"; in chdir_to_dir_user()
1994 while (pwd->pw_gecos[i] >= '0' && pwd->pw_gecos[i] <= '9') in adjust_nice()
2278 pwd->pw_shell = SHELL; in establish_user_environment()
[all …]
H A Dlogin_audit.c59 audit_success(uint_t event_id, struct passwd *pwd, char *optional_text) in audit_success() argument
65 assert(pwd != NULL); in audit_success()
71 if (adt_set_user(ah, pwd->pw_uid, pwd->pw_gid, in audit_success()
72 pwd->pw_uid, pwd->pw_gid, NULL, ADT_USER)) { in audit_success()
206 audit_failure(uint_t event_id, int failure_code, struct passwd *pwd, in audit_failure() argument
220 if (pwd != NULL) { in audit_failure()
221 uid = pwd->pw_uid; in audit_failure()
222 gid = pwd->pw_gid; in audit_failure()
/illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/
H A Din.rexecd.c167 struct passwd *pwd, pw_data; in doit() local
274 if (pwd == NULL) { in doit()
339 if (setgid((gid_t)pwd->pw_gid) < 0) { in doit()
346 (void) initgroups(pwd->pw_name, pwd->pw_gid); in doit()
417 if (*pwd->pw_shell == '\0') in doit()
418 pwd->pw_shell = "/bin/sh"; in doit()
422 if (chdir(pwd->pw_dir) < 0) { in doit()
428 if (pwd->pw_uid) in doit()
456 cp = rindex(pwd->pw_shell, '/'); in doit()
460 cp = pwd->pw_shell; in doit()
[all …]
/illumos-gate/usr/src/lib/gss_mechs/mech_krb5/krb5/os/
H A Dkuserok.c88 struct passwd *pwd) in krb5_move_ccache() argument
164 "FILE:/tmp/krb5cc_%d", pwd->pw_uid); in krb5_move_ccache()
189 "/tmp/krb5cc_%d", pwd->pw_uid); in krb5_move_ccache()
190 if (safechown(ccache_name_buf, pwd->pw_uid, in krb5_move_ccache()
191 pwd->pw_gid, -1) == -1) { in krb5_move_ccache()
269 struct passwd *pwd; in krb5_kuserok() local
301 if (krb5_move_ccache(context, principal, pwd)) in krb5_kuserok()
312 princname, uid, pwd->pw_uid, luser); in krb5_kuserok()
315 if (uid == pwd->pw_uid) { in krb5_kuserok()
316 if (krb5_move_ccache(context, principal, pwd)) in krb5_kuserok()
[all …]
/illumos-gate/usr/src/lib/krb5/plugins/kdb/ldap/libkdb_ldap/
H A Dldap_service_stash.c236 int dec_password(struct data pwd, struct data *ret) { in dec_password() argument
243 if (pwd.len == 0) { in dec_password()
250 if (pwd.len >= strlen("{HEX}") && in dec_password()
251 strncmp((char *)pwd.value, "{HEX}", strlen("{HEX}")) == 0) { in dec_password()
253 if ((pwd.len - strlen("{HEX}")) % 2 != 0) { in dec_password()
259 ret->value = (unsigned char *)malloc((pwd.len - strlen("{HEX}")) / 2 + 1); in dec_password()
265 ret->len = (pwd.len - strlen("{HEX}")) / 2; in dec_password()
267 for (i = strlen("{HEX}"), j = 0; i < pwd.len; i += 2, j++) { in dec_password()
270 if (isxdigit(pwd.value[i]) == 0 || isxdigit(pwd.value[i + 1]) == 0) { in dec_password()
275 sscanf((char *)pwd.value + i, "%2x", &k); in dec_password()
/illumos-gate/usr/src/lib/libbsm/common/
H A Daudit_rshd.c107 struct passwd *pwd; in generate_record() local
114 pwd = getpwnam(locuser); in generate_record()
115 if (pwd == NULL) { in generate_record()
119 uid = pwd->pw_uid; in generate_record()
120 gid = pwd->pw_gid; in generate_record()
205 struct passwd *pwd; in setup_session() local
207 pwd = getpwnam(locuser); in setup_session()
208 if (pwd == NULL) in setup_session()
211 uid = pwd->pw_uid; in setup_session()
H A Daudit_rexecd.c142 struct passwd *pwd; local
166 pwd = getpwnam(user);
167 if (pwd == NULL) {
171 uid = pwd->pw_uid;
172 gid = pwd->pw_gid;
253 struct passwd *pwd; local
277 pwd = getpwnam(user);
278 if (pwd == NULL) {
282 uid = pwd->pw_uid;
283 gid = pwd->pw_gid;
/illumos-gate/usr/src/lib/pam_modules/unix_cred/
H A Dunix_cred.c193 struct passwd pwd; in pam_sm_setcred() local
270 if (getpwnam_r(user, &pwd, pwbuf, sizeof (pwbuf)) == NULL) { in pam_sm_setcred()
340 if (adt_set_user(ah, pwd.pw_uid, pwd.pw_gid, in pam_sm_setcred()
341 pwd.pw_uid, pwd.pw_gid, NULL, in pam_sm_setcred()
352 apwd.pw_uid, pwd.pw_uid); in pam_sm_setcred()
360 if (adt_set_user(ah, pwd.pw_uid, pwd.pw_gid, in pam_sm_setcred()
361 pwd.pw_uid, pwd.pw_gid, termid, ADT_NEW) != 0) { in pam_sm_setcred()
377 pwd.pw_uid); in pam_sm_setcred()
381 if (adt_set_user(ah, pwd.pw_uid, pwd.pw_gid, pwd.pw_uid, in pam_sm_setcred()
382 pwd.pw_gid, NULL, ADT_UPDATE) != 0) { in pam_sm_setcred()
[all …]
/illumos-gate/usr/src/cmd/cmd-inet/lib/nwamd/
H A Ddoor_if.c129 struct passwd *pwd) in nwamd_door_req_event_register() argument
147 struct passwd *pwd) in nwamd_door_req_event_unregister() argument
157 struct passwd *pwd) in nwamd_door_req_wlan_scan() argument
169 struct passwd *pwd) in nwamd_door_req_wlan_scan_results() argument
211 struct passwd *pwd) in nwamd_door_req_wlan_select() argument
230 struct passwd *pwd) in nwamd_door_req_wlan_set_key() argument
284 if (chkauthattr(AUTOCONF_WLAN_AUTH, pwd->pw_name) == 0) { in nwamd_door_req_action()
520 struct passwd *pwd) in nwamd_door_req_priority_group() argument
541 struct passwd *pwd = NULL; in nwamd_door_switch() local
558 if ((pwd = getpwuid(uid)) == NULL) { in nwamd_door_switch()
[all …]
/illumos-gate/usr/src/cmd/cmd-inet/usr.bin/
H A Dfinger.c300 p->pwd = NULL; in doall()
303 p->pwd = pwdcopy(pw); in doall()
348 p->pwd = NULL; in donames()
363 p->pwd = pwdcopy(pw); in donames()
375 if (p->pwd == NULL) { in donames()
431 new->pwd = p->pwd; in donames()
490 if (p->pwd != NULL && !AlreadyPrinted(p->pwd->pw_uid)) { in print()
589 if (pers->pwd == NULL) { in shortprint()
640 if (pers->pwd == NULL) { in personprint()
700 if (pers->pwd == NULL) in decode()
[all …]
/illumos-gate/usr/src/cmd/tsol/updatehome/
H A Dupdatehome.c101 struct passwd *pwd; /* current user's password file entry */ in main() local
154 if ((pwd = getpwuid(uid)) == (struct passwd *)0) { in main()
164 if (((userp = getusernam(pwd->pw_name)) == NULL) || in main()
179 " user %s.\n"), pwd->pw_name); in main()
184 if (__setupfiles(pwd, min_sl, flags) != 0) { in main()
/illumos-gate/usr/src/lib/pam_modules/unix_session/
H A Dunix_session.c92 struct passwd pwd; in pam_sm_open_session() local
128 if (getpwnam_r(user, &pwd, buffer, sizeof (buffer)) == NULL) { in pam_sm_open_session()
137 offset = (offset_t)pwd.pw_uid * in pam_sm_open_session()
143 "too large", pwd.pw_uid); in pam_sm_open_session()
184 "lastlog: uid %d: %m", pwd.pw_uid); in pam_sm_open_session()
187 "lastlog: uid %d: %m", pwd.pw_uid); in pam_sm_open_session()
/illumos-gate/usr/src/cmd/pfexecd/
H A Dpfexecd.c205 struct passwd *pwd, pwdm; in get_uid() local
208 if (getpwnam_r(v, &pwdm, buf, sizeof (buf), &pwd) == 0 && pwd != NULL) in get_uid()
209 return (pwd->pw_uid); in get_uid()
280 struct passwd *pwd, pwdm; in get_granted_privs() local
283 if (getpwuid_r(uid, &pwdm, buf, sizeof (buf), &pwd) != 0 || pwd == NULL) in get_granted_privs()
292 (void) _enum_profs(pwd->pw_name, ggp_callback, NULL, res); in get_granted_privs()
356 struct passwd pw, *pwd; in callback_pfexec() local
381 if (getpwuid_r(uuid, &pw, buf, sizeof (buf), &pwd) != 0 || pwd == NULL) in callback_pfexec()
384 exec = getexecuser(pwd->pw_name, KV_COMMAND, path, GET_ONE); in callback_pfexec()
388 exec = getexecuser(pwd->pw_name, KV_COMMAND, path, GET_ONE); in callback_pfexec()

12345678