Home
last modified time | relevance | path

Searched refs:pw (Results 1 – 25 of 182) sorted by relevance

12345678

/dragonfly/lib/libc/gen/
H A Dpw_scan.c60 pw->pw_fields = 0; in __pw_scan()
64 if (pw->pw_name[0] && (pw->pw_name[0] != '+' || pw->pw_name[1] == '\0')) in __pw_scan()
69 if (pw->pw_passwd[0]) in __pw_scan()
77 if (pw->pw_name[0] != '+' && pw->pw_name[0] != '-') { in __pw_scan()
94 pw->pw_uid = (uid_t)id; in __pw_scan()
101 if (pw->pw_name[0] != '+' && pw->pw_name[0] != '-') { in __pw_scan()
113 pw->pw_gid = (gid_t)id; in __pw_scan()
118 if (pw->pw_class[0]) in __pw_scan()
135 if (pw->pw_gecos[0]) in __pw_scan()
140 if (pw->pw_dir[0]) in __pw_scan()
[all …]
/dragonfly/usr.bin/id/
H A Did.c126 id = pw ? pw->pw_gid : rflag ? getgid() : getegid(); in main()
158 if (pw) in main()
159 user(pw); in main()
172 if (pw) { in pretty()
181 if (pw == NULL || strcmp(login, pw->pw_name)) in pretty()
183 if (pw) in pretty()
254 printf("uid=%u(%s)", pw->pw_uid, pw->pw_name); in user()
282 if (pw) { in group()
340 pw->pw_passwd, pw->pw_uid, pw->pw_gid, pw->pw_class, in pline()
341 (long)pw->pw_change, (long)pw->pw_expire, pw->pw_gecos, in pline()
[all …]
/dragonfly/crypto/openssh/
H A Duidswap.c68 (u_int)pw->pw_uid, (u_int)pw->pw_gid, in temporarily_use_uid()
101 if (initgroups(pw->pw_name, pw->pw_gid) == -1) in temporarily_use_uid()
188 if (pw == NULL) in permanently_set_uid()
193 (u_int)pw->pw_gid); in permanently_set_uid()
195 if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1) in permanently_set_uid()
203 if (initgroups(pw->pw_name, pw->pw_gid) == -1) in permanently_set_uid()
205 pw->pw_name, (u_int)pw->pw_gid, strerror(errno)); in permanently_set_uid()
208 if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) == -1) in permanently_set_uid()
213 if (old_gid != pw->pw_gid && pw->pw_uid != 0 && in permanently_set_uid()
219 if (getgid() != pw->pw_gid || getegid() != pw->pw_gid) { in permanently_set_uid()
[all …]
H A Dauth-rhosts.c204 temporarily_use_uid(pw); 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()
277 temporarily_use_uid(pw); in auth_rhosts2()
300 "bad modes for %.200s", pw->pw_name, path); in auth_rhosts2()
319 client_user, pw->pw_name)) { in auth_rhosts2()
[all …]
H A Dauth.c109 if (!pw || !pw->pw_name) in allowed_user()
114 pw->pw_name); in allowed_user()
185 if (ga_init(pw->pw_name, pw->pw_gid) == 0) { in allowed_user()
442 temporarily_use_uid(pw); in check_key_in_hostfiles()
472 struct passwd *pw; in getpwnamallow() local
489 pw = getpwnam(user); in getpwnamallow()
494 if (pw == NULL) { in getpwnamallow()
506 if (!allowed_user(ssh, pw)) in getpwnamallow()
517 pw = NULL; in getpwnamallow()
523 if (pw != NULL) in getpwnamallow()
[all …]
H A Dplatform.c99 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()
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()
214 spw = getspnam(pw->pw_name); in platform_locked_account()
[all …]
H A Dsession.c742 struct passwd * pw = s->pw; in do_login() local
761 record_login(pid, s->tty, pw->pw_name, pw->pw_uid, in do_login()
819 struct passwd *pw = s->pw; in check_quietlogin() local
989 struct passwd *pw = s->pw; in do_setup_env() local
1031 if (setusercontext(lc, pw, pw->pw_uid, LOGIN_SETPATH) < 0) in do_setup_env()
1366 if (setusercontext(lc, pw, pw->pw_uid, in do_setusercontext()
1379 if (initgroups(pw->pw_name, pw->pw_gid) < 0) { in do_setusercontext()
1414 (void) setusercontext(lc, pw, pw->pw_uid, LOGIN_SETUMASK); in do_setusercontext()
1436 if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) in do_setusercontext()
1519 struct passwd *pw = s->pw; in do_child() local
[all …]
H A Dauth2-pubkeyfile.c105 loc, pw->pw_name, remote_host, remote_ip, in auth_authorise_keyopts()
129 "address (%.200s).", loc, pw->pw_name, remote_ip); in auth_authorise_keyopts()
265 auth_check_authkey_line(struct passwd *pw, struct sshkey *key, in auth_check_authkey_line() argument
327 if (auth_authorise_keyopts(pw, keyopts, in auth_check_authkey_line()
350 if (auth_authorise_keyopts(pw, certopts, 0, in auth_check_authkey_line()
369 keyopts->cert_principals == NULL ? pw->pw_name : NULL, in auth_check_authkey_line()
433 if (auth_check_authkey_line(pw, key, cp, in auth_check_authkeys_file()
454 pw->pw_name, file_type, file, strerror(errno)); in auth_openfile()
457 pw->pw_name, file_type, file, strerror(errno)); in auth_openfile()
468 pw->pw_name, file_type, file); in auth_openfile()
[all …]
H A Dauth-passwd.c80 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()
173 as = auth_usercheck(authctxt->pw->pw_name, authctxt->style, "auth-ssh", in sys_auth_passwd()
195 struct passwd *pw = authctxt->pw; in sys_auth_passwd() local
199 char *pw_password = authctxt->valid ? shadow_pw(pw) : pw->pw_passwd; in sys_auth_passwd()
/dragonfly/usr.bin/chpass/
H A Dfield.c114 pw->pw_uid = id; in p_uid()
135 pw->pw_gid = gr->gr_gid; in p_gid()
144 pw->pw_gid = id; in p_gid()
164 if (!atot(p, &pw->pw_change)) in p_change()
174 if (!atot(p, &pw->pw_expire)) in p_expire()
217 if (!master_mode && pw->pw_shell && !ok_shell(pw->pw_shell)) { in p_shell()
226 pw->pw_shell = strdup(p); in p_shell()
229 pw->pw_shell = dup_shell(p); in p_shell()
230 if (!pw->pw_shell) { in p_shell()
237 pw->pw_shell); in p_shell()
[all …]
H A Dedit.c76 return (pw_dup(pw)); in edit()
124 *pw->pw_shell ? pw->pw_shell : _PATH_BSHELL); in display()
142 *pw->pw_shell ? pw->pw_shell : _PATH_BSHELL); in display()
199 if ((pw = pw_dup(pw)) == NULL) in verify()
204 free(pw); in verify()
210 free(pw); in verify()
265 free(pw); in verify()
270 pw->pw_gecos = p; in verify()
271 buf = pw_make(pw); in verify()
272 free(pw); in verify()
[all …]
H A Dchpass.c68 struct passwd lpw, *old_pw, *pw; in main() local
79 pw = old_pw = NULL; in main()
142 if ((pw = pw_dup(pw)) == NULL || in main()
148 if (pw != NULL && (pw->pw_fields & _PWF_SOURCE) == _PWF_NIS) { in main()
162 if (p_shell(arg, pw, NULL) == -1) in main()
176 pw = &lpw; in main()
188 pw->pw_passwd = arg; in main()
202 free(pw); in main()
203 pw = edit(pw_tempname(), old_pw); in main()
205 if (pw == NULL) in main()
[all …]
/dragonfly/lib/libutil/
H A Dpw_util.c398 pw->pw_passwd, (uintmax_t)pw->pw_uid, (uintmax_t)pw->pw_gid, in pw_make()
399 pw->pw_class, (uintmax_t)pw->pw_change, (uintmax_t)pw->pw_expire, in pw_make()
400 pw->pw_gecos, pw->pw_dir, pw->pw_shell); in pw_make()
413 (uintmax_t)pw->pw_uid, (uintmax_t)pw->pw_gid, in pw_make_v7()
414 pw->pw_gecos, pw->pw_dir, pw->pw_shell); in pw_make_v7()
436 if (pw == NULL) { in pw_copy()
445 spw = pw; in pw_copy()
595 if (pw->pw_name != NULL) in pw_dup()
603 if (pw->pw_dir != NULL) in pw_dup()
646 struct passwd pw, *ret; in pw_scan() local
[all …]
/dragonfly/games/canfield/cfscores/
H A Dcfscores.c61 struct passwd *pw; in main() local
77 pw = getpwuid(uid); in main()
78 if (pw == NULL) { in main()
82 printuser(pw, 1); in main()
86 while ((pw = getpwent()) != NULL) in main()
87 printuser(pw, 0); in main()
90 pw = getpwnam(argv[1]); in main()
91 if (pw == NULL) { in main()
95 printuser(pw, 1); in main()
103 printuser(struct passwd *pw, int printfail) in printuser() argument
[all …]
/dragonfly/lib/libcrypt/
H A Dcrypt-md5.c35 crypt_md5(const char *pw, const char *salt) in crypt_md5() argument
67 MD5Update(&ctx,pw,strlen(pw)); in crypt_md5()
77 MD5Update(&ctx1,pw,strlen(pw)); in crypt_md5()
79 MD5Update(&ctx1,pw,strlen(pw)); in crypt_md5()
81 for(pl = strlen(pw); pl > 0; pl -= MD5_SIZE) in crypt_md5()
88 for (i = strlen(pw); i ; i >>= 1) in crypt_md5()
92 MD5Update(&ctx, pw, 1); in crypt_md5()
109 MD5Update(&ctx1,pw,strlen(pw)); in crypt_md5()
117 MD5Update(&ctx1,pw,strlen(pw)); in crypt_md5()
122 MD5Update(&ctx1,pw,strlen(pw)); in crypt_md5()
/dragonfly/usr.bin/finger/
H A Dutil.c83 (void)strncpy(t, pw->pw_name, in match()
150 enter_person(struct passwd *pw) in enter_person() argument
159 key.data = pw->pw_name; in enter_person()
160 key.size = strlen(pw->pw_name); in enter_person()
173 userinfo(pn, pw); in enter_person()
187 struct passwd *pw; in find_person() local
195 if ((pw = getpwnam(name)) && hide(pw)) in find_person()
315 pn->uid = pw->pw_uid; in userinfo()
334 (void)strncpy(t, pw->pw_name, in userinfo()
373 hide(struct passwd *pw) in hide() argument
[all …]
H A Dfinger.c149 struct passwd *pw; in main() local
153 if ((pw = getpwnam(UNPRIV_NAME)) && pw->pw_uid > 0) { in main()
154 setgid(pw->pw_gid); in main()
155 setuid(pw->pw_uid); in main()
218 struct passwd *pw; in loginlist() local
227 if (hide(pw)) in loginlist()
253 struct passwd *pw; in userlist() local
321 if (((pw = getpwnam(*p)) != NULL) && !hide(pw)) in userlist()
322 enter_person(pw); in userlist()
333 else if (match(pw, *p) && !hide(pw)) { in userlist()
[all …]
/dragonfly/usr.sbin/rpc.yppasswdd/
H A Dyppasswdd_server.c259 key.data = pw->pw_name; in find_domain()
322 key.data = pw->pw_name; in update_inplace()
360 strlen(pw->pw_name))) { in update_inplace()
376 pw->pw_gid); in update_inplace()
388 pw->pw_name, pw->pw_passwd, pw->pw_uid, in update_inplace()
389 pw->pw_gid, pw->pw_class, pw->pw_change, in update_inplace()
390 pw->pw_expire, pw->pw_gecos, pw->pw_dir, in update_inplace()
391 pw->pw_shell); in update_inplace()
394 pw->pw_name, *(ptr+1) == '*' ? "*" : pw->pw_passwd, in update_inplace()
395 pw->pw_uid, pw->pw_gid, pw->pw_gecos, pw->pw_dir, in update_inplace()
[all …]
/dragonfly/contrib/libarchive/libarchive/
H A Darchive_string_sprintf.c98 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 …]
/dragonfly/usr.bin/chkey/
H A Dchkey.c85 struct passwd *pw; in main() local
128 pw = ypgetpwuid(uid); in main()
130 pw = getpwuid(uid); in main()
132 if (pw == NULL) { in main()
142 pw = getpwuid(0); in main()
143 if (pw == NULL) in main()
150 cryptpw = crypt(pass, pw->pw_passwd); in main()
248 static struct passwd pw; in ypgetpwuid() local
260 pw.pw_passwd = p + 1; in ypgetpwuid()
261 p = strchr(pw.pw_passwd, ':'); in ypgetpwuid()
[all …]
/dragonfly/lib/libssh/openbsd-compat/
H A Dxcrypt.c73 struct passwd *pw; in pick_salt() local
82 while ((pw = getpwent()) != NULL) { in pick_salt()
83 if ((passwd = shadow_pw(pw)) == NULL) in pick_salt()
129 shadow_pw(struct passwd *pw) in shadow_pw() argument
131 char *pw_password = pw->pw_passwd; in shadow_pw()
134 struct spwd *spw = getspnam(pw->pw_name); in shadow_pw()
141 return(get_iaf_password(pw)); in shadow_pw()
146 if (issecure() && (spw = getpwanam(pw->pw_name)) != NULL) in shadow_pw()
149 struct pr_passwd *spw = getprpwnam(pw->pw_name); in shadow_pw()
/dragonfly/contrib/pam_passwdqc/
H A Dpam_passwdqc.c280 if (strlen(pw->pw_passwd) >= 13)
283 _passwdqc_memzero(pw->pw_passwd, strlen(pw->pw_passwd));
307 struct passwd *pw, fake_pw; local
372 pw = &fake_pw;
373 memset(pw, 0, sizeof(*pw));
374 pw->pw_name = (char *)user;
375 pw->pw_gecos = "";
376 pw->pw_dir = "";
382 pw = getpwnam(user);
384 if (!pw)
[all …]
/dragonfly/usr.bin/mail/
H A Dgetname.c46 struct passwd *pw; in getname() local
48 if ((pw = getpwuid(uid)) == NULL) in getname()
50 return (pw->pw_name); in getname()
60 struct passwd *pw; in getuserid() local
62 if ((pw = getpwnam(name)) == NULL) in getuserid()
64 return (pw->pw_uid); in getuserid()
/dragonfly/contrib/wpa_supplicant/src/utils/
H A Dext_password.c100 void ext_password_free(struct wpabuf *pw) in ext_password_free() argument
102 if (pw == NULL) in ext_password_free()
104 os_memset(wpabuf_mhead(pw), 0, wpabuf_len(pw)); in ext_password_free()
106 if (munlock(wpabuf_head(pw), wpabuf_len(pw)) < 0) { in ext_password_free()
111 wpabuf_free(pw); in ext_password_free()
/dragonfly/usr.sbin/pflogd/
H A Dprivsep.c70 struct passwd *pw; in priv_init() local
79 pw = getpwnam("_pflogd"); in priv_init()
80 if (pw == NULL) in priv_init()
92 if (chroot(pw->pw_dir) != 0) in priv_init()
97 gidset[0] = pw->pw_gid; in priv_init()
98 if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1) in priv_init()
102 if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) == -1) in priv_init()

12345678