Module Name: src Committed By: christos Date: Fri Sep 5 20:55:11 UTC 2014
Modified Files: src/external/bsd/cron/dist: crontab.c Log Message: Rewind the file before we install it so that we can check it. Before this fix, no checks were made and you could install crap. XXX: pullup 7 To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/external/bsd/cron/dist/crontab.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/cron/dist/crontab.c diff -u src/external/bsd/cron/dist/crontab.c:1.7 src/external/bsd/cron/dist/crontab.c:1.8 --- src/external/bsd/cron/dist/crontab.c:1.7 Sat Nov 3 13:33:01 2012 +++ src/external/bsd/cron/dist/crontab.c Fri Sep 5 16:55:11 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: crontab.c,v 1.7 2012/11/03 17:33:01 christos Exp $ */ +/* $NetBSD: crontab.c,v 1.8 2014/09/05 20:55:11 christos Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved @@ -25,7 +25,7 @@ #if 0 static char rcsid[] = "Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp"; #else -__RCSID("$NetBSD: crontab.c,v 1.7 2012/11/03 17:33:01 christos Exp $"); +__RCSID("$NetBSD: crontab.c,v 1.8 2014/09/05 20:55:11 christos Exp $"); #endif #endif @@ -638,7 +638,7 @@ replace_cmd(void) { */ (void)fprintf(tmp, "# DO NOT EDIT THIS FILE - edit the master and reinstall.\n"); (void)fprintf(tmp, "# (%s installed on %-24.24s)\n", Filename, ctime(&now)); - (void)fprintf(tmp, "# (Cron version %s -- %s)\n", CRON_VERSION, "$NetBSD: crontab.c,v 1.7 2012/11/03 17:33:01 christos Exp $"); + (void)fprintf(tmp, "# (Cron version %s -- %s)\n", CRON_VERSION, "$NetBSD: crontab.c,v 1.8 2014/09/05 20:55:11 christos Exp $"); /* copy the crontab to the tmp */ @@ -680,6 +680,7 @@ replace_cmd(void) { */ Set_LineNum(1 - NHEADER_LINES); CheckErrorCount = 0; eof = FALSE; + rewind(tmp); while (!CheckErrorCount && !eof) { switch (load_env(envstr, tmp)) { case ERR: