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