| /freebsd/usr.sbin/pw/tests/ |
| H A D | pw_usermod_test.sh | 10 atf_check -s exit:67 -e match:"no such user" ${PW} usermod test 11 atf_check -s exit:0 ${PW} useradd test 12 atf_check -s exit:0 ${PW} usermod test 22 atf_check -s exit:67 -e match:"no such user" ${PW} usermod test -N 23 atf_check -s exit:0 ${PW} useradd test 24 atf_check -s exit:0 -o match:"^test:.*" ${PW} usermod test -N 34 atf_check -s exit:0 ${PW} useradd test -c "Test User,home,123,456" 35 atf_check -s exit:0 ${PW} usermod test -c "Test User,work,123,456" 45 atf_check -s exit:0 ${PW} useradd test -c "Test User,home,123,456" 47 ${PW} usermod test -c "Test User,work,123,456" -N [all …]
|
| H A D | pw_groupmod_test.sh | 10 atf_check -s exit:0 ${PW} addgroup test 11 atf_check -s exit:0 ${PW} groupmod test -m root 14 atf_check -s exit:0 ${PW} groupmod test -d root 24 atf_check -s exit:0 ${PW} addgroup test 25 atf_check -s exit:67 -e match:"does not exist" ${PW} groupmod test -m foo 26 atf_check -s exit:0 ${PW} groupmod test -d foo 35 atf_check -s exit:0 -x ${PW} groupadd test 36 atf_check -s exit:0 -x ${PW} groupmod test -l newgroupname 37 atf_check -s exit:65 -e match:"^pw: unknown group" -x ${PW} groupshow test 47 atf_check -s exit:0 -x ${PW} useradd testuser [all …]
|
| H A D | pw_useradd_test.sh | 9 atf_check -s exit:0 ${PW} useradd test 19 atf_check -s exit:0 -o match:"^test:.*" ${PW} useradd test -N 28 atf_check -s exit:0 ${PW} useradd test -c 'Test User,work!,123,user@example.com' 39 ${PW} useradd test -c "Test User,work,123,456" -N 49 ${PW} useradd test -c "Test User,work,123:456,456" 60 ${PW} useradd test -c "Test User,work,123:456,456" -N 69 atf_check -s exit:0 ${PW} useradd test -d /foo/bar 71 ${PW} usershow test 80 atf_check -s exit:0 ${PW} useradd test -e ${DATE} 82 ${PW} usershow test [all …]
|
| H A D | pw_usershow_test.sh | 8 atf_check -o not-empty ${PW} usershow -a 14 atf_check -o not-empty ${PW} usershow root 22 no_such_user_msg="pw: no such user \`$nonexistent_user'\n" 24 atf_check -e "inline:$no_such_user_msg" -s exit:67 ${PW} usershow \ 26 atf_check -e "inline:$no_such_user_msg" -s exit:67 ${PW} usershow \ 35 no_such_uid_msg="pw: no such uid \`$nonexistent_uid'\n" 37 atf_check -e "inline:$no_such_uid_msg" -s exit:67 ${PW} usershow \ 39 atf_check -e "inline:$no_such_uid_msg" -s exit:67 ${PW} usershow \ 46 atf_check -o not-empty ${PW} usershow -u 0
|
| H A D | pw_groupshow_test.sh | 8 atf_check -o not-empty ${PW} groupshow -a 14 atf_check -o not-empty ${PW} groupshow -g 0 20 atf_check -o not-empty ${PW} groupshow wheel 28 no_such_name_msg="pw: unknown gid \`$nonexistent_gid'\n" 30 atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ 32 atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ 41 no_such_name_msg="pw: unknown group \`$nonexistent_name'\n" 43 atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ 45 atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \
|
| H A D | pw_lock_test.sh | 9 ${PW} useradd test || atf_fail "Creating test user" 10 ${PW} lock test || atf_fail "Locking the user" 13 ${PW} unlock test || atf_fail "Locking the user" 21 ${PW} useradd test || atf_fail "Creating test user" 22 ${PW} lock 1001 || atf_fail "Locking the user" 25 ${PW} unlock 1001 || atf_fail "Unlocking the user" 29 ${PW} useradd -n 1001 || atf_fail "Creating test user" 30 ${PW} lock 1001 || atf_fail "Locking the user" 33 ${PW} unlock 1001 || atf_fail "Unlocking the user"
|
| /freebsd/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 …]
|
| /freebsd/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 …]
|
| /freebsd/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 …]
|
| /freebsd/crypto/openssh/ |
| H A D | uidswap.c | 60 temporarily_use_uid(struct passwd *pw) in temporarily_use_uid() argument 67 (u_int)pw->pw_uid, (u_int)pw->pw_gid, in temporarily_use_uid() 99 if (user_groupslen == -1 || user_groups_uid != pw->pw_uid) { in temporarily_use_uid() 100 if (initgroups(pw->pw_name, pw->pw_gid) == -1) in temporarily_use_uid() 101 fatal("initgroups: %s: %.100s", pw->pw_name, in temporarily_use_uid() 116 user_groups_uid = pw->pw_uid; in temporarily_use_uid() 129 if (setegid(pw->pw_gid) == -1) in temporarily_use_uid() 130 fatal("setegid %u: %.100s", (u_int)pw->pw_gid, in temporarily_use_uid() 132 if (seteuid(pw->pw_uid) == -1) in temporarily_use_uid() 133 fatal("seteuid %u: %.100s", (u_int)pw->pw_uid, in temporarily_use_uid() [all …]
|
| H A D | auth.c | 98 allowed_user(struct ssh *ssh, struct passwd * pw) in allowed_user() argument 105 /* Shouldn't be called if pw is NULL, but better safe than sorry... */ in allowed_user() 106 if (!pw || !pw->pw_name) in allowed_user() 109 if (!options.use_pam && platform_locked_account(pw)) { in allowed_user() 111 pw->pw_name); in allowed_user() 121 char *shell = xstrdup((pw->pw_shell[0] == '\0') ? in allowed_user() 122 _PATH_BSHELL : pw->pw_shell); /* empty = /bin/sh */ in allowed_user() 126 "does not exist", pw->pw_name, shell); in allowed_user() 133 "is not executable", pw->pw_name, shell); in allowed_user() 149 r = match_user(pw->pw_name, hostname, ipaddr, in allowed_user() [all …]
|
| H A D | auth-rhosts.c | 189 auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname, in auth_rhosts2() argument 202 temporarily_use_uid(pw); in auth_rhosts2() 213 pw->pw_dir, rhosts_files[rhosts_file_index]); in auth_rhosts2() 237 if (pw->pw_uid == 0) in auth_rhosts2() 241 client_user, pw->pw_name)) { in auth_rhosts2() 247 client_user, pw->pw_name)) { in auth_rhosts2() 258 if (stat(pw->pw_dir, &st) == -1) { in auth_rhosts2() 260 "no home directory %.200s", pw->pw_name, pw->pw_dir); in auth_rhosts2() 262 "no home directory %.200s", pw->pw_name, pw->pw_dir); in auth_rhosts2() 266 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || in auth_rhosts2() [all …]
|
| /freebsd/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 …]
|
| /freebsd/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 …]
|
| /freebsd/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 …]
|
| /freebsd/usr.sbin/pw/ |
| H A D | pw.conf.5 | 29 .Nm pw.conf 30 .Nd format of the pw.conf configuration file 33 .Pa /etc/pw.conf 35 .Xr pw 8 38 .Xr pw 8 42 .Xr pw 8 50 .Pa /etc/pw.conf 58 .Xr pw 8 126 .Xr pw 8 130 .Xr pw 8 [all …]
|
| /freebsd/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() 77 /* Then just as many characters of the MD5(pw,salt,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() [all …]
|
| /freebsd/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 …]
|
| /freebsd/usr.sbin/bsdconfig/usermgmt/share/ |
| H A D | user.subr | 66 # pw(8) accepts as `date' argument(s); pw(8) requires a leading `+' for the 231 # NB: pw(8) has a ``feature'' wherein `-n name' can be taken as UID 235 if [ "$input" ] && f_quietly pw usershow -n "$input" -u 1337; then 374 local cmd="pw useradd -n '$_user_name'" 395 f_eval_catch $funcname pw '%s -h -' "$cmd" 398 $funcname pw '%s -h 0' "$cmd" 400 f_eval_catch $funcname pw '%s' "$cmd" 416 if f_quietly pw usershow -n "$input" -u 1337; then 484 local cmd="pw useradd -n '$_user_name'" 503 f_eval_catch -k err $funcname pw '%s -h -' "$cmd" [all …]
|
| H A D | group.subr | 82 # NB: pw(8) has a ``feature'' wherein `-n name' can be taken as GID 86 if [ "$input" ] && f_quietly pw groupshow -n "$input" -g 1337; then 165 local cmd="pw groupadd -n '$_group_name'" 172 f_eval_catch $funcname pw '%s -h -' "$cmd" 176 pw '%s -h 0' "$cmd" 178 f_eval_catch $funcname pw '%s' "$cmd" 184 if f_quietly pw groupshow -n "$input" -g 1337; then 212 local cmd="pw groupadd -n '$_group_name'" 219 f_eval_catch -k err $funcname pw '%s -h -' "$cmd" 222 $funcname pw '%s -h 0' "$cmd" 2>&1 ) [all …]
|
| /freebsd/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 …]
|
| /freebsd/contrib/wpa/src/utils/ |
| H A D | ext_password.c | 94 wpa_printf(MSG_ERROR, "EXT PW: mlock failed: %s", in ext_password_alloc() 103 void ext_password_free(struct wpabuf *pw) in ext_password_free() argument 105 if (pw == NULL) in ext_password_free() 107 os_memset(wpabuf_mhead(pw), 0, wpabuf_len(pw)); in ext_password_free() 109 if (munlock(wpabuf_head(pw), wpabuf_len(pw)) < 0) { in ext_password_free() 110 wpa_printf(MSG_ERROR, "EXT PW: munlock failed: %s", in ext_password_free() 114 wpabuf_free(pw); in ext_password_free()
|
| /freebsd/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 …]
|