Lines Matching refs:pwd
53 #include <pwd.h>
90 struct passwd pwd; /* The password entry of a user */
255 struct passwd *ret; /* The returned pointer to pwd */
261 status = getpwuid_r(geteuid(), &home->pwd, home->buffer, home->buflen,
264 status = getpwnam_r(user, &home->pwd, home->buffer, home->buflen, &ret);
273 home_dir = home->pwd.pw_dir;
280 struct passwd *pwd = login_user ? getpwuid(geteuid()) : getpwnam(user);
281 if(!pwd) {
289 home_dir = pwd->pw_dir;
363 struct passwd *pwd; /* A pointer to pwd_buffer */
370 &pwd) == 0 && pwd != NULL) {
371 waserr = callback_fn(data, pwd->pw_name, pwd->pw_dir,
378 &pwd) == 0 && pwd != NULL &&
379 strncmp(prefix, pwd->pw_name, prefix_len)==0) {
380 waserr = callback_fn(data, pwd->pw_name, pwd->pw_dir,
390 struct passwd *pwd; /* The pointer to the latest password entry */
401 while((pwd = getpwent_r(&pwd_buffer, home->buffer, home->buflen)) != NULL && !waserr) {
403 while((pwd = getpwent()) != NULL && !waserr) {
405 if(strncmp(prefix, pwd->pw_name, prefix_len) == 0) {
406 waserr = callback_fn(data, pwd->pw_name, pwd->pw_dir,
420 const char *pwd = hd_getpwd(home);
421 if(pwd) {
422 waserr = callback_fn(data, "+", pwd, _err_get_msg(home->err),ERR_MSG_LEN);
459 const char *pwd = getenv("PWD");
467 if(pwd && cwd && stat(cwd, &cwdstat)==0 && stat(pwd, &pwdstat)==0 &&
469 return pwd;
471 * Also return pwd if getcwd() failed, since it represents the best
475 return pwd;