| /freebsd-12-stable/release/picobsd/tinyware/passwd/ |
| D | pw_copy.c | 66 pw_equal(char *buf, struct passwd *pw) in pw_equal() argument 74 return (strcmp(pw->pw_name, buf_pw.pw_name) == 0 in pw_equal() 75 && pw->pw_uid == buf_pw.pw_uid in pw_equal() 76 && pw->pw_gid == buf_pw.pw_gid in pw_equal() 77 && strcmp(pw->pw_class, buf_pw.pw_class) == 0 in pw_equal() 78 && (long)pw->pw_change == (long)buf_pw.pw_change in pw_equal() 79 && (long)pw->pw_expire == (long)buf_pw.pw_expire in pw_equal() 80 && strcmp(pw->pw_gecos, buf_pw.pw_gecos) == 0 in pw_equal() 81 && strcmp(pw->pw_dir, buf_pw.pw_dir) == 0 in pw_equal() 82 && strcmp(pw->pw_shell, buf_pw.pw_shell) == 0); in pw_equal() [all …]
|
| D | local_passwd.c | 78 pw_copy(int ffd, int tfd, struct passwd *pw, struct passwd *old_pw); 98 getnewpasswd(pw, nis) in getnewpasswd() argument 99 struct passwd *pw; in getnewpasswd() 112 (void)printf("Changing local password for %s.\n", pw->pw_name); 114 if (uid && pw->pw_passwd[0] && 115 strcmp(crypt(getpass("Old password:"), pw->pw_passwd), 116 pw->pw_passwd)) { 127 if ((lc = login_getpwclass(pw)) != NULL) { 136 pw->pw_change = time(NULL) + period; 203 struct passwd *pw; local [all …]
|
| /freebsd-12-stable/lib/libc/gen/ |
| D | pw_scan.c | 85 __pw_scan(char *bp, struct passwd *pw, int flags) in __pw_scan() argument 95 pw->pw_fields = 0; in __pw_scan() 96 if (!(pw->pw_name = strsep(&bp, ":"))) /* login */ in __pw_scan() 98 root = !strcmp(pw->pw_name, "root"); in __pw_scan() 99 if (pw->pw_name[0] && (pw->pw_name[0] != '+' || pw->pw_name[1] == '\0')) in __pw_scan() 100 pw->pw_fields |= _PWF_NAME; in __pw_scan() 102 if (!(pw->pw_passwd = strsep(&bp, ":"))) /* passwd */ in __pw_scan() 104 if (pw->pw_passwd[0]) in __pw_scan() 105 pw->pw_fields |= _PWF_PASSWD; in __pw_scan() 110 pw->pw_fields |= _PWF_UID; in __pw_scan() [all …]
|
| /freebsd-12-stable/usr.bin/id/ |
| D | id.c | 80 struct passwd *pw; in main() local 161 pw = *argv ? who(*argv) : NULL; in main() 163 if (Mflag && pw != NULL) in main() 182 id = pw ? pw->pw_gid : rflag ? getgid() : getegid(); in main() 191 id = pw ? pw->pw_uid : rflag ? getuid() : geteuid(); in main() 192 if (nflag && (pw = getpwuid(id))) in main() 193 (void)printf("%s\n", pw->pw_name); in main() 200 group(pw, nflag); in main() 210 pline(pw); in main() 215 pretty(pw); in main() [all …]
|
| /freebsd-12-stable/crypto/openssh/ |
| 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 …]
|
| 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 …]
|
| D | auth.c | 103 allowed_user(struct ssh *ssh, struct passwd * pw) in allowed_user() argument 111 if (!pw || !pw->pw_name) in allowed_user() 114 if (!options.use_pam && platform_locked_account(pw)) { in allowed_user() 116 pw->pw_name); in allowed_user() 126 char *shell = xstrdup((pw->pw_shell[0] == '\0') ? in allowed_user() 127 _PATH_BSHELL : pw->pw_shell); /* empty = /bin/sh */ in allowed_user() 131 "does not exist", pw->pw_name, shell); in allowed_user() 138 "is not executable", pw->pw_name, shell); in allowed_user() 154 r = match_user(pw->pw_name, hostname, ipaddr, in allowed_user() 162 pw->pw_name, hostname); in allowed_user() [all …]
|
| D | platform.c | 99 platform_setusercontext(struct passwd *pw) in platform_setusercontext() argument 113 solaris_set_default_project(pw); in platform_setusercontext() 136 if (getluid() == -1 && setluid(pw->pw_uid) == -1) in platform_setusercontext() 147 platform_setusercontext_post_groups(struct passwd *pw) in platform_setusercontext_post_groups() argument 162 irix_setusercontext(pw); in platform_setusercontext_post_groups() 166 aix_usrinfo(pw); in platform_setusercontext_post_groups() 183 if (setpcred(pw->pw_name, creds) == -1) in platform_setusercontext_post_groups() 188 ssh_selinux_setup_exec_context(pw->pw_name); in platform_setusercontext_post_groups() 204 platform_locked_account(struct passwd *pw) in platform_locked_account() argument 207 char *passwd = pw->pw_passwd; in platform_locked_account() [all …]
|
| /freebsd-12-stable/contrib/netbsd-tests/kernel/arch/amd64/ |
| 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 …]
|
| /freebsd-12-stable/usr.bin/chpass/ |
| D | field.c | 68 p_login(char *p, struct passwd *pw, ENTRY *ep __unused) in p_login() argument 78 if (!(pw->pw_name = strdup(p))) { in p_login() 94 p_passwd(char *p, struct passwd *pw, ENTRY *ep __unused) in p_passwd() argument 96 if (!(pw->pw_passwd = strdup(p))) { in p_passwd() 106 p_uid(char *p, struct passwd *pw, ENTRY *ep __unused) in p_uid() argument 125 pw->pw_uid = id; in p_uid() 131 p_gid(char *p, struct passwd *pw, ENTRY *ep __unused) in p_gid() argument 146 pw->pw_gid = gr->gr_gid; in p_gid() 155 pw->pw_gid = id; in p_gid() 161 p_class(char *p, struct passwd *pw, ENTRY *ep __unused) in p_class() argument [all …]
|
| D | edit.c | 70 static int display(const char *tfn, struct passwd *pw); 71 static struct passwd *verify(const char *tfn, struct passwd *pw); 74 edit(const char *tfn, struct passwd *pw) in edit() argument 80 if (display(tfn, pw) == -1) in edit() 87 return (pw_dup(pw)); in edit() 91 if ((npw = verify(tfn, pw)) != NULL) in edit() 111 display(const char *tfn, struct passwd *pw) in display() argument 122 "#Changing user information for %s.\n", pw->pw_name); in display() 124 (void)fprintf(fp, "Login: %s\n", pw->pw_name); in display() 125 (void)fprintf(fp, "Password: %s\n", pw->pw_passwd); in display() [all …]
|
| D | chpass.c | 84 struct passwd lpw, *old_pw, *pw; in main() local 94 pw = old_pw = NULL; in main() 146 if ((pw = getpwuid(uid)) == NULL) in main() 150 if ((pw = getpwnam(*argv)) == NULL) in main() 152 if (uid != 0 && uid != pw->pw_uid) in main() 157 if ((pw = pw_dup(pw)) == NULL || in main() 158 (old_pw = pw_dup(pw)) == NULL) in main() 163 if (pw != NULL && (pw->pw_fields & _PWF_SOURCE) == _PWF_NIS) { in main() 177 if (p_shell(arg, pw, (ENTRY *)NULL) == -1) in main() 184 if (p_expire(arg, pw, (ENTRY *)NULL) == -1) in main() [all …]
|
| /freebsd-12-stable/lib/libutil/ |
| D | pw_util.c | 399 pw_make(const struct passwd *pw) in pw_make() argument 403 asprintf(&line, "%s:%s:%ju:%ju:%s:%ju:%ju:%s:%s:%s", pw->pw_name, in pw_make() 404 pw->pw_passwd, (uintmax_t)pw->pw_uid, (uintmax_t)pw->pw_gid, in pw_make() 405 pw->pw_class, (uintmax_t)pw->pw_change, (uintmax_t)pw->pw_expire, in pw_make() 406 pw->pw_gecos, pw->pw_dir, pw->pw_shell); in pw_make() 414 pw_make_v7(const struct passwd *pw) in pw_make_v7() argument 418 asprintf(&line, "%s:*:%ju:%ju:%s:%s:%s", pw->pw_name, in pw_make_v7() 419 (uintmax_t)pw->pw_uid, (uintmax_t)pw->pw_gid, in pw_make_v7() 420 pw->pw_gecos, pw->pw_dir, pw->pw_shell); in pw_make_v7() 429 pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw) in pw_copy() argument [all …]
|
| /freebsd-12-stable/contrib/libpcap/ |
| D | pcap-npf.c | 191 struct pcap_win *pw = p->priv; in pcap_stats_npf() local 207 if (!PacketGetStats(pw->adapter, &bstats)) { in pcap_stats_npf() 252 struct pcap_win *pw = p->priv; in pcap_stats_ex_npf() local 264 if (!PacketGetStatsEx(pw->adapter, &bstats)) { in pcap_stats_ex_npf() 282 struct pcap_win *pw = p->priv; in pcap_setbuff_npf() local 284 if(PacketSetBuff(pw->adapter,dim)==FALSE) in pcap_setbuff_npf() 296 struct pcap_win *pw = p->priv; in pcap_setmode_npf() local 298 if(PacketSetMode(pw->adapter,mode)==FALSE) in pcap_setmode_npf() 311 struct pcap_win *pw = p->priv; in pcap_setmintocopy_npf() local 313 if(PacketSetMinToCopy(pw->adapter, size)==FALSE) in pcap_setmintocopy_npf() [all …]
|
| /freebsd-12-stable/contrib/apr/user/unix/ |
| D | userinfo.c | 36 struct passwd *pw, in getpwnam_safe() argument 48 rv = getpwnam_r(username, pw, pwbuf, PWBUF_SIZE, &pwptr); in getpwnam_safe() 60 memcpy(pw, pwptr, sizeof *pw); in getpwnam_safe() 73 struct passwd pw; in apr_uid_homepath_get() local 77 if ((rv = getpwnam_safe(username, &pw, pwbuf)) != APR_SUCCESS) in apr_uid_homepath_get() 82 *dirname = apr_pstrcat(p, pw.pw_dir, pw.pw_name, NULL); in apr_uid_homepath_get() 84 *dirname = apr_pstrdup(p, pw.pw_dir); in apr_uid_homepath_get() 107 struct passwd pw; in apr_uid_get() local 111 if ((rv = getpwnam_safe(username, &pw, pwbuf)) != APR_SUCCESS) in apr_uid_get() 114 *uid = pw.pw_uid; in apr_uid_get() [all …]
|
| /freebsd-12-stable/crypto/heimdal/lib/asn1/ |
| 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 …]
|
| /freebsd-12-stable/contrib/openbsm/bin/auditdistd/ |
| 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 …]
|
| /freebsd-12-stable/lib/libcrypt/ |
| D | crypt-md5.c | 47 crypt_md5(const char *pw, const char *salt, char *buffer) in crypt_md5() argument 71 MD5Update(&ctx, (const u_char *)pw, strlen(pw)); in crypt_md5() 81 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5() 83 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5() 85 for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE) in crypt_md5() 93 for (i = strlen(pw); i; i >>= 1) in crypt_md5() 97 MD5Update(&ctx, (const u_char *)pw, 1); in crypt_md5() 114 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5() 122 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5() 127 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5()
|
| /freebsd-12-stable/sbin/hastd/ |
| D | subr.c | 159 struct passwd *pw; in drop_privs() local 171 pw = getpwnam(HAST_USER); in drop_privs() 172 if (pw == NULL) { in drop_privs() 186 jailst.path = pw->pw_dir; in drop_privs() 204 "Unable to jail to directory to %s", pw->pw_dir); in drop_privs() 205 if (chroot(pw->pw_dir) == -1) { in drop_privs() 208 pw->pw_dir); in drop_privs() 213 gidset[0] = pw->pw_gid; in drop_privs() 216 (unsigned int)pw->pw_gid); in drop_privs() 219 if (setgid(pw->pw_gid) == -1) { in drop_privs() [all …]
|
| /freebsd-12-stable/usr.bin/finger/ |
| D | util.c | 67 match(struct passwd *pw, const char *user) in match() argument 72 if (!strcasecmp(pw->pw_name, user)) in match() 79 (void)strncpy(p = tbuf, pw->pw_gecos, sizeof(tbuf)); in match() 90 (void)strncpy(t, pw->pw_name, in match() 157 enter_person(struct passwd *pw) in enter_person() argument 166 key.data = pw->pw_name; in enter_person() 167 key.size = strlen(pw->pw_name); in enter_person() 180 userinfo(pn, pw); in enter_person() 194 struct passwd *pw; in find_person() local 202 if ((pw = getpwnam(name)) && hide(pw)) in find_person() [all …]
|
| D | finger.c | 164 struct passwd *pw; in main() local 169 if ((pw = getpwnam(UNPRIV_NAME)) && pw->pw_uid > 0) { in main() 170 if (setgid(pw->pw_gid) != 0) in main() 172 if (setuid(pw->pw_uid) != 0) in main() 238 struct passwd *pw; in loginlist() local 250 if ((pw = getpwnam(user->ut_user)) == NULL) in loginlist() 252 if (hide(pw)) in loginlist() 254 pn = enter_person(pw); in loginlist() 279 struct passwd *pw; in userlist() local 347 if (((pw = getpwnam(*p)) != NULL) && !hide(pw)) in userlist() [all …]
|
| /freebsd-12-stable/crypto/heimdal/kadmin/ |
| 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 …]
|
| /freebsd-12-stable/usr.bin/env/ |
| D | env.c | 80 struct passwd *pw; in main() local 90 pw = NULL; in main() 147 pw = getpwnam(login_name); in main() 148 if (pw == NULL) { in main() 153 pw = getpwuid(uid); in main() 155 if (pw == NULL) in main() 163 lc = login_getpwclass(pw); in main() 172 setclassenvironment(lc, pw, 1); in main() 173 setclassenvironment(lc, pw, 0); in main() 176 if ((lc = login_getuserclass(pw)) != NULL) { in main() [all …]
|
| /freebsd-12-stable/contrib/libarchive/libarchive/ |
| D | archive_string_sprintf.c | 98 const wchar_t *pw; in archive_string_vsprintf() local 148 pw = va_arg(ap, wchar_t *); in archive_string_vsprintf() 149 if (pw == NULL) in archive_string_vsprintf() 150 pw = L"(null)"; in archive_string_vsprintf() 151 if (archive_string_append_from_wcs(as, pw, in archive_string_vsprintf() 152 wcslen(pw)) != 0 && errno == ENOMEM) in archive_string_vsprintf() 164 pw = va_arg(ap, wchar_t *); in archive_string_vsprintf() 165 if (pw == NULL) in archive_string_vsprintf() 166 pw = L"(null)"; in archive_string_vsprintf() 167 if (archive_string_append_from_wcs(as, pw, in archive_string_vsprintf() [all …]
|
| /freebsd-12-stable/usr.bin/chkey/ |
| D | chkey.c | 90 struct passwd *pw; in main() local 133 pw = ypgetpwuid(uid); in main() 135 pw = getpwuid(uid); in main() 137 if (pw == NULL) { in main() 147 pw = getpwuid(0); in main() 148 if (pw == NULL) in main() 155 cryptpw = crypt(pass, pw->pw_passwd); in main() 156 if (cryptpw == NULL || strcmp(cryptpw, pw->pw_passwd) != 0) in main() 254 static struct passwd pw; in ypgetpwuid() local 266 pw.pw_passwd = p + 1; in ypgetpwuid() [all …]
|