Lines Matching refs:pwd
263 static void do_edit(struct passwd *pwd) in do_edit() argument
275 snprintf(toybuf, sizeof(toybuf), "%s%s", TT.cdir, pwd->pw_name); in do_edit()
283 } else printf("No crontab for '%s'- using an empty one\n", pwd->pw_name); in do_edit()
290 char *prog = pwd->pw_shell; in do_edit()
292 xsetuser(pwd); in do_edit()
293 if (pwd->pw_uid) { in do_edit()
294 if (setenv("USER", pwd->pw_name, 1)) _exit(1); in do_edit()
295 if (setenv("LOGNAME", pwd->pw_name, 1)) _exit(1); in do_edit()
297 if (setenv("HOME", pwd->pw_dir, 1)) _exit(1); in do_edit()
329 update_crontab(tname, pwd->pw_name); in do_edit()
335 struct passwd *pwd = NULL; in crontab_main() local
344 pwd = xgetpwnam(TT.user); in crontab_main()
345 } else pwd = xgetpwuid(getuid()); in crontab_main()
351 do_replace(pwd->pw_name); in crontab_main()
353 else if (toys.optflags & FLAG_e) do_edit(pwd); in crontab_main()
354 else if (toys.optflags & FLAG_l) do_list(pwd->pw_name); in crontab_main()
355 else if (toys.optflags & FLAG_r) do_remove(pwd->pw_name); in crontab_main()
358 do_replace(pwd->pw_name); in crontab_main()