| /src/usr.bin/id/ |
| H A D | id.c | 69 struct passwd *pw; in main() local 154 pw = *argv ? who(*argv) : NULL; in main() 156 if (Mflag && pw != NULL) in main() 175 id = pw ? pw->pw_gid : rflag ? getgid() : getegid(); in main() 184 id = pw ? pw->pw_uid : rflag ? getuid() : geteuid(); in main() 185 if (nflag && (pw = getpwuid(id))) in main() 186 (void)printf("%s\n", pw->pw_name); in main() 193 dir(pw); in main() 198 group(pw, nflag); in main() 208 pline(pw); in main() [all …]
|
| /src/lib/libc/gen/ |
| H A D | pw_scan.c | 81 __pw_scan(char *bp, struct passwd *pw, int flags) in __pw_scan() argument 91 pw->pw_fields = 0; in __pw_scan() 92 if (!(pw->pw_name = strsep(&bp, ":"))) /* login */ in __pw_scan() 94 root = !strcmp(pw->pw_name, "root"); in __pw_scan() 95 if (pw->pw_name[0] && (pw->pw_name[0] != '+' || pw->pw_name[1] == '\0')) in __pw_scan() 96 pw->pw_fields |= _PWF_NAME; in __pw_scan() 98 if (!(pw->pw_passwd = strsep(&bp, ":"))) /* passwd */ in __pw_scan() 100 if (pw->pw_passwd[0]) in __pw_scan() 101 pw->pw_fields |= _PWF_PASSWD; in __pw_scan() 106 pw->pw_fields |= _PWF_UID; in __pw_scan() [all …]
|
| /src/crypto/openssh/ |
| H A D | uidswap.c | 61 temporarily_use_uid(struct passwd *pw) in temporarily_use_uid() argument 68 (u_int)pw->pw_uid, (u_int)pw->pw_gid, in temporarily_use_uid() 100 if (user_groupslen == -1 || user_groups_uid != pw->pw_uid) { in temporarily_use_uid() 101 if (initgroups(pw->pw_name, pw->pw_gid) == -1) in temporarily_use_uid() 102 fatal("initgroups: %s: %.100s", pw->pw_name, in temporarily_use_uid() 117 user_groups_uid = pw->pw_uid; in temporarily_use_uid() 130 if (setegid(pw->pw_gid) == -1) in temporarily_use_uid() 131 fatal("setegid %u: %.100s", (u_int)pw->pw_gid, in temporarily_use_uid() 133 if (seteuid(pw->pw_uid) == -1) in temporarily_use_uid() 134 fatal("seteuid %u: %.100s", (u_int)pw->pw_uid, in temporarily_use_uid() [all …]
|
| H A D | auth-rhosts.c | 191 auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname, in auth_rhosts2() argument 204 temporarily_use_uid(pw); in auth_rhosts2() 215 pw->pw_dir, rhosts_files[rhosts_file_index]); in auth_rhosts2() 239 if (pw->pw_uid == 0) in auth_rhosts2() 243 client_user, pw->pw_name)) { in auth_rhosts2() 249 client_user, pw->pw_name)) { in auth_rhosts2() 260 if (stat(pw->pw_dir, &st) == -1) { in auth_rhosts2() 262 "no home directory %.200s", pw->pw_name, pw->pw_dir); in auth_rhosts2() 264 "no home directory %.200s", pw->pw_name, pw->pw_dir); in auth_rhosts2() 268 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || in auth_rhosts2() [all …]
|
| H A D | auth.c | 100 allowed_user(struct ssh *ssh, struct passwd * pw) in allowed_user() argument 108 if (!pw || !pw->pw_name) in allowed_user() 111 if (!options.use_pam && platform_locked_account(pw)) { in allowed_user() 113 pw->pw_name); in allowed_user() 123 char *shell = xstrdup((pw->pw_shell[0] == '\0') ? in allowed_user() 124 _PATH_BSHELL : pw->pw_shell); /* empty = /bin/sh */ in allowed_user() 128 "does not exist", pw->pw_name, shell); in allowed_user() 135 "is not executable", pw->pw_name, shell); in allowed_user() 151 r = match_user(pw->pw_name, hostname, ipaddr, in allowed_user() 159 pw->pw_name, hostname); in allowed_user() [all …]
|
| H A D | platform.c | 54 platform_setusercontext(struct passwd *pw) in platform_setusercontext() argument 68 solaris_set_default_project(pw); in platform_setusercontext() 91 if (getluid() == -1 && setluid(pw->pw_uid) == -1) in platform_setusercontext() 102 platform_setusercontext_post_groups(struct passwd *pw) in platform_setusercontext_post_groups() argument 117 irix_setusercontext(pw); in platform_setusercontext_post_groups() 121 aix_usrinfo(pw); in platform_setusercontext_post_groups() 138 if (setpcred(pw->pw_name, creds) == -1) in platform_setusercontext_post_groups() 143 ssh_selinux_setup_exec_context(pw->pw_name); in platform_setusercontext_post_groups() 159 platform_locked_account(struct passwd *pw) in platform_locked_account() argument 162 char *passwd = pw->pw_passwd; in platform_locked_account() [all …]
|
| /src/contrib/netbsd-tests/kernel/arch/amd64/ |
| H A D | t_ptrace_wait.c | 215 struct ptrace_watchpoint pw; in ATF_TC_BODY() local 216 int len = sizeof(pw); in ATF_TC_BODY() 244 pw.pw_index = i; in ATF_TC_BODY() 245 ATF_REQUIRE(ptrace(PT_READ_WATCHPOINT, child, &pw, len) != -1); in ATF_TC_BODY() 248 printf("\t.pw_index=%d\n", pw.pw_index); in ATF_TC_BODY() 249 printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); in ATF_TC_BODY() 250 printf("\t.pw_type=%#x\n", pw.pw_type); in ATF_TC_BODY() 251 printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); in ATF_TC_BODY() 252 printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); in ATF_TC_BODY() 253 printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); in ATF_TC_BODY() [all …]
|
| /src/usr.bin/chpass/ |
| H A D | field.c | 59 p_login(char *p, struct passwd *pw, ENTRY *ep __unused) in p_login() argument 69 if (!(pw->pw_name = strdup(p))) { in p_login() 85 p_passwd(char *p, struct passwd *pw, ENTRY *ep __unused) in p_passwd() argument 87 if (!(pw->pw_passwd = strdup(p))) { in p_passwd() 97 p_uid(char *p, struct passwd *pw, ENTRY *ep __unused) in p_uid() argument 116 pw->pw_uid = id; in p_uid() 122 p_gid(char *p, struct passwd *pw, ENTRY *ep __unused) in p_gid() argument 137 pw->pw_gid = gr->gr_gid; in p_gid() 146 pw->pw_gid = id; in p_gid() 152 p_class(char *p, struct passwd *pw, ENTRY *ep __unused) in p_class() argument [all …]
|
| H A D | edit.c | 61 static int display(const char *tfn, struct passwd *pw); 62 static struct passwd *verify(const char *tfn, struct passwd *pw); 65 edit(const char *tfn, struct passwd *pw) in edit() argument 71 if (display(tfn, pw) == -1) in edit() 78 return (pw_dup(pw)); in edit() 82 if ((npw = verify(tfn, pw)) != NULL) in edit() 102 display(const char *tfn, struct passwd *pw) in display() argument 113 "#Changing user information for %s.\n", pw->pw_name); in display() 115 (void)fprintf(fp, "Login: %s\n", pw->pw_name); in display() 116 (void)fprintf(fp, "Password: %s\n", pw->pw_passwd); in display() [all …]
|
| H A D | chpass.c | 70 struct passwd lpw, *old_pw, *pw; in main() local 80 pw = old_pw = NULL; in main() 132 if ((pw = getpwuid(uid)) == NULL) in main() 136 if ((pw = getpwnam(*argv)) == NULL) in main() 138 if (uid != 0 && uid != pw->pw_uid) in main() 143 if ((pw = pw_dup(pw)) == NULL || in main() 144 (old_pw = pw_dup(pw)) == NULL) in main() 149 if (pw != NULL && (pw->pw_fields & _PWF_SOURCE) == _PWF_NIS) { in main() 163 if (p_shell(arg, pw, (ENTRY *)NULL) == -1) in main() 170 if (p_expire(arg, pw, (ENTRY *)NULL) == -1) in main() [all …]
|
| /src/lib/libutil/ |
| H A D | pw_util.c | 396 pw_make(const struct passwd *pw) in pw_make() argument 400 asprintf(&line, "%s:%s:%ju:%ju:%s:%ju:%ju:%s:%s:%s", pw->pw_name, in pw_make() 401 pw->pw_passwd, (uintmax_t)pw->pw_uid, (uintmax_t)pw->pw_gid, in pw_make() 402 pw->pw_class, (uintmax_t)pw->pw_change, (uintmax_t)pw->pw_expire, in pw_make() 403 pw->pw_gecos, pw->pw_dir, pw->pw_shell); in pw_make() 411 pw_make_v7(const struct passwd *pw) in pw_make_v7() argument 415 asprintf(&line, "%s:*:%ju:%ju:%s:%s:%s", pw->pw_name, in pw_make_v7() 416 (uintmax_t)pw->pw_uid, (uintmax_t)pw->pw_gid, in pw_make_v7() 417 pw->pw_gecos, pw->pw_dir, pw->pw_shell); in pw_make_v7() 426 pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw) in pw_copy() argument [all …]
|
| /src/crypto/heimdal/lib/asn1/ |
| H A D | setchgpw2.asn1 | 40 Req-change-pw ::= SEQUENCE { 41 old-pw[0] UTF8String, 42 new-pw[1] UTF8String OPTIONAL, 47 Rep-change-pw ::= SEQUENCE { 49 new-pw[1] UTF8String OPTIONAL, 53 Err-change-pw ::= SEQUENCE { 57 wont-generate-new-pw(1), 58 old-pw-incorrect(2), 59 new-pw-rejected-geneneric(3), 60 pw-change-too-short(4), [all …]
|
| /src/contrib/libpcap/ |
| H A D | pcap-npf.c | 248 struct pcap_win *pw = p->priv; in pcap_stats_npf() local 264 if (!PacketGetStats(pw->adapter, &bstats)) { in pcap_stats_npf() 309 struct pcap_win *pw = p->priv; in pcap_stats_ex_npf() local 321 if (!PacketGetStatsEx(pw->adapter, &bstats)) { in pcap_stats_ex_npf() 344 struct pcap_win *pw = p->priv; in pcap_setbuff_npf() local 346 if(PacketSetBuff(pw->adapter,dim)==FALSE) in pcap_setbuff_npf() 358 struct pcap_win *pw = p->priv; in pcap_setmode_npf() local 360 if(PacketSetMode(pw->adapter,mode)==FALSE) in pcap_setmode_npf() 373 struct pcap_win *pw = p->priv; in pcap_setmintocopy_npf() local 375 if(PacketSetMinToCopy(pw->adapter, size)==FALSE) in pcap_setmintocopy_npf() [all …]
|
| /src/contrib/openbsm/bin/auditdistd/ |
| H A D | sandbox.c | 70 struct passwd *pw; in sandbox() local 96 pw = getpwnam(user); in sandbox() 97 if (pw == NULL) { in sandbox() 122 if (getgrouplist(user, pw->pw_gid, groups, &ngroups) == -1) { in sandbox() 137 jailst.path = pw->pw_dir; in sandbox() 144 "Unable to jail to directory %s", pw->pw_dir); in sandbox() 152 if (chroot(pw->pw_dir) == -1) { in sandbox() 155 pw->pw_dir); in sandbox() 165 if (setgid(pw->pw_gid) == -1) { in sandbox() 167 (unsigned int)pw->pw_gid); in sandbox() [all …]
|
| /src/lib/libcrypt/ |
| H A D | crypt-md5.c | 45 crypt_md5(const char *pw, const char *salt, char *buffer) in crypt_md5() argument 69 MD5Update(&ctx, (const u_char *)pw, strlen(pw)); in crypt_md5() 79 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5() 81 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5() 83 for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE) in crypt_md5() 91 for (i = strlen(pw); i; i >>= 1) in crypt_md5() 95 MD5Update(&ctx, (const u_char *)pw, 1); in crypt_md5() 112 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5() 120 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5() 125 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5()
|
| /src/sbin/hastd/ |
| H A D | subr.c | 156 struct passwd *pw; in drop_privs() local 167 pw = getpwnam(HAST_USER); in drop_privs() 168 if (pw == NULL) { in drop_privs() 182 jailst.path = pw->pw_dir; in drop_privs() 200 "Unable to jail to directory to %s", pw->pw_dir); in drop_privs() 201 if (chroot(pw->pw_dir) == -1) { in drop_privs() 204 pw->pw_dir); in drop_privs() 213 if (setgid(pw->pw_gid) == -1) { in drop_privs() 215 (unsigned int)pw->pw_gid); in drop_privs() 218 if (setuid(pw->pw_uid) == -1) { in drop_privs() [all …]
|
| /src/contrib/kyua/utils/ |
| H A D | passwd.cpp | 127 const struct ::passwd* pw = ::getpwnam(name.c_str()); in find_user_by_name() local 128 if (pw == NULL) in find_user_by_name() 131 INV(pw->pw_name == name); in find_user_by_name() 132 return user(pw->pw_name, pw->pw_uid, pw->pw_gid); in find_user_by_name() 156 const struct ::passwd* pw = ::getpwuid(uid); in find_user_by_uid() local 157 if (pw == NULL) in find_user_by_uid() 160 INV(pw->pw_uid == uid); in find_user_by_uid() 161 return user(pw->pw_name, pw->pw_uid, pw->pw_gid); in find_user_by_uid()
|
| /src/usr.bin/finger/ |
| H A D | util.c | 58 match(struct passwd *pw, const char *user) in match() argument 63 if (!strcasecmp(pw->pw_name, user)) in match() 70 (void)strncpy(p = tbuf, pw->pw_gecos, sizeof(tbuf)); in match() 81 (void)strncpy(t, pw->pw_name, in match() 148 enter_person(struct passwd *pw) in enter_person() argument 157 key.data = pw->pw_name; in enter_person() 158 key.size = strlen(pw->pw_name); in enter_person() 171 userinfo(pn, pw); in enter_person() 185 struct passwd *pw; in find_person() local 193 if ((pw = getpwnam(name)) && hide(pw)) in find_person() [all …]
|
| H A D | finger.c | 149 struct passwd *pw; in main() local 154 if ((pw = getpwnam(UNPRIV_NAME)) && pw->pw_uid > 0) { in main() 155 if (setgid(pw->pw_gid) != 0) in main() 157 if (setuid(pw->pw_uid) != 0) in main() 223 struct passwd *pw; in loginlist() local 235 if ((pw = getpwnam(user->ut_user)) == NULL) in loginlist() 237 if (hide(pw)) in loginlist() 239 pn = enter_person(pw); in loginlist() 264 struct passwd *pw; in userlist() local 332 if (((pw = getpwnam(*p)) != NULL) && !hide(pw)) in userlist() [all …]
|
| /src/crypto/heimdal/kadmin/ |
| H A D | random_password.c | 50 static void generate_password(char **pw, int num_classes, ...); 54 random_password(char *pw, size_t len) in random_password() argument 61 otp_print_stddict (newkey, pw, len); in random_password() 62 strlwr(pw); in random_password() 70 strlcpy(pw, pass, len); in random_password() 112 generate_password(char **pw, int num_classes, ...) in generate_password() argument 124 *pw = NULL; in generate_password() 138 *pw = malloc(len + 1); in generate_password() 139 if(*pw == NULL) { in generate_password() 149 (*pw)[i] = classes[j].str[RND(rbuf, sizeof(rbuf), &rleft) in generate_password() [all …]
|
| /src/usr.bin/env/ |
| H A D | env.c | 65 struct passwd *pw; in main() local 76 pw = NULL; in main() 137 pw = getpwnam(login_name); in main() 138 if (pw == NULL) { in main() 143 pw = getpwuid(uid); in main() 145 if (pw == NULL) in main() 159 lc = login_getpwclass(pw); in main() 168 setclassenvironment(lc, pw, 1); in main() 169 setclassenvironment(lc, pw, 0); in main() 172 if ((lc = login_getuserclass(pw)) != NULL) { in main() [all …]
|
| /src/contrib/libarchive/libarchive/ |
| H A D | archive_string_sprintf.c | 97 const wchar_t *pw; in archive_string_vsprintf() local 155 pw = va_arg(ap, wchar_t *); in archive_string_vsprintf() 156 if (pw == NULL) in archive_string_vsprintf() 157 pw = L"(null)"; in archive_string_vsprintf() 158 if (archive_string_append_from_wcs(as, pw, in archive_string_vsprintf() 159 wcslen(pw)) != 0 && errno == ENOMEM) in archive_string_vsprintf() 171 pw = va_arg(ap, wchar_t *); in archive_string_vsprintf() 172 if (pw == NULL) in archive_string_vsprintf() 173 pw = L"(null)"; in archive_string_vsprintf() 174 if (archive_string_append_from_wcs(as, pw, in archive_string_vsprintf() [all …]
|
| /src/crypto/openssh/openbsd-compat/ |
| H A D | xcrypt.c | 73 struct passwd *pw; in pick_salt() local 82 while ((pw = getpwent()) != NULL) { in pick_salt() 83 if ((passwd = shadow_pw(pw)) == NULL) in pick_salt() 129 shadow_pw(struct passwd *pw) in shadow_pw() argument 131 char *pw_password = pw->pw_passwd; in shadow_pw() 134 struct spwd *spw = getspnam(pw->pw_name); in shadow_pw() 141 return(get_iaf_password(pw)); in shadow_pw() 146 if (issecure() && (spw = getpwanam(pw->pw_name)) != NULL) in shadow_pw() 149 struct pr_passwd *spw = getprpwnam(pw->pw_name); in shadow_pw()
|
| H A D | port-irix.c | 49 irix_setusercontext(struct passwd *pw) in irix_setusercontext() argument 61 jid = jlimit_startjob(pw->pw_name, pw->pw_uid, "interactive"); in irix_setusercontext() 74 if ((projid = getdfltprojuser(pw->pw_name)) == -1) { in irix_setusercontext() 80 (int)projid, pw->pw_name, strerror(errno)); in irix_setusercontext() 84 debug("Setting sat id to %d", (int) pw->pw_uid); in irix_setusercontext() 85 if (satsetid(pw->pw_uid)) in irix_setusercontext()
|
| /src/usr.sbin/rpc.yppasswdd/ |
| H A D | yppasswdd_server.c | 247 find_domain(struct x_passwd *pw) in find_domain() argument 276 key.data = pw->pw_name; in find_domain() 277 key.size = strlen(pw->pw_name); in find_domain() 285 if (yp_password.pw_uid == (uid_t)pw->pw_uid && in find_domain() 286 yp_password.pw_gid == (gid_t)pw->pw_gid) { in find_domain() 316 update_inplace(struct passwd *pw, char *domain) in update_inplace() argument 336 "%llu", (unsigned long long)pw->pw_uid); in update_inplace() 340 key.data = pw->pw_name; in update_inplace() 341 key.size = strlen(pw->pw_name); in update_inplace() 377 if (strncmp(data.data, pw->pw_name, in update_inplace() [all …]
|