| /freebsd-9-stable/release/picobsd/tinyware/passwd/ |
| D | pw_copy.c | 64 pw_equal(char *buf, struct passwd *pw) in pw_equal() argument 72 return (strcmp(pw->pw_name, buf_pw.pw_name) == 0 in pw_equal() 73 && pw->pw_uid == buf_pw.pw_uid in pw_equal() 74 && pw->pw_gid == buf_pw.pw_gid in pw_equal() 75 && strcmp(pw->pw_class, buf_pw.pw_class) == 0 in pw_equal() 76 && (long)pw->pw_change == (long)buf_pw.pw_change in pw_equal() 77 && (long)pw->pw_expire == (long)buf_pw.pw_expire in pw_equal() 78 && strcmp(pw->pw_gecos, buf_pw.pw_gecos) == 0 in pw_equal() 79 && strcmp(pw->pw_dir, buf_pw.pw_dir) == 0 in pw_equal() 80 && strcmp(pw->pw_shell, buf_pw.pw_shell) == 0); in pw_equal() [all …]
|
| D | local_passwd.c | 76 pw_copy(int ffd, int tfd, struct passwd *pw, struct passwd *old_pw); 96 getnewpasswd(pw, nis) in getnewpasswd() argument 97 struct passwd *pw; in getnewpasswd() 110 (void)printf("Changing local password for %s.\n", pw->pw_name); 112 if (uid && pw->pw_passwd[0] && 113 strcmp(crypt(getpass("Old password:"), pw->pw_passwd), 114 pw->pw_passwd)) { 125 if ((lc = login_getpwclass(pw)) != NULL) { 134 pw->pw_change = time(NULL) + period; 201 struct passwd *pw; local [all …]
|
| /freebsd-9-stable/lib/libc/gen/ |
| D | pw_scan.c | 71 __pw_scan(char *bp, struct passwd *pw, int flags) in __pw_scan() argument 81 pw->pw_fields = 0; in __pw_scan() 82 if (!(pw->pw_name = strsep(&bp, ":"))) /* login */ in __pw_scan() 84 root = !strcmp(pw->pw_name, "root"); in __pw_scan() 85 if (pw->pw_name[0] && (pw->pw_name[0] != '+' || pw->pw_name[1] == '\0')) in __pw_scan() 86 pw->pw_fields |= _PWF_NAME; in __pw_scan() 88 if (!(pw->pw_passwd = strsep(&bp, ":"))) /* passwd */ in __pw_scan() 90 if (pw->pw_passwd[0]) in __pw_scan() 91 pw->pw_fields |= _PWF_PASSWD; in __pw_scan() 96 pw->pw_fields |= _PWF_UID; in __pw_scan() [all …]
|
| /freebsd-9-stable/usr.bin/id/ |
| D | id.c | 75 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 group(pw, nflag); in main() 203 pline(pw); in main() 208 pretty(pw); in main() [all …]
|
| /freebsd-9-stable/usr.bin/chpass/ |
| D | field.c | 66 p_login(char *p, struct passwd *pw, ENTRY *ep __unused) in p_login() argument 76 if (!(pw->pw_name = strdup(p))) { in p_login() 92 p_passwd(char *p, struct passwd *pw, ENTRY *ep __unused) in p_passwd() argument 94 if (!(pw->pw_passwd = strdup(p))) { in p_passwd() 104 p_uid(char *p, struct passwd *pw, ENTRY *ep __unused) in p_uid() argument 123 pw->pw_uid = id; in p_uid() 129 p_gid(char *p, struct passwd *pw, ENTRY *ep __unused) in p_gid() argument 144 pw->pw_gid = gr->gr_gid; in p_gid() 153 pw->pw_gid = id; in p_gid() 159 p_class(char *p, struct passwd *pw, ENTRY *ep __unused) in p_class() argument [all …]
|
| D | edit.c | 68 static int display(const char *tfn, struct passwd *pw); 69 static struct passwd *verify(const char *tfn, struct passwd *pw); 72 edit(const char *tfn, struct passwd *pw) in edit() argument 78 if (display(tfn, pw) == -1) in edit() 85 return (pw_dup(pw)); in edit() 89 if ((npw = verify(tfn, pw)) != NULL) in edit() 109 display(const char *tfn, struct passwd *pw) in display() argument 120 "#Changing user information for %s.\n", pw->pw_name); in display() 122 (void)fprintf(fp, "Login: %s\n", pw->pw_name); in display() 123 (void)fprintf(fp, "Password: %s\n", pw->pw_passwd); in display() [all …]
|
| D | chpass.c | 82 struct passwd lpw, *old_pw, *pw; in main() local 92 pw = old_pw = NULL; in main() 144 if ((pw = getpwuid(uid)) == NULL) in main() 148 if ((pw = getpwnam(*argv)) == NULL) in main() 150 if (uid != 0 && uid != pw->pw_uid) in main() 155 if ((pw = pw_dup(pw)) == NULL || in main() 156 (old_pw = pw_dup(pw)) == NULL) in main() 161 if (pw != NULL && (pw->pw_fields & _PWF_SOURCE) == _PWF_NIS) { in main() 175 if (p_shell(arg, pw, (ENTRY *)NULL) == -1) in main() 182 if (p_expire(arg, pw, (ENTRY *)NULL) == -1) in main() [all …]
|
| /freebsd-9-stable/crypto/openssh/ |
| 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 (initgroups(pw->pw_name, pw->pw_gid) < 0) in temporarily_use_uid() 100 fatal("initgroups: %s: %.100s", pw->pw_name, in temporarily_use_uid() 126 if (setegid(pw->pw_gid) < 0) in temporarily_use_uid() 127 fatal("setegid %u: %.100s", (u_int)pw->pw_gid, in temporarily_use_uid() 129 if (seteuid(pw->pw_uid) == -1) in temporarily_use_uid() 130 fatal("seteuid %u: %.100s", (u_int)pw->pw_uid, in temporarily_use_uid() 200 permanently_set_uid(struct passwd *pw) in permanently_set_uid() argument 207 if (pw == NULL) in permanently_set_uid() [all …]
|
| D | auth.c | 99 allowed_user(struct passwd * pw) in allowed_user() argument 109 if (!pw || !pw->pw_name) in allowed_user() 114 spw = getspnam(pw->pw_name); in allowed_user() 122 passwd = pw->pw_passwd; in allowed_user() 126 passwd = get_iaf_password(pw); in allowed_user() 154 pw->pw_name); in allowed_user() 165 char *shell = xstrdup((pw->pw_shell[0] == '\0') ? in allowed_user() 166 _PATH_BSHELL : pw->pw_shell); /* empty = /bin/sh */ in allowed_user() 170 "does not exist", pw->pw_name, shell); in allowed_user() 177 "is not executable", pw->pw_name, shell); in allowed_user() [all …]
|
| D | auth-rhosts.c | 187 auth_rhosts(struct passwd *pw, const char *client_user) in auth_rhosts() argument 193 return auth_rhosts2(pw, client_user, hostname, ipaddr); in auth_rhosts() 197 auth_rhosts2_raw(struct passwd *pw, const char *client_user, const char *hostname, in auth_rhosts2_raw() argument 209 temporarily_use_uid(pw); in auth_rhosts2_raw() 219 pw->pw_dir, rhosts_files[rhosts_file_index]); in auth_rhosts2_raw() 233 if (pw->pw_uid != 0) { in auth_rhosts2_raw() 235 client_user, pw->pw_name)) { in auth_rhosts2_raw() 241 client_user, pw->pw_name)) { in auth_rhosts2_raw() 251 if (stat(pw->pw_dir, &st) < 0) { in auth_rhosts2_raw() 253 "no home directory %.200s", pw->pw_name, pw->pw_dir); in auth_rhosts2_raw() [all …]
|
| D | auth2-pubkey.c | 160 if (PRIVSEP(user_key_allowed(authctxt->pw, key)) && in userauth_pubkey() 178 if (PRIVSEP(user_key_allowed(authctxt->pw, key))) { in userauth_pubkey() 253 match_principals_file(char *file, struct passwd *pw, struct KeyCert *cert) in match_principals_file() argument 260 temporarily_use_uid(pw); in match_principals_file() 262 if ((f = auth_openprincipals(file, pw, options.strict_modes)) == NULL) { in match_principals_file() 296 if (auth_parse_options(pw, line_opts, in match_principals_file() 315 check_authkeys_file(FILE *f, char *file, Key* key, struct passwd *pw) in check_authkeys_file() argument 363 if (auth_parse_options(pw, key_options, file, in check_authkeys_file() 389 authorized_principals == NULL ? pw->pw_name : NULL, in check_authkeys_file() 392 if (auth_cert_options(key, pw) != 0) { in check_authkeys_file() [all …]
|
| D | md5crypt.c | 51 md5_crypt(const char *pw, const char *salt) in md5_crypt() argument 83 MD5_Update(&ctx, pw, strlen(pw)); in md5_crypt() 93 MD5_Update(&ctx1, pw, strlen(pw)); in md5_crypt() 95 MD5_Update(&ctx1, pw, strlen(pw)); in md5_crypt() 98 for(pl = strlen(pw); pl > 0; pl -= 16) in md5_crypt() 105 for (j = 0, i = strlen(pw); i != 0; i >>= 1) in md5_crypt() 109 MD5_Update(&ctx, pw + j, 1); in md5_crypt() 124 MD5_Update(&ctx1, pw, strlen(pw)); in md5_crypt() 132 MD5_Update(&ctx1, pw, strlen(pw)); in md5_crypt() 137 MD5_Update(&ctx1, pw, strlen(pw)); in md5_crypt()
|
| D | session.c | 172 auth_sock_cleanup_proc(struct passwd *pw) in auth_sock_cleanup_proc() argument 175 temporarily_use_uid(pw); in auth_sock_cleanup_proc() 184 auth_input_request_forwarding(struct passwd * pw) in auth_input_request_forwarding() argument 196 temporarily_use_uid(pw); in auth_input_request_forwarding() 279 setproctitle("%s", authctxt->pw->pw_name); in do_authenticated() 334 s->pw = authctxt->pw; in do_authenticated1() 408 success = auth_input_request_forwarding(s->pw); in do_authenticated1() 421 if (channel_input_port_forward_request(s->pw->pw_uid == 0, in do_authenticated1() 603 cray_init_job(s->pw); /* set up cray jid and tmpdir */ in do_exec_no_pty() 744 cray_init_job(s->pw); /* set up cray jid and tmpdir */ in do_exec_pty() [all …]
|
| D | auth-passwd.c | 83 struct passwd * pw = authctxt->pw; in auth_password() local 90 if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES) in auth_password() 106 HANDLE hToken = cygwin_logon_user(pw, password); in auth_password() 169 struct passwd *pw = authctxt->pw; in sys_auth_passwd() local 173 as = auth_usercheck(pw->pw_name, authctxt->style, "auth-ssh", in sys_auth_passwd() 194 struct passwd *pw = authctxt->pw; in sys_auth_passwd() local 198 char *pw_password = authctxt->valid ? shadow_pw(pw) : pw->pw_passwd; in sys_auth_passwd()
|
| /freebsd-9-stable/lib/libutil/ |
| D | pw_util.c | 401 pw_make(const struct passwd *pw) in pw_make() argument 405 asprintf(&line, "%s:%s:%ju:%ju:%s:%ju:%ju:%s:%s:%s", pw->pw_name, in pw_make() 406 pw->pw_passwd, (uintmax_t)pw->pw_uid, (uintmax_t)pw->pw_gid, in pw_make() 407 pw->pw_class, (uintmax_t)pw->pw_change, (uintmax_t)pw->pw_expire, in pw_make() 408 pw->pw_gecos, pw->pw_dir, pw->pw_shell); in pw_make() 416 pw_make_v7(const struct passwd *pw) in pw_make_v7() argument 420 asprintf(&line, "%s:*:%ju:%ju:%s:%s:%s", pw->pw_name, in pw_make_v7() 421 (uintmax_t)pw->pw_uid, (uintmax_t)pw->pw_gid, in pw_make_v7() 422 pw->pw_gecos, pw->pw_dir, pw->pw_shell); in pw_make_v7() 431 pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw) in pw_copy() argument [all …]
|
| /freebsd-9-stable/sbin/hastd/ |
| D | subr.c | 156 struct passwd *pw; in drop_privs() local 168 pw = getpwnam(HAST_USER); in drop_privs() 169 if (pw == NULL) { in drop_privs() 183 jailst.path = pw->pw_dir; in drop_privs() 201 "Unable to jail to directory to %s", pw->pw_dir); in drop_privs() 202 if (chroot(pw->pw_dir) == -1) { in drop_privs() 205 pw->pw_dir); in drop_privs() 210 gidset[0] = pw->pw_gid; in drop_privs() 213 (unsigned int)pw->pw_gid); in drop_privs() 216 if (setgid(pw->pw_gid) == -1) { in drop_privs() [all …]
|
| /freebsd-9-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-9-stable/contrib/openbsm/bin/auditdistd/ |
| D | sandbox.c | 72 struct passwd *pw; in sandbox() local 98 pw = getpwnam(user); in sandbox() 99 if (pw == NULL) { in sandbox() 124 if (getgrouplist(user, pw->pw_gid, groups, &ngroups) == -1) { in sandbox() 139 jailst.path = pw->pw_dir; in sandbox() 146 "Unable to jail to directory %s", pw->pw_dir); in sandbox() 154 if (chroot(pw->pw_dir) == -1) { in sandbox() 157 pw->pw_dir); in sandbox() 167 if (setgid(pw->pw_gid) == -1) { in sandbox() 169 (unsigned int)pw->pw_gid); in sandbox() [all …]
|
| /freebsd-9-stable/lib/libcrypt/ |
| D | crypt-md5.c | 45 crypt_md5(const char *pw, const char *salt) in crypt_md5() argument 73 MD5Update(&ctx, (const u_char *)pw, strlen(pw)); in crypt_md5() 83 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5() 85 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5() 87 for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE) in crypt_md5() 95 for (i = strlen(pw); i; i >>= 1) in crypt_md5() 99 MD5Update(&ctx, (const u_char *)pw, 1); in crypt_md5() 116 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5() 124 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5() 129 MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); in crypt_md5()
|
| /freebsd-9-stable/usr.bin/finger/ |
| D | util.c | 65 match(struct passwd *pw, const char *user) in match() argument 70 if (!strcasecmp(pw->pw_name, user)) in match() 77 (void)strncpy(p = tbuf, pw->pw_gecos, sizeof(tbuf)); in match() 88 (void)strncpy(t, pw->pw_name, in match() 155 enter_person(struct passwd *pw) in enter_person() argument 164 key.data = pw->pw_name; in enter_person() 165 key.size = strlen(pw->pw_name); in enter_person() 178 userinfo(pn, pw); in enter_person() 192 struct passwd *pw; in find_person() local 200 if ((pw = getpwnam(name)) && hide(pw)) in find_person() [all …]
|
| D | finger.c | 161 struct passwd *pw; in main() local 166 if ((pw = getpwnam(UNPRIV_NAME)) && pw->pw_uid > 0) { in main() 167 if (setgid(pw->pw_gid) != 0) in main() 169 if (setuid(pw->pw_uid) != 0) in main() 235 struct passwd *pw; in loginlist() local 247 if ((pw = getpwnam(user->ut_user)) == NULL) in loginlist() 249 if (hide(pw)) in loginlist() 251 pn = enter_person(pw); in loginlist() 276 struct passwd *pw; in userlist() local 344 if (((pw = getpwnam(*p)) != NULL) && !hide(pw)) in userlist() [all …]
|
| /freebsd-9-stable/crypto/heimdal/kadmin/ |
| D | random_password.c | 52 static void generate_password(char **pw, int num_classes, ...); 56 random_password(char *pw, size_t len) in random_password() argument 63 otp_print_stddict (newkey, pw, len); in random_password() 64 strlwr(pw); in random_password() 72 strlcpy(pw, pass, len); in random_password() 114 generate_password(char **pw, int num_classes, ...) in generate_password() argument 126 *pw = NULL; in generate_password() 140 *pw = malloc(len + 1); in generate_password() 141 if(*pw == NULL) { in generate_password() 151 (*pw)[i] = classes[j].str[RND(rbuf, sizeof(rbuf), &rleft) in generate_password() [all …]
|
| /freebsd-9-stable/usr.bin/chkey/ |
| D | chkey.c | 90 struct passwd *pw; in main() local 130 pw = ypgetpwuid(uid); in main() 132 pw = getpwuid(uid); in main() 134 if (pw == NULL) { in main() 144 pw = getpwuid(0); in main() 145 if (pw == NULL) in main() 152 if (strcmp(crypt(pass, pw->pw_passwd), pw->pw_passwd) != 0) in main() 250 static struct passwd pw; in ypgetpwuid() local 262 pw.pw_passwd = p + 1; in ypgetpwuid() 263 p = strchr(pw.pw_passwd, ':'); in ypgetpwuid() [all …]
|
| /freebsd-9-stable/usr.sbin/rpc.yppasswdd/ |
| D | yppasswdd_server.c | 250 find_domain(struct x_passwd *pw) in find_domain() argument 279 key.data = pw->pw_name; in find_domain() 280 key.size = strlen(pw->pw_name); in find_domain() 288 if (yp_password.pw_uid == (uid_t)pw->pw_uid && in find_domain() 289 yp_password.pw_gid == (gid_t)pw->pw_gid) { in find_domain() 319 update_inplace(struct passwd *pw, char *domain) in update_inplace() argument 338 "%llu", (unsigned long long)pw->pw_uid); in update_inplace() 342 key.data = pw->pw_name; in update_inplace() 343 key.size = strlen(pw->pw_name); in update_inplace() 379 if (strncmp(data.data, pw->pw_name, in update_inplace() [all …]
|
| /freebsd-9-stable/crypto/openssh/openbsd-compat/ |
| D | port-irix.c | 47 irix_setusercontext(struct passwd *pw) in irix_setusercontext() argument 59 jid = jlimit_startjob(pw->pw_name, pw->pw_uid, "interactive"); in irix_setusercontext() 72 if ((projid = getdfltprojuser(pw->pw_name)) == -1) { in irix_setusercontext() 78 (int)projid, pw->pw_name, strerror(errno)); in irix_setusercontext() 82 debug("Setting sat id to %d", (int) pw->pw_uid); in irix_setusercontext() 83 if (satsetid(pw->pw_uid)) in irix_setusercontext()
|