Home
last modified time | relevance | path

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

12345678

/illumos-gate/usr/src/lib/libtecla/common/
H A Dhomedir.c88 struct passwd pwd; /* The password entry of a user */ member
259 status = getpwuid_r(geteuid(), &home->pwd, home->buffer, home->buflen, in _hd_lookup_home_dir()
262 status = getpwnam_r(user, &home->pwd, home->buffer, home->buflen, &ret); in _hd_lookup_home_dir()
271 home_dir = home->pwd.pw_dir; in _hd_lookup_home_dir()
278 struct passwd *pwd = login_user ? getpwuid(geteuid()) : getpwnam(user); in _hd_lookup_home_dir() local
279 if(!pwd) { in _hd_lookup_home_dir()
287 home_dir = pwd->pw_dir; in _hd_lookup_home_dir()
361 struct passwd *pwd; /* A pointer to pwd_buffer */ local
368 &pwd) == 0 && pwd != NULL) {
369 waserr = callback_fn(data, pwd->pw_name, pwd->pw_dir,
[all …]
/illumos-gate/usr/src/lib/passwdutil/
H A Dnis_attr.c79 struct passwd *pwd; member
108 nis_to_pwd(char *nis, struct passwd *pwd) in nis_to_pwd() argument
110 pwd->pw_name = strsep(&nis, ":"); in nis_to_pwd()
111 pwd->pw_passwd = strsep(&nis, ":"); in nis_to_pwd()
112 pwd->pw_uid = atoi(strsep(&nis, ":")); in nis_to_pwd()
113 pwd->pw_gid = atoi(strsep(&nis, ":")); in nis_to_pwd()
114 pwd->pw_gecos = strsep(&nis, ":"); in nis_to_pwd()
115 pwd->pw_dir = strsep(&nis, ":"); in nis_to_pwd()
116 pwd->pw_shell = nis; in nis_to_pwd()
117 if (pwd->pw_shell[0]) in nis_to_pwd()
[all …]
H A Dnss_attr.c67 struct passwd *pwd; member
115 if (pwbuf->pwd == NULL) in nss_getpwnam()
116 pwbuf->pwd = (struct passwd *) in nss_getpwnam()
118 if (pwbuf->pwd == NULL) { in nss_getpwnam()
142 if (pwbuf->pwd) in nss_getpwnam()
143 free(pwbuf->pwd); in nss_getpwnam()
160 if (pwbuf->pwd) { in nss_getpwnam()
165 if (getpwnam_r(name, pwbuf->pwd, pwbuf->pwd_scratch, in nss_getpwnam()
186 struct passwd pwd; in nss_getpwnam() local
190 if (private_getpwnam_r(name, &pwd, pwd_scratch, in nss_getpwnam()
[all …]
H A Dldap_attr.c104 struct passwd *pwd; member
157 if (p->pwd) in free_ldapbuf()
158 free_pwd(p->pwd); in free_ldapbuf()
303 pw = ldapbuf->pwd; in ldap_getattr()
432 res = dup_pw(&ldapbuf->pwd, getpwnam_from(name, rep, REP_LDAP)); in ldap_getpwnam()
559 char *pwd, *val; in ldap_update() local
598 ldapbuf->pwd); in ldap_update()
611 pwd = crypt(p->data.val_s, salt); in ldap_update()
613 cryptlen = strlen(pwd) + sizeof ("{crypt}"); in ldap_update()
618 "{crypt}%s", pwd); in ldap_update()
[all …]
/illumos-gate/usr/src/lib/libpkg/common/
H A Dncgrpw.c184 struct passwd *pwd; in cpwnam() local
205 if ((pwd = clpwnam(nam)) != NULL || in cpwnam()
206 (pwd = getpwnam(nam)) != NULL) { in cpwnam()
208 if (dup_pw_ent(pwd)) in cpwnam()
213 pwd = (struct passwd *)NULL; in cpwnam()
236 (void) memmove(itemp->data, pwd, in cpwnam()
246 return (pwd); in cpwnam()
340 struct passwd *pwd; in cpwuid() local
362 if ((pwd = clpwuid(uid)) != NULL || in cpwuid()
363 (pwd = getpwuid(uid)) != NULL) { in cpwuid()
[all …]
/illumos-gate/usr/src/lib/libnisdb/yptol/
H A Dshim_changepasswd.c382 proc_maps(char *domain, struct passwd_entry *pwd) in proc_maps() argument
391 ans = proc_map_list(map_list, domain, pwd, FALSE); in proc_maps()
411 ans = proc_map_list(map_list, domain, pwd, TRUE); in proc_maps()
433 struct passwd_entry *pwd, bool_t adjunct_flag) in proc_map_list() argument
442 if ((adjunct_flag) && (!pwd->adjunct)) { in proc_map_list()
473 if (0 != (ans = update_single_map(map_name, pwd, adjunct_flag))) in proc_map_list()
534 update_single_map(char *map_name, struct passwd_entry *pwd, bool_t adjunct_flag) in update_single_map() argument
542 data.dptr = pwd->adjunct_str; in update_single_map()
544 data.dptr = pwd->pwd_str; in update_single_map()
550 key.dptr = pwd->pw_name; in update_single_map()
[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.c50 directory_entry_rpc *pent, struct passwd *pwd, struct group *grp,
82 struct passwd *pwd = NULL; in directory_provider_nsswitch_get() local
130 pwd = getpwuid(rid - LOCALRID_UID_MIN); in directory_provider_nsswitch_get()
131 if (pwd == NULL) { in directory_provider_nsswitch_get()
190 pwd = getpwnam(name); in directory_provider_nsswitch_get()
191 if (pwd == NULL && errno != 0) { in directory_provider_nsswitch_get()
227 if (pwd == NULL && grp == NULL) in directory_provider_nsswitch_get()
230 de = directory_provider_nsswitch_populate(&del[i], pwd, grp, 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()
[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.c61 char *pwd; in read_authtok() local
100 res = pam_get_item(pamh, PAM_AUTHTOK, (const void **)&pwd); in read_authtok()
103 if (pwd != NULL) { in read_authtok()
115 dgettext(TEXT_DOMAIN, "New Password: "), &pwd); in read_authtok()
120 if (pwd == NULL) { in read_authtok()
129 (void) memset(pwd, 0, strlen(pwd)); in read_authtok()
130 free(pwd); in read_authtok()
153 char *pwd; in verify_authtok() local
169 "Re-enter new Password: "), &pwd); in verify_authtok()
174 if (strcmp(authtok, pwd) != 0) { in verify_authtok()
[all …]
/illumos-gate/usr/src/cmd/su/
H A Dsu.c141 static void update_audit(struct passwd *pwd);
145 struct passwd pwd; variable
316 if (getpwuid_r(getuid(), &pwd, pwdbuf, sizeof (pwdbuf)) == NULL || in main()
317 pam_set_item(pamh, PAM_AUSER, pwd.pw_name) != PAM_SUCCESS) in main()
351 if (getpwnam_r(nptr, &pwd, pwdbuf, sizeof (pwdbuf)) == NULL) in main()
378 pwd.pw_name, username, ttyn); in main()
388 pwd.pw_name, username, ttyn); in main()
406 syslog(pwd.pw_uid == 0 ? LOG_NOTICE : LOG_INFO, in main()
408 pwd.pw_name, username, ttyn); in main()
413 if ((getpwnam_r(nptr, &pwd, pwdbuf, sizeof (pwdbuf)) == NULL) || in main()
[all …]
/illumos-gate/usr/src/cmd/login/
H A Dlogin.c265 static struct passwd *pwd = NULL; variable
520 if ((pwd = getpwnam(user_name)) == NULL) { in main()
553 if (pwd->pw_uid == 0) { in main()
578 if (di_devperm_login((const char *)ttyn, pwd->pw_uid, pwd->pw_gid, in main()
597 if (setuid(pwd->pw_uid) == -1) { in main()
612 if (pwd->pw_uid == 0) { in main()
746 if ((pwd = getpwnam(user_name)) != NULL) { in log_bad_attempts()
952 if (((pwd = getpwnam(user_name)) == NULL) && in verify_passwd()
1172 if (pwd == NULL || pwd->pw_uid != 0 || zflag != B_FALSE || in check_for_console()
1606 pwd = &nouser; in process_rlogin()
[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/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/cmd-inet/usr.sbin/
H A Din.rexecd.c169 struct passwd *pwd, pw_data; in doit() local
275 pwd = getpwnam_r(user, &pw_data, pwdbuf, sizeof (pwdbuf)); in doit()
276 if (pwd == NULL) { in doit()
341 if (setgid((gid_t)pwd->pw_gid) < 0) { in doit()
348 (void) initgroups(pwd->pw_name, pwd->pw_gid); in doit()
359 if (setuid((uid_t)pwd->pw_uid) < 0) { in doit()
419 if (*pwd->pw_shell == '\0') in doit()
420 pwd->pw_shell = "/bin/sh"; in doit()
424 if (chdir(pwd->pw_dir) < 0) { in doit()
430 if (pwd->pw_uid) 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
284 if (k5_getpwnam_r(luser, &pwx, pwbuf, sizeof(pwbuf), &pwd) != 0) in krb5_kuserok()
286 (void) strncpy(pbuf, pwd->pw_dir, sizeof(pbuf) - 1); in krb5_kuserok()
301 if (krb5_move_ccache(context, principal, pwd)) in krb5_kuserok()
312 princname, uid, pwd->pw_uid, luser); 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.c195 struct passwd pwd; in pam_sm_setcred() local
272 if (getpwnam_r(user, &pwd, pwbuf, sizeof (pwbuf)) == NULL) { in pam_sm_setcred()
342 if (adt_set_user(ah, pwd.pw_uid, pwd.pw_gid, in pam_sm_setcred()
343 pwd.pw_uid, pwd.pw_gid, NULL, in pam_sm_setcred()
354 apwd.pw_uid, pwd.pw_uid); in pam_sm_setcred()
362 if (adt_set_user(ah, pwd.pw_uid, pwd.pw_gid, in pam_sm_setcred()
363 pwd.pw_uid, pwd.pw_gid, termid, ADT_NEW) != 0) { in pam_sm_setcred()
379 pwd.pw_uid); in pam_sm_setcred()
383 if (adt_set_user(ah, pwd.pw_uid, pwd.pw_gid, pwd.pw_uid, in pam_sm_setcred()
384 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
248 nwamd_door_req_action(nwamd_door_arg_t *req, ucred_t *ucr, struct passwd *pwd) in nwamd_door_req_action() argument
273 if (chkauthattr(AUTOCONF_SELECT_AUTH, pwd->pw_name) == 0) { in nwamd_door_req_action()
284 if (chkauthattr(AUTOCONF_WLAN_AUTH, pwd->pw_name) == 0) { in nwamd_door_req_action()
291 if (chkauthattr(AUTOCONF_WRITE_AUTH, pwd->pw_name) == 0) { in nwamd_door_req_action()
[all …]
/illumos-gate/usr/src/cmd/cmd-inet/usr.bin/
H A Dfinger.c128 struct passwd *pwd; /* structure of /etc/passwd stuff */ member
300 p->pwd = NULL; in doall()
303 p->pwd = pwdcopy(pw); in doall()
305 p->name = p->pwd->pw_name; in doall()
348 p->pwd = NULL; in donames()
363 p->pwd = pwdcopy(pw); in donames()
375 if (p->pwd == NULL) { in donames()
376 p->pwd = pwdcopy(pw); in donames()
385 new->pwd = pwdcopy(pw); in donames()
411 if (strncmp((p->pwd != NULL) ? in donames()
[all …]
/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/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/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