Lines Matching refs:pwd
382 struct passwd *pwd, int copy_content) in cleanup_tmpdir() argument
394 if (cmdbuf && spawn_command(cmdbuf, pwd->pw_uid) != 0) { in cleanup_tmpdir()
408 if (cmdbuf && spawn_command(cmdbuf, pwd->pw_uid) != 0) rc++; in cleanup_tmpdir()
419 if ((uid_t)setfsuid(pwd->pw_uid) != 0) { in cleanup_tmpdir()
434 struct stat *out_st, struct passwd *pwd, security_context_t execcon) in create_tmpdir() argument
444 if ((uid_t)setfsuid(pwd->pw_uid) != 0) in create_tmpdir()
465 if ((uid_t)setfsuid(0) != pwd->pw_uid) in create_tmpdir()
469 if (asprintf(&tmpdir, "/tmp/.sandbox-%s-XXXXXX", pwd->pw_name) == -1) { in create_tmpdir()
521 if ((uid_t)setfsuid(pwd->pw_uid) != 0) in create_tmpdir()
529 if ((uid_t)setfsuid(0) != pwd->pw_uid) in create_tmpdir()
532 if (cmdbuf && spawn_command(cmdbuf, pwd->pw_uid) != 0) { in create_tmpdir()
534 cleanup_tmpdir(tmpdir, src, pwd, 0); in create_tmpdir()
656 struct passwd *pwd=getpwuid(uid); in main() local
657 if (!pwd) { in main()
662 if (verify_shell(pwd->pw_shell) < 0) { in main()
736 &st_tmpdir_r, pwd, execcon)) == NULL) { in main()
770 resolved_path = realpath(pwd->pw_dir,NULL); in main()
819 rc |= setenv("HOME", pwd->pw_dir, 1); in main()
820 rc |= setenv("SHELL", pwd->pw_shell, 1); in main()
821 rc |= setenv("USER", pwd->pw_name, 1); in main()
822 rc |= setenv("LOGNAME", pwd->pw_name, 1); in main()
829 if (chdir(pwd->pw_dir)) { in main()
870 if (tmpdir_r) cleanup_tmpdir(tmpdir_r, tmpdir_s, pwd, 1); in main()