diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-08-10 20:28:52 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-08-10 20:28:52 +0000 |
commit | 42fa929d082ed62eed0a8f3db42516a1124bc09f (patch) | |
tree | 1a4f8e82dda90b465eef2d926d29887b24c463cc | |
parent | a2caa742bd587201251ded946e6e54bea797b7c9 (diff) |
Just zero out pw_passwd in the pw_dup()'d copy. There's no need
to do this elsewhere and my previous commit in this area caused
problems on systems with an /etc/crontab file.
-rw-r--r-- | usr.sbin/cron/atrun.c | 5 | ||||
-rw-r--r-- | usr.sbin/cron/crontab.c | 6 | ||||
-rw-r--r-- | usr.sbin/cron/database.c | 5 | ||||
-rw-r--r-- | usr.sbin/cron/entry.c | 6 |
4 files changed, 9 insertions, 13 deletions
diff --git a/usr.sbin/cron/atrun.c b/usr.sbin/cron/atrun.c index c3043c3c85a..0af77580d1b 100644 --- a/usr.sbin/cron/atrun.c +++ b/usr.sbin/cron/atrun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atrun.c,v 1.4 2002/08/08 18:17:50 millert Exp $ */ +/* $OpenBSD: atrun.c,v 1.5 2002/08/10 20:28:51 millert Exp $ */ /* * Copyright (c) 2002 Todd C. Miller <Todd.Miller@courtesan.com> @@ -28,7 +28,7 @@ */ #if !defined(lint) && !defined(LINT) -static const char rcsid[] = "$OpenBSD: atrun.c,v 1.4 2002/08/08 18:17:50 millert Exp $"; +static const char rcsid[] = "$OpenBSD: atrun.c,v 1.5 2002/08/10 20:28:51 millert Exp $"; #endif #include "cron.h" @@ -280,7 +280,6 @@ run_job(atjob *job, char *atfile) log_it("CRON", getpid(), "ORPHANED JOB", atfile); _exit(ERROR_EXIT); } - bzero(pw->pw_passwd, strlen(pw->pw_passwd)); /* XXX - is this needed now that we do auth_approval? */ if (pw->pw_expire && time(NULL) >= pw->pw_expire) { log_it(pw->pw_name, getpid(), "ACCOUNT EXPIRED, JOB ABORTED", diff --git a/usr.sbin/cron/crontab.c b/usr.sbin/cron/crontab.c index a50048b9cec..6d364f95208 100644 --- a/usr.sbin/cron/crontab.c +++ b/usr.sbin/cron/crontab.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crontab.c,v 1.35 2002/08/07 23:22:41 millert Exp $ */ +/* $OpenBSD: crontab.c,v 1.36 2002/08/10 20:28:51 millert Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved */ @@ -21,7 +21,7 @@ */ #if !defined(lint) && !defined(LINT) -static char const rcsid[] = "$OpenBSD: crontab.c,v 1.35 2002/08/07 23:22:41 millert Exp $"; +static char const rcsid[] = "$OpenBSD: crontab.c,v 1.36 2002/08/10 20:28:51 millert Exp $"; #endif /* crontab - install and manage per-user crontab files @@ -128,7 +128,6 @@ parse_args(int argc, char *argv[]) { fprintf(stderr, "bailing out.\n"); exit(ERROR_EXIT); } - bzero(pw->pw_passwd, strlen(pw->pw_passwd)); if (strlen(pw->pw_name) >= sizeof User) { fprintf(stderr, "username too long\n"); exit(ERROR_EXIT); @@ -156,7 +155,6 @@ parse_args(int argc, char *argv[]) { ProgramName, optarg); exit(ERROR_EXIT); } - bzero(pw->pw_passwd, strlen(pw->pw_passwd)); if (strlen(optarg) >= sizeof User) usage("username too long"); (void) strcpy(User, optarg); diff --git a/usr.sbin/cron/database.c b/usr.sbin/cron/database.c index f2e0bdaa927..ff5ad462c50 100644 --- a/usr.sbin/cron/database.c +++ b/usr.sbin/cron/database.c @@ -1,4 +1,4 @@ -/* $OpenBSD: database.c,v 1.10 2002/08/07 23:22:41 millert Exp $ */ +/* $OpenBSD: database.c,v 1.11 2002/08/10 20:28:51 millert Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved */ @@ -21,7 +21,7 @@ */ #if !defined(lint) && !defined(LINT) -static char const rcsid[] = "$OpenBSD: database.c,v 1.10 2002/08/07 23:22:41 millert Exp $"; +static char const rcsid[] = "$OpenBSD: database.c,v 1.11 2002/08/10 20:28:51 millert Exp $"; #endif /* vix 26jan87 [RCS has the log] @@ -192,7 +192,6 @@ process_crontab(const char *uname, const char *fname, const char *tabname, log_it(fname, getpid(), "ORPHAN", "no passwd entry"); goto next_crontab; } - bzero(pw->pw_passwd, strlen(pw->pw_passwd)); if ((crontab_fd = open(tabname, O_RDONLY|O_NONBLOCK|O_NOFOLLOW, 0)) < OK) { /* crontab not accessible? diff --git a/usr.sbin/cron/entry.c b/usr.sbin/cron/entry.c index 25199e0a178..32d96d4577f 100644 --- a/usr.sbin/cron/entry.c +++ b/usr.sbin/cron/entry.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entry.c,v 1.14 2002/08/07 23:22:41 millert Exp $ */ +/* $OpenBSD: entry.c,v 1.15 2002/08/10 20:28:51 millert Exp $ */ /* * Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved @@ -22,7 +22,7 @@ */ #if !defined(lint) && !defined(LINT) -static char const rcsid[] = "$OpenBSD: entry.c,v 1.14 2002/08/07 23:22:41 millert Exp $"; +static char const rcsid[] = "$OpenBSD: entry.c,v 1.15 2002/08/10 20:28:51 millert Exp $"; #endif /* vix 26jan87 [RCS'd; rest of log is in RCS file] @@ -252,7 +252,6 @@ load_entry(FILE *file, void (*error_func)(), struct passwd *pw, char **envp) { ecode = e_username; goto eof; } - bzero(pw->pw_passwd, strlen(pw->pw_passwd)); Debug(DPARS, ("load_entry()...uid %ld, gid %ld\n", (long)e->pwd->pw_uid, (long)e->pwd->pw_gid)) } else if (ch == '*') { @@ -264,6 +263,7 @@ load_entry(FILE *file, void (*error_func)(), struct passwd *pw, char **envp) { ecode = e_memory; goto eof; } + bzero(e->pwd->pw_passwd, strlen(e->pwd->pw_passwd)); /* copy and fix up environment. some variables are just defaults and * others are overrides. |