Searched refs:pwd (Results 1 - 25 of 454) sorted by relevance

1234567891011>>

/freebsd-current/lib/libcompat/4.4/
H A Dcuserid.c33 #include <pwd.h>
41 struct passwd *pwd; local
43 if ((pwd = getpwuid(geteuid())) == NULL) {
49 (void)strncpy(s, pwd->pw_name, L_cuserid);
52 return (pwd->pw_name);
/freebsd-current/crypto/heimdal/lib/roken/
H A Dget_default_username.c64 struct passwd *pwd; local
67 pwd = k_getpwnam (user);
68 if (pwd != NULL && pwd->pw_uid == uid)
71 pwd = k_getpwuid (uid);
72 if (pwd != NULL)
73 return pwd->pw_name;
/freebsd-current/contrib/netbsd-tests/lib/librumphijack/
H A Dh_cwd.c43 static char pwd[1024]; variable
84 if (getcwd(pwd, sizeof(pwd)) == NULL)
86 if (strcmp(pwd, prefix) != 0)
92 if (getcwd(pwd, sizeof(pwd)) == NULL)
94 if (strcmp(pwd, makepath("dir")) != 0)
100 if (getcwd(pwd, sizeof(pwd)) == NULL)
102 if (strcmp(pwd, makepat
[all...]
/freebsd-current/usr.bin/logins/
H A Dlogins.c34 #include <pwd.h>
203 struct passwd *pwd; local
211 if ((pwd = getpwent()) == NULL)
213 pwds[npwds].pw_name = xstrdup(pwd->pw_name);
214 pwds[npwds].pw_passwd = xstrdup(pwd->pw_passwd);
215 pwds[npwds].pw_uid = pwd->pw_uid;
216 pwds[npwds].pw_gid = pwd->pw_gid;
217 pwds[npwds].pw_change = pwd->pw_change;
218 pwds[npwds].pw_class = xstrdup(pwd->pw_class);
219 pwds[npwds].pw_gecos = xstrdup(pwd
234 struct xpasswd *pwd; local
291 display_user(struct xpasswd *pwd) argument
329 struct xpasswd *pwd; local
[all...]
/freebsd-current/lib/libc/tests/nss/
H A Dgetpw_test.c29 #include <pwd.h>
125 free_passwd(struct passwd *pwd) argument
127 free(pwd->pw_name);
128 free(pwd->pw_passwd);
129 free(pwd->pw_class);
130 free(pwd->pw_gecos);
131 free(pwd->pw_dir);
132 free(pwd->pw_shell);
136 sdump_passwd(struct passwd *pwd, char *buffer, size_t buflen) argument
139 pwd
147 dump_passwd(struct passwd *pwd) argument
159 passwd_read_snapshot_func(struct passwd *pwd, char *line) argument
242 struct passwd *pwd; local
260 passwd_test_correctness(struct passwd *pwd, void *mdata __unused) argument
306 passwd_check_ambiguity(struct passwd_test_data *td, struct passwd *pwd) argument
316 struct passwd *pwd; local
346 struct passwd *pwd; local
371 passwd_test_getpwent(struct passwd *pwd, void *mdata __unused) argument
[all...]
/freebsd-current/crypto/heimdal/lib/gssapi/krb5/
H A Dpname_to_uid.c51 struct passwd pw, *pwd;
53 struct passwd *pwd;
68 if (getpwnam_r(localname, &pw, pwbuf, sizeof(pwbuf), &pwd) != 0) {
73 pwd = getpwnam(localname);
76 if (pwd == NULL) {
81 *uidp = pwd->pw_uid;
/freebsd-current/usr.sbin/jexec/
H A Djexec.c44 #include <pwd.h>
63 const struct passwd *pwd = NULL; local
97 get_user_info(username, &pwd, &lcap);
112 get_user_info(username, &pwd, &lcap);
121 if (setgid(pwd->pw_gid) != 0)
123 if (setusercontext(lcap, pwd, pwd->pw_uid, username
128 setenv("USER", pwd->pw_name, 1);
129 setenv("HOME", pwd->pw_dir, 1);
131 *pwd
155 const struct passwd *pwd; local
[all...]
/freebsd-current/contrib/openpam/lib/libpam/
H A Dopenpam_borrow_cred.c44 #include <pwd.h>
61 const struct passwd *pwd)
67 ENTERI(pwd->pw_uid);
74 if (geteuid() != 0 && geteuid() != pwd->pw_uid) {
95 if (geteuid() == pwd->pw_uid)
97 if (initgroups(pwd->pw_name, pwd->pw_gid) < 0 ||
98 setegid(pwd->pw_gid) < 0 || seteuid(pwd->pw_uid) < 0) {
116 * switches to those of the user specified by its =pwd argumen
60 openpam_borrow_cred(pam_handle_t *pamh, const struct passwd *pwd) argument
[all...]
/freebsd-current/usr.bin/top/
H A Dusername.c32 #include <pwd.h>
73 struct passwd *pwd; local
79 if ((pwd = getpwnam(username_)) == NULL)
85 enter_user(pwd->pw_uid, username_, 1);
88 return(pwd->pw_uid);
124 struct passwd *pwd; local
127 if ((pwd = getpwuid(uid)) != NULL)
129 return(enter_user(pwd->pw_uid, pwd->pw_name, 1));
/freebsd-current/crypto/heimdal/appl/login/
H A Dlogin.c142 otp_verify(struct passwd *pwd, const char *password) argument
156 krb5_verify(struct passwd *pwd, const char *password) argument
161 ret = krb5_parse_name(context, pwd->pw_name, &princ);
180 krb5_start_session (const struct passwd *pwd) argument
187 (unsigned)pwd->pw_uid);
208 krb5_get_afs_tokens (const struct passwd *pwd) argument
220 pw_dir = pwd->pw_dir;
229 cell, NULL, pwd->pw_uid, pwd->pw_dir);
231 pwd
315 do_login(const struct passwd *pwd, char *tty, char *ttyn) argument
518 check_password(struct passwd *pwd, const char *password) argument
640 struct passwd *pwd; local
[all...]
/freebsd-current/lib/nss_tacplus/
H A Dnss_tacplus.c20 #include <pwd.h>
112 tacplus_getpwnam_r(const char *name, struct passwd *pwd, char *buffer, argument
150 memset(pwd, 0, sizeof(*pwd));
153 pwd->pw_name = tacplus_copystr(name, &buffer, &bufsize);
154 if (pwd->pw_name == NULL)
158 pwd->pw_passwd = tacplus_copystr("*", &buffer, &bufsize);
163 pwd->pw_uid = DEF_UID;
164 pwd->pw_gid = DEF_GID;
186 pwd
256 struct passwd *pwd = va_arg(ap, struct passwd *); local
[all...]
/freebsd-current/usr.bin/login/
H A Dlogin.h37 extern struct passwd *pwd;
/freebsd-current/usr.sbin/pw/
H A Dpw_nis.c32 #include <pwd.h>
39 pw_nisupdate(const char * path, struct passwd * pwd, char const * user) argument
46 if (pwd != NULL)
47 pw = pw_dup(pwd);
81 addnispwent(const char *path, struct passwd * pwd) argument
83 return pw_nisupdate(path, pwd, NULL);
87 chgnispwent(const char *path, char const * login, struct passwd * pwd) argument
89 return pw_nisupdate(path, pwd, login);
H A Dpwupd.c33 #include <pwd.h>
84 pw_update(struct passwd * pwd, char const * user) argument
93 if (pwd != NULL)
94 pw = pw_dup(pwd);
131 addpwent(struct passwd * pwd) argument
134 return (pw_update(pwd, NULL));
138 chgpwent(char const * login, struct passwd * pwd) argument
141 return (pw_update(pwd, login));
145 delpwent(struct passwd * pwd) argument
148 return (pw_update(NULL, pwd
[all...]
H A Dpw_user.c40 #include <pwd.h>
73 static int print_user(struct passwd *pwd, bool pretty, bool v7);
133 create_and_populate_homedir(struct userconf *cnf, struct passwd *pwd, argument
139 mkdir_home_parents(conf.rootfd, pwd->pw_dir);
147 copymkdir(conf.rootfd, pwd->pw_dir, skelfd, homemode, pwd->pw_uid,
148 pwd->pw_gid, 0);
150 pwd->pw_name, (uintmax_t)pwd->pw_uid, pwd
154 pw_set_passwd(struct passwd *pwd, int fd, bool precrypted, bool update) argument
216 perform_chgpwent(const char *name, struct passwd *pwd, char *nispasswd) argument
253 struct passwd *pwd = NULL; local
309 struct passwd *pwd; local
528 print_user(struct passwd * pwd, bool pretty, bool v7) argument
735 struct passwd *pwd = NULL; local
820 struct passwd *pwd = NULL; local
1174 struct passwd *pwd; local
1509 struct passwd *pwd; local
[all...]
/freebsd-current/lib/libutil/
H A Dlogin_class.c39 #include <pwd.h>
139 substvar(const char * var, const struct passwd * pwd, int hlen, int pch, int nlen) argument
149 if (pwd != NULL) {
163 if (pwd != NULL) {
176 memmove(p, pwd->pw_dir, hlen);
183 memmove(p, pwd->pw_name, nlen);
196 setclassenvironment(login_cap_t *lc, const struct passwd * pwd, int paths) argument
199 int hlen = pwd ? strlen(pwd->pw_dir) : 0;
200 int nlen = pwd
392 setclassumask(login_cap_t *lc, const struct passwd *pwd) argument
431 setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags) argument
462 setclasspriority(login_cap_t * const lc, struct passwd const * const pwd) argument
530 setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned int flags) argument
[all...]
/freebsd-current/tools/regression/mlock/
H A Dmlock.c32 #include <pwd.h>
48 struct passwd *pwd; local
56 pwd = getpwnam(NOBODY);
57 if (pwd == NULL && errno == 0)
59 if (pwd == NULL)
61 if (pwd->pw_uid == 0)
75 if (seteuid(pwd->pw_uid) < 0)
/freebsd-current/usr.bin/passwd/
H A Dpasswd.c40 #include <pwd.h>
69 struct passwd *pwd = NULL; /* Keep compiler happy. */ local
97 if ((pwd = getpwuid(uid)) == NULL)
101 if ((pwd = getpwnam(*argv)) == NULL)
108 if (uid != 0 && uid != pwd->pw_uid)
112 switch (pwd->pw_fields & _PWF_SOURCE) {
115 pwd->pw_name);
119 pwd->pw_name);
139 pam_err = pam_start("passwd", pwd->pw_name, &pamc, &pamh);
/freebsd-current/lib/libpam/modules/pam_self/
H A Dpam_self.c42 #include <pwd.h>
58 struct passwd *pwd; local
66 if (luser == NULL || (pwd = getpwnam(luser)) == NULL)
73 if (uid == (uid_t)pwd->pw_uid)
/freebsd-current/lib/libpam/modules/pam_chroot/
H A Dpam_chroot.c39 #include <pwd.h>
55 struct passwd *pwd; local
59 user == NULL || (pwd = getpwnam(user)) == NULL)
61 if (pwd->pw_uid == 0 && !openpam_get_option(pamh, "also_root"))
63 if (pwd->pw_dir == NULL)
65 if ((end = strstr(pwd->pw_dir, "/./")) != NULL) {
67 (int)(end - pwd->pw_dir), pwd->pw_dir) > (int)sizeof(buf)) {
/freebsd-current/libexec/nuageinit/
H A Dnuage.lua70 local function adduser(pwd)
71 if (type(pwd) ~= "table") then
75 local f = io.popen("getent passwd "..pwd.name)
81 if not pwd.gecos then
82 pwd.gecos = pwd.name .. " User"
84 if not pwd.home then
85 pwd.home = "/home/" .. pwd.name
88 if pwd
[all...]
/freebsd-current/lib/libpam/modules/pam_unix/
H A Dpam_unix.c47 #include <pwd.h>
91 struct passwd *pwd; local
103 pwd = getpwnam(user);
107 if (pwd != NULL) {
109 realpw = pwd->pw_passwd;
126 lc = login_getpwclass(pwd);
165 struct passwd *pwd; local
178 if (user == NULL || (pwd = getpwnam(user)) == NULL)
191 if (*pwd->pw_passwd == '\0' &&
195 if (strncmp(pwd
288 struct passwd *pwd, *old_pwd; local
[all...]
/freebsd-current/lib/libcasper/services/cap_pwd/
H A Dcap_pwd.h46 int cap_getpwent_r(cap_channel_t *chan, struct passwd *pwd, char *buffer,
48 int cap_getpwnam_r(cap_channel_t *chan, const char *name, struct passwd *pwd,
50 int cap_getpwuid_r(cap_channel_t *chan, uid_t uid, struct passwd *pwd,
90 cap_getpwent_r(cap_channel_t *chan __unused, struct passwd *pwd, char *buffer,
94 return (getpwent_r(pwd, buffer, bufsize, result));
99 struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result)
102 return (getpwnam_r(name, pwd, buffer, bufsize, result));
106 cap_getpwuid_r(cap_channel_t *chan __unused, uid_t uid, struct passwd *pwd,
110 return (getpwuid_r(uid, pwd, buffer, bufsize, result));
/freebsd-current/bin/pwd/
H A Dpwd.c88 (void)fprintf(stderr, "usage: pwd [-L | -P]\n");
96 char *pwd; local
102 if ((pwd = getenv("PWD")) != NULL && *pwd == '/') {
103 if (stat(pwd, &lg) == -1 || stat(".", &phy) == -1)
106 return (pwd);
/freebsd-current/lib/libpam/modules/pam_nologin/
H A Dpam_nologin.c43 #include <pwd.h>
63 struct passwd *pwd; local
76 pwd = getpwnam(user);
77 if (pwd == NULL)
82 * if pwd->pw_uid is 0. That class should have "ignorenologin"
85 lc = login_getpwclass(pwd);

Completed in 261 milliseconds

1234567891011>>