Lines Matching refs:pwd
66 #include <pwd.h>
98 struct passwd **pwd)
106 *pwd = NULL;
108 *pwd = pwres;
115 struct passwd *pwd;
117 &pwd) == 0 ? pwd : NULL;
122 struct passwd **pwd)
132 *pwd = NULL;
134 *pwd = pwres;
141 struct passwd *pwd;
143 &pwd) == 0 ? pwd : NULL;
148 struct passwd **pwd)
158 *pwd = NULL;
160 *pwd = pwres;
206 pwscan(int search, uid_t uid, const char *name, struct passwd *pwd, char *buf,
226 if (pwmatchline(search, uid, name, pwd, buf))
233 pwmatchline(int search, uid_t uid, const char *name, struct passwd *pwd,
242 memset(pwd, 0, sizeof(*pwd));
243 pwd->pw_name = strsep(&bp, ":\n"); /* name */
244 if (search && name && strcmp(pwd->pw_name, name))
247 pwd->pw_passwd = strsep(&bp, ":\n"); /* passwd */
254 pwd->pw_uid = (uid_t)id;
255 if (search && name == NULL && pwd->pw_uid != uid)
263 pwd->pw_gid = (gid_t)id;
265 if (!(pwd->pw_class = strsep(&bp, ":"))) /* class */
272 if (!(pwd->pw_gecos = strsep(&bp, ":\n"))) /* gecos */
274 if (!(pwd->pw_dir = strsep(&bp, ":\n"))) /* directory */
276 if (!(pwd->pw_shell = strsep(&bp, ":\n"))) /* shell */