Home
last modified time | relevance | path

Searched refs:pwd (Results 1 – 25 of 274) sorted by relevance

1234567891011

/freebsd/lib/libc/tests/nss/
H A Dgetpw_test.c125 free_passwd(struct passwd *pwd) in free_passwd() argument
127 free(pwd->pw_name); in free_passwd()
128 free(pwd->pw_passwd); in free_passwd()
129 free(pwd->pw_class); in free_passwd()
130 free(pwd->pw_gecos); in free_passwd()
131 free(pwd->pw_dir); in free_passwd()
132 free(pwd->pw_shell); in free_passwd()
136 sdump_passwd(struct passwd *pwd, char *buffer, size_t buflen) in sdump_passwd() argument
139 pwd->pw_name, pwd->pw_passwd, pwd->pw_uid, pwd->pw_gid, in sdump_passwd()
140 (uintmax_t)pwd->pw_change, pwd->pw_class, pwd->pw_gecos, in sdump_passwd()
[all …]
/freebsd/usr.bin/logins/
H A Dlogins.c203 struct passwd *pwd; in get_users() local
211 if ((pwd = getpwent()) == NULL) in get_users()
213 pwds[npwds].pw_name = xstrdup(pwd->pw_name); in get_users()
214 pwds[npwds].pw_passwd = xstrdup(pwd->pw_passwd); in get_users()
215 pwds[npwds].pw_uid = pwd->pw_uid; in get_users()
216 pwds[npwds].pw_gid = pwd->pw_gid; in get_users()
217 pwds[npwds].pw_change = pwd->pw_change; in get_users()
218 pwds[npwds].pw_class = xstrdup(pwd->pw_class); in get_users()
219 pwds[npwds].pw_gecos = xstrdup(pwd->pw_gecos); in get_users()
220 pwds[npwds].pw_dir = xstrdup(pwd->pw_dir); in get_users()
[all …]
/freebsd/usr.sbin/pw/
H A Dpw_user.c73 static int print_user(struct passwd *pwd, bool pretty, bool v7);
133 create_and_populate_homedir(struct userconf *cnf, struct passwd *pwd, in create_and_populate_homedir() argument
139 mkdir_home_parents(conf.rootfd, pwd->pw_dir); in create_and_populate_homedir()
147 copymkdir(conf.rootfd, pwd->pw_dir, skelfd, homemode, pwd->pw_uid, in create_and_populate_homedir()
148 pwd->pw_gid, 0); in create_and_populate_homedir()
150 pwd->pw_name, (uintmax_t)pwd->pw_uid, pwd->pw_dir); in create_and_populate_homedir()
154 pw_set_passwd(struct passwd *pwd, int fd, bool precrypted, bool update) in pw_set_passwd() argument
163 if (!pwd->pw_passwd || *pwd->pw_passwd != '*') { in pw_set_passwd()
164 pwd->pw_passwd = "*"; /* No access */ in pw_set_passwd()
180 pwd->pw_name); in pw_set_passwd()
[all …]
H A Dpwupd.c84 pw_update(struct passwd * pwd, char const * user) in pw_update() argument
93 if (pwd != NULL) in pw_update()
94 pw = pw_dup(pwd); in pw_update()
131 addpwent(struct passwd * pwd) in addpwent() argument
134 return (pw_update(pwd, NULL)); in addpwent()
138 chgpwent(char const * login, struct passwd * pwd) in chgpwent() argument
141 return (pw_update(pwd, login)); in chgpwent()
145 delpwent(struct passwd * pwd) in delpwent() argument
148 return (pw_update(NULL, pwd->pw_name)); in delpwent()
/freebsd/crypto/heimdal/appl/login/
H A Dlogin.c142 otp_verify(struct passwd *pwd, const char *password) in otp_verify() argument
156 krb5_verify(struct passwd *pwd, const char *password) in krb5_verify() argument
161 ret = krb5_parse_name(context, pwd->pw_name, &princ); in krb5_verify()
180 krb5_start_session (const struct passwd *pwd) in krb5_start_session() argument
187 (unsigned)pwd->pw_uid); in krb5_start_session()
208 krb5_get_afs_tokens (const struct passwd *pwd) in krb5_get_afs_tokens() argument
220 pw_dir = pwd->pw_dir; in krb5_get_afs_tokens()
229 cell, NULL, pwd->pw_uid, pwd->pw_dir); in krb5_get_afs_tokens()
231 pwd->pw_uid, pwd->pw_dir); in krb5_get_afs_tokens()
315 do_login(const struct passwd *pwd, char *tty, char *ttyn) in do_login() argument
[all …]
/freebsd/contrib/netbsd-tests/lib/librumphijack/
H A Dh_cwd.c43 static char pwd[1024]; variable
84 if (getcwd(pwd, sizeof(pwd)) == NULL) in simple()
86 if (strcmp(pwd, prefix) != 0) in simple()
92 if (getcwd(pwd, sizeof(pwd)) == NULL) in simple()
94 if (strcmp(pwd, makepath("dir")) != 0) in simple()
100 if (getcwd(pwd, sizeof(pwd)) == NULL) in simple()
102 if (strcmp(pwd, makepath("dir/dir")) != 0) in simple()
106 if (getcwd(pwd, sizeof(pwd)) == NULL) in simple()
108 if (strcmp(pwd, makepath("dir")) != 0) in simple()
113 if (getcwd(pwd, sizeof(pwd)) == NULL) in simple()
[all …]
/freebsd/usr.sbin/jexec/
H A Djexec.c63 const struct passwd *pwd = NULL; in main() local
103 get_user_info(username, &pwd, &lcap); in main()
118 get_user_info(username, &pwd, &lcap); in main()
127 if (setgid(pwd->pw_gid) != 0) in main()
129 if (setusercontext(lcap, pwd, pwd->pw_uid, username in main()
134 setenv("USER", pwd->pw_name, 1); in main()
135 setenv("HOME", pwd->pw_dir, 1); in main()
137 *pwd->pw_shell ? pwd->pw_shell : _PATH_BSHELL, 1); in main()
138 if (clean && username && !dflag && chdir(pwd->pw_dir) < 0) in main()
139 err(1, "chdir: %s", pwd->pw_dir); in main()
[all …]
/freebsd/lib/libutil/
H A Dlogin_class.c140 substvar(const char * var, const struct passwd * pwd, int hlen, int pch, int nlen) in substvar() argument
150 if (pwd != NULL) { in substvar()
164 if (pwd != NULL) { in substvar()
177 memmove(p, pwd->pw_dir, hlen); in substvar()
184 memmove(p, pwd->pw_name, nlen); in substvar()
197 setclassenvironment(login_cap_t *lc, const struct passwd * pwd, int paths) in setclassenvironment() argument
200 int hlen = pwd ? strlen(pwd->pw_dir) : 0; in setclassenvironment()
201 int nlen = pwd ? strlen(pwd->pw_name) : 0; in setclassenvironment()
204 if (hlen && pwd->pw_dir[hlen-1] != '/') in setclassenvironment()
211 char * np = substvar(var, pwd, hlen, pch, nlen); in setclassenvironment()
[all …]
/freebsd/libexec/nuageinit/
H A Dnuage.lua82 local function adduser(pwd)
83 if (type(pwd) ~= "table") then
92 local f = io.popen(cmd .. " usershow " .. pwd.name .. " -7 2> /dev/null")
98 if not pwd.gecos then
99 pwd.gecos = pwd.name .. " User"
101 if not pwd.homedir then
102 pwd.homedir = "/home/" .. pwd.name
105 if pwd.groups then
106 local list = splitlist(pwd.groups)
111 if pwd.primary_group and pwd.primary_group ~= pwd.name then
[all …]
/freebsd/lib/nss_tacplus/
H A Dnss_tacplus.c112 tacplus_getpwnam_r(const char *name, struct passwd *pwd, char *buffer, in tacplus_getpwnam_r() argument
150 memset(pwd, 0, sizeof(*pwd)); in tacplus_getpwnam_r()
153 pwd->pw_name = tacplus_copystr(name, &buffer, &bufsize); in tacplus_getpwnam_r()
154 if (pwd->pw_name == NULL) in tacplus_getpwnam_r()
158 pwd->pw_passwd = tacplus_copystr("*", &buffer, &bufsize); in tacplus_getpwnam_r()
163 pwd->pw_uid = DEF_UID; in tacplus_getpwnam_r()
164 pwd->pw_gid = DEF_GID; in tacplus_getpwnam_r()
186 pwd->pw_uid = num; in tacplus_getpwnam_r()
195 pwd->pw_gid = num; in tacplus_getpwnam_r()
197 pwd->pw_class = tacplus_copystr(value, &buffer, in tacplus_getpwnam_r()
[all …]
/freebsd/lib/libpam/modules/pam_unix/
H A Dpam_unix.c91 struct passwd *pwd; in pam_sm_authenticate() local
103 pwd = getpwnam(user); in pam_sm_authenticate()
107 if (pwd != NULL) { in pam_sm_authenticate()
109 realpw = pwd->pw_passwd; in pam_sm_authenticate()
126 lc = login_getpwclass(pwd); in pam_sm_authenticate()
165 struct passwd *pwd; in pam_sm_acct_mgmt() local
178 if (user == NULL || (pwd = getpwnam(user)) == NULL) in pam_sm_acct_mgmt()
191 if (*pwd->pw_passwd == '\0' && in pam_sm_acct_mgmt()
195 if (strncmp(pwd->pw_passwd, LOCKED_PREFIX, LOCKED_PREFIX_LEN) == 0) in pam_sm_acct_mgmt()
198 lc = login_getpwclass(pwd); in pam_sm_acct_mgmt()
[all …]
/freebsd/lib/libc/gen/
H A Dgetpwent.c259 struct passwd *pwd; in pwd_marshal_func() local
281 pwd = va_arg(ap, struct passwd *); in pwd_marshal_func()
286 strlen(pwd->pw_name) + 1; in pwd_marshal_func()
287 if (pwd->pw_passwd != NULL) in pwd_marshal_func()
288 desired_size += strlen(pwd->pw_passwd) + 1; in pwd_marshal_func()
289 if (pwd->pw_class != NULL) in pwd_marshal_func()
290 desired_size += strlen(pwd->pw_class) + 1; in pwd_marshal_func()
291 if (pwd->pw_gecos != NULL) in pwd_marshal_func()
292 desired_size += strlen(pwd->pw_gecos) + 1; in pwd_marshal_func()
293 if (pwd->pw_dir != NULL) in pwd_marshal_func()
[all …]
H A Dpw_scan.c65 __pw_initpwd(struct passwd *pwd) in __pw_initpwd() argument
69 memset(pwd, 0, sizeof(*pwd)); in __pw_initpwd()
70 pwd->pw_uid = (uid_t)-1; /* Considered least likely to lead to */ in __pw_initpwd()
71 pwd->pw_gid = (gid_t)-1; /* a security issue. */ in __pw_initpwd()
72 pwd->pw_name = nul; in __pw_initpwd()
73 pwd->pw_passwd = nul; in __pw_initpwd()
74 pwd->pw_class = nul; in __pw_initpwd()
75 pwd->pw_gecos = nul; in __pw_initpwd()
76 pwd->pw_dir = nul; in __pw_initpwd()
77 pwd->pw_shell = nul; in __pw_initpwd()
/freebsd/usr.sbin/pwd_mkdb/
H A Dpwd_mkdb.c69 static struct passwd pwd; /* password structure */ variable
190 while (scan(fp, &pwd)) in main()
191 if (!is_comment && strlen(pwd.pw_name) >= MAXLOGNAME) { in main()
192 warnx("%s: username too long", pwd.pw_name); in main()
341 for (cnt = 1; scan(fp, &pwd); ++cnt) { in main()
343 (pwd.pw_name[0] == '+' || pwd.pw_name[0] == '-')) { in main()
360 (!username || (strcmp(username, pwd.pw_name) == 0))) { in main()
363 COMPACT(pwd.pw_name); in main()
365 SCALAR(pwd.pw_uid); in main()
366 SCALAR(pwd.pw_gid); in main()
[all …]
/freebsd/usr.bin/login/
H A Dlogin.c115 struct passwd *pwd; variable
288 if (failures > (pwd ? 0 : 1)) in main()
320 (void)getpwnam_r(username, &pwres, pwbuf, sizeof(pwbuf), &pwd); in main()
321 if (pwd != NULL && pwd->pw_uid == 0) in main()
329 if (pwd != NULL && fflag && in main()
330 (uid == (uid_t)0 || uid == (uid_t)pwd->pw_uid)) { in main()
343 if (pwd != NULL && rval == 0) in main()
359 pwd = NULL; in main()
409 lc = login_getpwclass(pwd); in main()
410 lc_user = login_getuserclass(pwd); in main()
[all …]
/freebsd/lib/libypclnt/
H A Dypclnt_passwd.c118 ypclnt_passwd(ypclnt_t *ypclnt, const struct passwd *pwd, const char *passwd) in ypclnt_passwd() argument
122 return (yppasswd_remote(ypclnt, pwd, passwd)); in ypclnt_passwd()
124 return (yppasswd_local(ypclnt, pwd)); in ypclnt_passwd()
137 yppasswd_local(ypclnt_t *ypclnt, const struct passwd *pwd) in yppasswd_local() argument
148 yppwd.newpw.pw_uid = pwd->pw_uid; in yppasswd_local()
149 yppwd.newpw.pw_gid = pwd->pw_gid; in yppasswd_local()
150 yppwd.newpw.pw_change = pwd->pw_change; in yppasswd_local()
151 yppwd.newpw.pw_expire = pwd->pw_expire; in yppasswd_local()
152 yppwd.newpw.pw_fields = pwd->pw_fields; in yppasswd_local()
155 if ((yppwd.newpw.pw_name = strdup(pwd->pw_name)) == NULL || in yppasswd_local()
[all …]
/freebsd/bin/sh/tests/parameters/
H A Dpwd2.07 TP=$(pwd)
12 [ "$(pwd)" = "$TP/link" ]
13 [ "$(pwd -P)" = "$TP/test1" ]
14 [ "$(${SH} -c pwd)" = "$TP/link" ]
15 [ "$(${SH} -c pwd\ -P)" = "$TP/test1" ]
17 [ "$(pwd)" = "$TP" ]
20 [ "$(pwd)" = "$TP/test1" ]
21 [ "$(pwd -P)" = "$TP/test1" ]
22 [ "$(${SH} -c pwd)" = "$TP/test1" ]
23 [ "$(${SH} -c pwd\ -P)" = "$TP/test1" ]
/freebsd/usr.bin/su/
H A Dsu.c139 struct passwd *pwd = NULL; in main() local
246 pwd = getpwnam(username); in main()
247 if (pwd == NULL || pwd->pw_uid != ruid) in main()
248 pwd = getpwuid(ruid); in main()
249 if (pwd == NULL) { in main()
258 username = strdup(pwd->pw_name); in main()
263 if (pwd->pw_shell != NULL && *pwd->pw_shell != '\0') { in main()
265 strlcpy(shellbuf, pwd->pw_shell, in main()
310 pwd = getpwnam(user); in main()
311 if (pwd == NULL) { in main()
[all …]
/freebsd/usr.bin/newgrp/
H A Dnewgrp.c54 static struct passwd *pwd; variable
79 if ((pwd = getpwuid(getuid())) == NULL) in main()
135 initres = initgroups(pwd->pw_name, pwd->pw_gid); in restoregrps()
136 setres = setgid(pwd->pw_gid); in restoregrps()
171 if (pwd->pw_gid == grp->gr_gid) in addgroup()
174 if (strcmp(*p, pwd->pw_name) == 0) { in addgroup()
263 shell = pwd->pw_shell; in loginshell()
266 if (chdir(pwd->pw_dir) < 0) { in loginshell()
267 warn("%s", pwd->pw_dir); in loginshell()
279 lc = login_getpwclass(pwd); in loginshell()
[all …]
/freebsd/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/
H A Dargon2.c87 const uint32_t parallelism, const void *pwd, const size_t pwdlen, in argon2_hash() argument
115 context.pwd = (uint8_t *) pwd; in argon2_hash()
160 const uint32_t parallelism, const void *pwd, in argon2i_hash_encoded() argument
165 return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen, in argon2i_hash_encoded()
171 const uint32_t parallelism, const void *pwd, in argon2i_hash_raw() argument
175 return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen, in argon2i_hash_raw()
181 const uint32_t parallelism, const void *pwd, in argon2id_hash_encoded() argument
186 return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen, in argon2id_hash_encoded()
192 const uint32_t parallelism, const void *pwd, in argon2id_hash_raw() argument
196 return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen, in argon2id_hash_raw()
[all …]
/freebsd/stand/lua/
H A Dpassword.lua89 local function doPrompt(prompt, pwd)
107 if pwd == nil or pwd == read_pwd then
117 local function compare(prompt, pwd)
118 if pwd == nil then
121 doPrompt(prompt, pwd)
133 local pwd = loader.getenv("password")
134 if pwd ~= nil then
143 compare("Loader password:", pwd)
/freebsd/contrib/openpam/lib/libpam/
H A Dopenpam_borrow_cred.c61 const struct passwd *pwd) in openpam_borrow_cred() argument
67 ENTERI(pwd->pw_uid); in openpam_borrow_cred()
74 if (geteuid() != 0 && geteuid() != pwd->pw_uid) { in openpam_borrow_cred()
95 if (geteuid() == pwd->pw_uid) in openpam_borrow_cred()
97 if (initgroups(pwd->pw_name, pwd->pw_gid) < 0 || in openpam_borrow_cred()
98 setegid(pwd->pw_gid) < 0 || seteuid(pwd->pw_uid) < 0) { in openpam_borrow_cred()
/freebsd/crypto/heimdal/lib/roken/
H A Dget_default_username.c64 struct passwd *pwd; in get_default_username() local
67 pwd = k_getpwnam (user); in get_default_username()
68 if (pwd != NULL && pwd->pw_uid == uid) in get_default_username()
71 pwd = k_getpwuid (uid); in get_default_username()
72 if (pwd != NULL) in get_default_username()
73 return pwd->pw_name; in get_default_username()
/freebsd/usr.bin/top/
H A Dusername.c73 struct passwd *pwd; in userid() local
79 if ((pwd = getpwnam(username_)) == NULL) in userid()
85 enter_user(pwd->pw_uid, username_, 1); in userid()
88 return(pwd->pw_uid); in userid()
124 struct passwd *pwd; in get_user() local
127 if ((pwd = getpwuid(uid)) != NULL) in get_user()
129 return(enter_user(pwd->pw_uid, pwd->pw_name, 1)); in get_user()
/freebsd/crypto/heimdal/appl/rsh/
H A Drshd.c41 read_limits_conf(const char *file, const struct passwd *pwd);
142 struct passwd *pwd; in recv_bsd_auth() local
147 pwd = getpwnam(*server_username); in recv_bsd_auth()
148 if (pwd == NULL) in recv_bsd_auth()
150 if (iruserok(thataddr->sin_addr.s_addr, pwd->pw_uid == 0, in recv_bsd_auth()
557 setup_environment (char ***env, const struct passwd *pwd) in setup_environment() argument
577 if (asprintf (&e[i++], "USER=%s", pwd->pw_name) == -1) in setup_environment()
579 if (asprintf (&e[i++], "HOME=%s", pwd->pw_dir) == -1) in setup_environment()
581 if (asprintf (&e[i++], "SHELL=%s", pwd->pw_shell) == -1) in setup_environment()
610 struct passwd *pwd; in doit() local
[all …]

1234567891011