/openbsd-current/regress/lib/libpthread/pw/ |
H A D | pw.c | 1 /* $OpenBSD: pw.c,v 1.2 2002/06/23 03:11:09 deraadt Exp $ */ 44 struct passwd *pw; local 49 CHECKn(pw = getpwuid(getuid())); 50 printf("getpwuid(%u) => %p\n", getuid(), pw); 53 pw->pw_name, pw->pw_uid, pw->pw_gid, 54 pw->pw_class, pw->pw_gecos, pw [all...] |
H A D | Makefile | 3 PROG= pw
|
/openbsd-current/regress/sys/kern/setuid/ |
H A D | setresgid.c | 25 struct passwd *pw; local 28 if ((pw = getpwnam(_SETUID_REGRESS_USER)) == NULL) 33 if (setresgid(pw->pw_gid, -1, -1) == -1) 35 checkgids(pw->pw_gid, gid, gid, "0"); 54 if (setresgid(-1, pw->pw_gid, -1) == -1) 56 checkgids(gid, pw->pw_gid, gid, "2"); 69 if (setresgid(-1, -1, pw->pw_gid) == -1) 71 checkgids(gid, gid, pw->pw_gid, "4"); 73 if (setresuid(pw->pw_gid, pw [all...] |
H A D | setresuid.c | 25 struct passwd *pw; local 28 if ((pw = getpwnam(_SETUID_REGRESS_USER)) == NULL) 33 if (setresuid(pw->pw_uid, -1, -1) == -1) 35 checkuids(pw->pw_uid, uid, uid, "0"); 54 if (setresuid(-1, pw->pw_uid, -1) == -1) 56 checkuids(uid, pw->pw_uid, uid, "2"); 69 if (setresuid(-1, -1, pw->pw_uid) == -1) 71 checkuids(uid, uid, pw->pw_uid, "4"); 73 if (setresuid(pw->pw_uid, -1, -1) == -1) 75 checkuids(pw [all...] |
H A D | setgid.c | 25 struct passwd *pw; local 27 if ((pw = getpwnam(_SETUID_REGRESS_USER)) == NULL) 35 if (setgid(pw->pw_gid) == -1) 37 checkgids(pw->pw_gid, pw->pw_gid, pw->pw_gid, "setgid");
|
H A D | setuid.c | 25 struct passwd *pw; local 27 if ((pw = getpwnam(_SETUID_REGRESS_USER)) == NULL) 35 if (setuid(pw->pw_uid) == -1) 37 checkuids(pw->pw_uid, pw->pw_uid, pw->pw_uid, "getresuid");
|
H A D | setegid.c | 25 struct passwd *pw; local 30 if ((pw = getpwnam(_SETUID_REGRESS_USER)) == NULL) 33 if (setegid(pw->pw_gid) == -1) 36 if (getegid() != pw->pw_gid)
|
H A D | setgid_child.c | 25 struct passwd *pw; local 29 if ((pw = getpwnam(_SETUID_REGRESS_USER)) == NULL) 32 if (setgid(pw->pw_gid) == -1) 53 checkgids(pw->pw_gid, pw->pw_gid, pw->pw_gid, "setgid child");
|
H A D | setuid_child.c | 25 struct passwd *pw; local 29 if ((pw = getpwnam(_SETUID_REGRESS_USER)) == NULL) 32 if (setuid(pw->pw_uid) == -1) 53 checkuids(pw->pw_uid, pw->pw_uid, pw->pw_uid, "setuid child");
|
/openbsd-current/usr.bin/chpass/ |
H A D | field.c | 48 p_login(char *p, struct passwd *pw, ENTRY *ep) argument 59 if (strcmp(pw->pw_name, p) != 0 && getpwnam(p) != NULL) { 63 if (!(pw->pw_name = strdup(p))) { 78 p_passwd(char *p, struct passwd *pw, ENTRY *ep) argument 81 pw->pw_passwd = ""; /* "NOLOGIN"; */ 82 else if (!(pw->pw_passwd = strdup(p))) { 91 p_uid(char *p, struct passwd *pw, ENTRY *ep) argument 105 pw->pw_uid = id; 110 p_gid(char *p, struct passwd *pw, ENTRY *ep) argument 125 pw 138 p_class(char *p, struct passwd *pw, ENTRY *ep) argument 151 p_change(char *p, struct passwd *pw, ENTRY *ep) argument 160 p_expire(char *p, struct passwd *pw, ENTRY *ep) argument 169 p_gecos(char *p, struct passwd *pw, ENTRY *ep) argument 181 p_hdir(char *p, struct passwd *pw, ENTRY *ep) argument 195 p_shell(char *p, struct passwd *pw, ENTRY *ep) argument [all...] |
H A D | edit.c | 51 edit(char *tempname, struct passwd *pw) argument 66 if (verify(tempname, pw)) 79 display(char *tempname, int fd, struct passwd *pw) argument 89 "# Changing user database information for %s.\n", pw->pw_name); 91 (void)fprintf(fp, "Login: %s\n", pw->pw_name); 92 (void)fprintf(fp, "Encrypted password: %s\n", pw->pw_passwd); 93 (void)fprintf(fp, "Uid [#]: %u\n", pw->pw_uid); 94 (void)fprintf(fp, "Gid [# or name]: %u\n", pw->pw_gid); 96 ttoa(chngstr, sizeof(chngstr), pw->pw_change)); 98 ttoa(chngstr, sizeof(chngstr), pw 129 verify(char *tempname, struct passwd *pw) argument [all...] |
H A D | chpass.c | 64 struct passwd *pw = NULL, *opw = NULL, lpw; local 98 pw = getpwuid_shadow(uid); 99 if (!pw) 103 pw = getpwnam_shadow(*argv); 104 if (!pw) 106 if (uid && uid != pw->pw_uid) 118 pw = &lpw; 119 if (!pw_scan(arg, pw, NULL)) 121 opw = getpwnam_shadow(pw->pw_name); 123 if (opw == NULL && (opw = pw_dup(pw)) [all...] |
/openbsd-current/distrib/special/doas/ |
H A D | doas.c | 42 struct passwd *pw; local 45 if ((pw = getpwnam(s)) != NULL) { 46 *uid = pw->pw_uid; 61 struct passwd *pw; local 94 pw = getpwuid(target); 95 if (!pw) 97 groups[0] = pw->pw_gid; 100 setresgid(pw->pw_gid, pw->pw_gid, pw [all...] |
/openbsd-current/usr.bin/ssh/ |
H A D | uidswap.c | 51 temporarily_use_uid(struct passwd *pw) argument 57 (u_int)pw->pw_uid, (u_int)pw->pw_gid, 70 if (user_groupslen == -1 || user_groups_uid != pw->pw_uid) { 71 if (initgroups(pw->pw_name, pw->pw_gid) == -1) 72 fatal("initgroups: %s: %.100s", pw->pw_name, 77 user_groups_uid = pw->pw_uid; 82 if (setegid(pw->pw_gid) == -1) 83 fatal("setegid %u: %.100s", (u_int)pw 119 permanently_set_uid(struct passwd *pw) argument [all...] |
/openbsd-current/usr.bin/tmux/ |
H A D | cmd-server-access.c | 48 cmd_server_access_deny(struct cmdq_item *item, struct passwd *pw) argument 54 if ((user = server_acl_user_find(pw->pw_uid)) == NULL) { 55 cmdq_error(item, "user %s not found", pw->pw_name); 65 server_acl_user_deny(pw->pw_uid); 77 struct passwd *pw = NULL; local 90 pw = getpwnam(name); 91 if (pw == NULL) { 97 if (pw->pw_uid == 0 || pw->pw_uid == getuid()) { 99 pw [all...] |
/openbsd-current/usr.sbin/smtpd/ |
H A D | table_getpwnam.c | 55 struct passwd *pw; local 62 pw = getpwnam(key); 63 } while (pw == NULL && errno == EINTR); 65 if (pw == NULL) { 74 pw->pw_uid, 75 pw->pw_gid, 76 pw->pw_dir) == -1) {
|
/openbsd-current/usr.sbin/ldpd/ |
H A D | l2vpn.c | 70 struct l2vpn_pw *pw; local 76 while ((pw = LIST_FIRST(&l2vpn->pw_list)) != NULL) { 77 LIST_REMOVE(pw, entry); 78 free(pw); 87 struct l2vpn_pw *pw; local 89 LIST_FOREACH(pw, &l2vpn->pw_list, entry) 90 l2vpn_pw_init(pw); 96 struct l2vpn_pw *pw; local 98 LIST_FOREACH(pw, &l2vpn->pw_list, entry) 99 l2vpn_pw_exit(pw); 135 struct l2vpn_pw *pw; local 161 struct l2vpn_pw *pw; local 176 struct l2vpn_pw *pw; local 186 l2vpn_pw_init(struct l2vpn_pw *pw) argument 198 l2vpn_pw_exit(struct l2vpn_pw *pw) argument 207 l2vpn_pw_fec(struct l2vpn_pw *pw, struct fec *fec) argument 217 l2vpn_pw_reset(struct l2vpn_pw *pw) argument 235 l2vpn_pw_ok(struct l2vpn_pw *pw, struct fec_nh *fnh) argument 287 struct l2vpn_pw *pw; local 375 struct l2vpn_pw *pw; local 415 struct l2vpn_pw *pw; local 461 struct l2vpn_pw *pw; local 492 struct l2vpn_pw *pw; local 515 struct l2vpn_pw *pw; local 566 struct l2vpn_pw *pw; local 575 struct l2vpn_pw *pw; local 582 ldpe_l2vpn_pw_init(struct l2vpn_pw *pw) argument 597 ldpe_l2vpn_pw_exit(struct l2vpn_pw *pw) argument [all...] |
/openbsd-current/usr.bin/id/ |
H A D | id.c | 58 struct passwd *pw; local 137 pw = *argv ? who(*argv) : NULL; 140 if (pw == NULL) 141 pw = getpwuid(getuid()); 142 if (pw != NULL && pw->pw_class != NULL && *pw->pw_class != '\0') 143 (void)printf("%s\n", pw->pw_class); 150 gid = pw ? pw 185 pretty(struct passwd *pw) argument 230 struct passwd *pw; local 269 user(struct passwd *pw) argument 299 group(struct passwd *pw, int nflag) argument 335 struct passwd *pw; local [all...] |
/openbsd-current/lib/libc/gen/ |
H A D | getpwent.c | 59 struct passwd pw; member in struct:pw_storage 65 _THREAD_PRIVATE_KEY(pw); variable 80 size_t buflen, struct passwd *pw, int *); 82 size_t buflen, struct passwd *pw, int *); 98 static int __ypparse(struct passwd *pw, char *s, int); 116 __ypproto_set(struct passwd *pw, struct pw_storage *buf, int flags, argument 120 __ypproto = &buf->pw; 123 if (pw->pw_name && (pw->pw_name)[0]) { 124 bcopy(pw 182 __ypparse(struct passwd *pw, char *s, int yp_pw_flags) argument 310 struct passwd *pw, *ret = NULL; local 557 __yppwlookup(int lookup, char *name, uid_t uid, struct passwd *pw, char *buf, size_t buflen, int *flagsp) argument 700 _pwhashbyname(const char *name, char *buf, size_t buflen, struct passwd *pw, int *flagsp) argument 722 _pwhashbyuid(uid_t uid, char *buf, size_t buflen, struct passwd *pw, int *flagsp) argument 740 getpwnam_internal(const char *name, struct passwd *pw, char *buf, size_t buflen, struct passwd **pwretp, bool shadow, bool reentrant) argument 786 getpwnam_r(const char *name, struct passwd *pw, char *buf, size_t buflen, struct passwd **pwretp) argument 796 struct passwd *pw = NULL; local 810 struct passwd *pw = NULL; local 823 getpwuid_internal(uid_t uid, struct passwd *pw, char *buf, size_t buflen, struct passwd **pwretp, bool shadow, bool reentrant) argument 870 getpwuid_r(uid_t uid, struct passwd *pw, char *buf, size_t buflen, struct passwd **pwretp) argument 880 struct passwd *pw = NULL; local 894 struct passwd *pw = NULL; local 990 __hashpw(DBT *key, char *buf, size_t buflen, struct passwd *pw, int *flagsp) argument [all...] |
H A D | pw_dup.c | 32 if (pw->name) { \ 33 size = strlen(pw->name) + 1; \ 40 if (pw->name) { \ 41 (void)memcpy(cp, pw->name, size); \ 48 pw_dup(const struct passwd *pw) argument 71 (void)memcpy(newpw, pw, sizeof(struct passwd));
|
/openbsd-current/etc/examples/ |
H A D | ldpd.conf | 36 pw-id 100 40 pw-id 100
|
/openbsd-current/gnu/usr.bin/cvs/os2/ |
H A D | pwd.c | 49 static struct passwd pw; /* should we return a malloc()'d structure */ 56 pw.pw_name = getlogin (); 57 pw.pw_dir = home_dir; 58 pw.pw_shell = login_shell; 59 pw.pw_uid = 0; 61 return &pw; 48 static struct passwd pw; /* should we return a malloc()'d structure */ variable in typeref:struct:passwd
|
/openbsd-current/gnu/usr.bin/cvs/windows-NT/ |
H A D | pwd.c | 50 static struct passwd pw; /* should we return a malloc()'d structure */ 57 pw.pw_name = getlogin (); 58 pw.pw_dir = home_dir; 59 pw.pw_shell = login_shell; 60 pw.pw_uid = 0; 62 return &pw; 49 static struct passwd pw; /* should we return a malloc()'d structure */ variable in typeref:struct:passwd
|
/openbsd-current/libexec/lockspool/ |
H A D | lockspool.c | 50 struct passwd *pw; local 74 pw = getpwnam(argv[1]); 76 pw = getpwuid(getuid()); 77 if (pw == NULL) 79 from = pw->pw_name; 81 holdfd = getlock(from, pw);
|
/openbsd-current/libexec/rpc.rusersd/ |
H A D | rusersd.c | 67 struct passwd *pw; local 77 pw = getpwnam("_rusersd"); 78 if (!pw) { 92 setgroups(1, &pw->pw_gid); 93 setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid); 94 setresuid(pw->pw_uid, pw->pw_uid, pw [all...] |