Searched refs:pw (Results 51 - 75 of 274) sorted by relevance

1234567891011

/openbsd-current/libexec/rpc.rstatd/
H A Drstatd.c66 struct passwd *pw; local
72 if ((pw = getpwnam("_rstatd")) == NULL) {
82 setgroups(1, &pw->pw_gid);
83 setegid(pw->pw_gid);
84 setgid(pw->pw_gid);
85 seteuid(pw->pw_uid);
86 setuid(pw->pw_uid);
/openbsd-current/usr.bin/finger/
H A Dfinger.c168 struct passwd *pw; local
181 if ((pw = getpwnam(name)) == NULL)
183 pn = enter_person(pw);
199 struct passwd *pw; local
233 if (used[i] >= 0 && (pw = getpwnam(argv[i]))) {
234 enter_person(pw);
237 } else while ((pw = getpwent()) != NULL)
240 (!strcasecmp(pw->pw_name, argv[i]) ||
241 match(pw, argv[i]))) {
242 enter_person(pw);
[all...]
H A Dutil.c86 userinfo(PERSON *pn, struct passwd *pw) argument
96 pn->uid = pw->pw_uid;
97 pn->name = estrdup(pw->pw_name);
98 pn->dir = estrdup(pw->pw_dir);
99 pn->shell = estrdup(pw->pw_shell);
101 (void)strlcpy(bp = tbuf, pw->pw_gecos, sizeof(tbuf));
106 expandusername(p, pw->pw_name, name, sizeof(name));
122 pw->pw_name);
137 match(struct passwd *pw, char *user) argument
142 (void)strlcpy(p = tbuf, pw
248 enter_person(struct passwd *pw) argument
[all...]
/openbsd-current/usr.bin/vi/ex/
H A Dex_cd.c36 struct passwd *pw; local
59 if ((pw = getpwuid(getuid())) == NULL ||
60 pw->pw_dir == NULL || pw->pw_dir[0] == '\0') {
65 dir = pw->pw_dir;
/openbsd-current/usr.sbin/pwd_mkdb/
H A Dpwd_mkdb.c354 scan(FILE *fp, struct passwd *pw, int *flags) argument
375 if (!pw_scan(line, pw, flags)) {
492 write_old_entry(FILE *to, const struct passwd *pw) argument
500 if (pw->pw_gid == (gid_t)-1)
503 snprintf(gidstr, sizeof(gidstr), "%u", (u_int)pw->pw_gid);
505 if (pw->pw_uid == -1)
508 snprintf(uidstr, sizeof(uidstr), "%u", (u_int)pw->pw_uid);
510 return (fprintf(to, "%s:*:%s:%s:%s:%s:%s\n", pw->pw_name, uidstr,
511 gidstr, pw->pw_gecos, pw
515 db_store(FILE *fp, FILE *oldfp, DB *edp, DB *dp, struct passwd *pw, int keytype, char *username, uid_t olduid) argument
[all...]
/openbsd-current/usr.bin/ssh/
H A Dauth.c85 allowed_user(struct ssh *ssh, struct passwd * pw) argument
92 /* Shouldn't be called if pw is NULL, but better safe than sorry... */
93 if (!pw || !pw->pw_name)
102 char *shell = xstrdup((pw->pw_shell[0] == '\0') ?
103 _PATH_BSHELL : pw->pw_shell); /* empty = /bin/sh */
107 "does not exist", pw->pw_name, shell);
114 "is not executable", pw->pw_name, shell);
130 r = match_user(pw->pw_name, hostname, ipaddr,
138 pw
335 expand_authorized_keys(const char *filename, struct passwd *pw) argument
360 authorized_principals_file(struct passwd *pw) argument
369 check_key_in_hostfiles(struct passwd *pw, struct sshkey *key, const char *host, const char *sysfile, const char *userfile) argument
418 struct passwd *pw; local
[all...]
H A Dauth2-pubkeyfile.c54 auth_authorise_keyopts(struct passwd *pw, struct sshauthopt *opts, argument
103 loc, pw->pw_name, remote_host, remote_ip,
127 "address (%.200s).", loc, pw->pw_name, remote_ip);
263 auth_check_authkey_line(struct passwd *pw, struct sshkey *key, argument
325 if (auth_authorise_keyopts(pw, keyopts,
348 if (auth_authorise_keyopts(pw, certopts, 0,
367 keyopts->cert_principals == NULL ? pw->pw_name : NULL,
405 auth_check_authkeys_file(struct passwd *pw, FILE *f, char *file, argument
431 if (auth_check_authkey_line(pw, key, cp,
441 auth_openfile(const char *file, struct passwd *pw, in argument
488 auth_openkeyfile(const char *file, struct passwd *pw, int strict_modes) argument
494 auth_openprincipals(const char *file, struct passwd *pw, int strict_modes) argument
[all...]
H A Dauth-passwd.c77 struct passwd *pw = authctxt->pw; local
83 if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
137 as = auth_usercheck(authctxt->pw->pw_name, authctxt->style, "auth-ssh",
H A Dsshpty.c135 pty_setowner(struct passwd *pw, const char *tty) argument
146 gid = (grp != NULL) ? grp->gr_gid : pw->pw_gid;
158 if (st.st_uid != pw->pw_uid || st.st_gid != gid) {
159 if (chown(tty, pw->pw_uid, gid) == -1) {
161 (st.st_uid == pw->pw_uid || st.st_uid == 0))
163 tty, (u_int)pw->pw_uid, (u_int)gid,
167 tty, (u_int)pw->pw_uid, (u_int)gid,
/openbsd-current/usr.bin/calendar/
H A Dcalendar.c55 struct passwd *pw; variable in typeref:struct:passwd
160 while ((pw = getpwent()) != NULL) {
170 if (chdir(pw->pw_dir)) {
195 if (setusercontext(NULL, pw, pw->pw_uid,
198 pw->pw_uid);
200 if (chdir(pw->pw_dir) ||
243 warnx("uid %u did not finish in time", pw->pw_uid);
248 pw->pw_uid);
/openbsd-current/usr.sbin/relayd/
H A Dcheck_script.c101 struct passwd *pw; local
128 if ((pw = getpwnam(RELAYD_USER)) == NULL)
132 if (setgroups(1, &pw->pw_gid) ||
133 setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) ||
134 setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid))
/openbsd-current/usr.sbin/cron/
H A Dpopen.c67 cron_popen(char *program, char *type, struct passwd *pw, pid_t *pidptr) argument
94 if (pw) {
95 if (setusercontext(0, pw, pw->pw_uid, LOGIN_SETALL) == -1) {
98 pw->pw_name);
100 pw->pw_name);
H A Ddatabase.c172 struct passwd *pw = NULL; local
178 /* Note: pw must remain NULL for system crontab (see below). */
179 if (fname[0] != '/' && (pw = getpwnam(uname)) == NULL) {
208 tabmask = pw ? ALLPERMS : (ALLPERMS & ~(S_IWUSR|S_IRGRP|S_IROTH));
209 tabperm = pw ? (S_IRUSR|S_IWUSR) : S_IRUSR;
214 if (statbuf->st_uid != 0 && (pw == NULL ||
215 statbuf->st_uid != pw->pw_uid || strcmp(uname, pw->pw_name) != 0)) {
219 if (pw != NULL && statbuf->st_gid != cron_gid) {
223 if (pw !
[all...]
/openbsd-current/libexec/ftpd/
H A Dmonitor.c156 struct passwd *pw; local
174 if ((pw = getpwnam(FTPD_PRIVSEP_USER)) == NULL)
178 if (chroot(pw->pw_dir) == -1)
179 fatalx("chroot %s: %m", pw->pw_dir);
183 if (setgroups(1, &pw->pw_gid) == -1)
185 if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1)
187 if (setresuid(pw->pw_uid, pw
251 char *name, *pw; local
[all...]
/openbsd-current/gnu/usr.bin/perl/qnx/
H A Dcpp22 cc -c -Wc,-p$lines$comments -Wc,-pw=0 $* $redir |
/openbsd-current/regress/lib/libc/sys/
H A Dt_mkdir.c111 struct passwd *pw; local
118 pw = getpwnam("nobody");
120 ATF_REQUIRE(pw != NULL);
128 if (setuid(pw->pw_uid) != 0)
151 if (st_b.st_uid != pw->pw_uid)
H A Dt_kill.c135 struct passwd *pw; local
145 pw = getpwnam("operator");
147 if (pw != NULL)
148 cuid = pw->pw_uid;
150 pw = getpwnam("nobody");
152 if (pw != NULL)
153 puid = pw->pw_uid;
/openbsd-current/usr.sbin/ldpd/
H A Dprintconf.c145 struct l2vpn_pw *pw; local
159 LIST_FOREACH(pw, &l2vpn->pw_list, entry)
160 print_pw(pw);
166 print_pw(struct l2vpn_pw *pw) argument
168 printf("\tpseudowire %s {\n", pw->ifname);
170 printf("\t\tneighbor-id %s\n", inet_ntoa(pw->lsr_id));
171 printf("\t\tneighbor-addr %s\n", log_addr(pw->af, &pw->addr));
172 printf("\t\tpw-id %u\n", pw->pwid);
174 if (pw
[all...]
/openbsd-current/sbin/pflogd/
H A Dprivsep.c70 struct passwd *pw; local
74 pw = getpwnam("_pflogd");
75 if (pw == NULL)
83 if (chroot(pw->pw_dir) != 0)
88 gidset[0] = pw->pw_gid;
89 if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1)
93 if (setresuid(pw->pw_uid, pw
[all...]
/openbsd-current/lib/libc/gen/
H A Dpwcache.c205 struct passwd pwstore, *pw = NULL; local
229 getpwuid_r(uid, &pwstore, pwbuf, sizeof(pwbuf), &pw);
230 if (pw == NULL) {
247 return pw->pw_name;
249 (void)strlcpy(ptr->name, pw->pw_name, sizeof(ptr->name));
325 struct passwd pwstore, *pw = NULL; local
360 getpwnam_r(name, &pwstore, pwbuf, sizeof(pwbuf), &pw);
362 if (pw == NULL)
364 *uid = pw->pw_uid;
368 if (pw
[all...]
/openbsd-current/usr.sbin/dhcpd/
H A Ddhcpd.c74 struct passwd *pw; variable in typeref:struct:passwd
218 if ((pw = getpwnam("_dhcp")) == NULL)
250 if (chroot(pw->pw_dir) == -1)
251 fatal("chroot %s", pw->pw_dir);
254 if (setgroups(1, &pw->pw_gid) ||
255 setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) ||
256 setresuid(pw->pw_uid, pw
[all...]
/openbsd-current/lib/libc/net/
H A Drcmdsh.c64 struct passwd pwstore, *pw = NULL; local
71 getpwnam_r(locuser, &pwstore, pwbuf, sizeof(pwbuf), &pw);
72 if (pw == NULL) {
120 if (setuid(pw->pw_uid)) {
122 pw->pw_uid, strerror(errno));
132 if (pw->pw_shell[0] == '\0')
135 rshprog = pw->pw_shell;
/openbsd-current/libexec/mail.local/
H A Dmail.local.c58 struct passwd *pw; local
98 !(pw = getpwnam(from)) || pw->pw_uid != uid))
99 from = (pw = getpwuid(uid)) ? pw->pw_name : "???";
158 struct passwd *pw; local
169 if (!(pw = getpwnam(name))) {
177 lfd = lockspool(name, pw);
206 if (fchown(mbfd, pw->pw_uid, pw
320 lockspool(const char *name, struct passwd *pw) argument
[all...]
/openbsd-current/usr.bin/wall/
H A Dwall.c87 struct passwd *pw; local
98 pw = getpwnam("nobody");
99 if (geteuid() == 0 || (pw && getuid() == pw->pw_uid))
138 pw = getpwnam(username);
139 if (!pw)
142 if (g->gid == pw->pw_gid)
179 struct passwd *pw; local
198 whom = (pw = getpwuid(getuid())) ? pw
[all...]
/openbsd-current/usr.bin/sndiod/
H A Dsndiod.c477 struct passwd *pw; local
482 if ((pw = getpwnam(SNDIO_PRIV_USER)) == NULL)
485 pw = NULL;
506 if (pw != NULL) {
507 if (setgroups(1, &pw->pw_gid) ||
508 setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) ||
509 setresuid(pw->pw_uid, pw
553 struct passwd *pw; local
[all...]

Completed in 287 milliseconds

1234567891011