Lines Matching refs:pwd
266 static void do_edit(struct passwd *pwd) in do_edit() argument
278 snprintf(toybuf, sizeof(toybuf), "%s%s", TT.cdir, pwd->pw_name); in do_edit()
286 } else printf("No crontab for '%s'- using an empty one\n", pwd->pw_name); in do_edit()
293 char *prog = pwd->pw_shell; in do_edit()
295 xsetuser(pwd); in do_edit()
296 if (pwd->pw_uid) { in do_edit()
297 if (setenv("USER", pwd->pw_name, 1)) _exit(1); in do_edit()
298 if (setenv("LOGNAME", pwd->pw_name, 1)) _exit(1); in do_edit()
300 if (setenv("HOME", pwd->pw_dir, 1)) _exit(1); in do_edit()
332 update_crontab(tname, pwd->pw_name); in do_edit()
338 struct passwd *pwd = NULL; in crontab_main() local
347 pwd = xgetpwnam(TT.user); in crontab_main()
348 } else pwd = xgetpwuid(getuid()); in crontab_main()
354 do_replace(pwd->pw_name); in crontab_main()
356 else if (toys.optflags & FLAG_e) do_edit(pwd); in crontab_main()
357 else if (toys.optflags & FLAG_l) do_list(pwd->pw_name); in crontab_main()
358 else if (toys.optflags & FLAG_r) do_remove(pwd->pw_name); in crontab_main()
361 do_replace(pwd->pw_name); in crontab_main()