Lines Matching refs:pwd
169 struct passwd *pwd, pw_data; in doit() local
275 pwd = getpwnam_r(user, &pw_data, pwdbuf, sizeof (pwdbuf)); in doit()
276 if (pwd == NULL) { in doit()
341 if (setgid((gid_t)pwd->pw_gid) < 0) { in doit()
348 (void) initgroups(pwd->pw_name, pwd->pw_gid); in doit()
359 if (setuid((uid_t)pwd->pw_uid) < 0) { in doit()
419 if (*pwd->pw_shell == '\0') in doit()
420 pwd->pw_shell = "/bin/sh"; in doit()
424 if (chdir(pwd->pw_dir) < 0) { in doit()
430 if (pwd->pw_uid) in doit()
435 (void) strncat(homedir, pwd->pw_dir, sizeof (homedir) - 6); in doit()
436 (void) strncat(shell, pwd->pw_shell, sizeof (shell) - 7); in doit()
437 (void) strncat(username, pwd->pw_name, sizeof (username) - 6); in doit()
458 cp = rindex(pwd->pw_shell, '/'); in doit()
462 cp = pwd->pw_shell; in doit()
463 (void) execle(pwd->pw_shell, cp, "-c", cmdbuf, (char *)0, envinit); in doit()
464 perror(pwd->pw_shell); in doit()