From: deraadt Date: Sat, 18 Mar 2000 21:23:04 +0000 (+0000) Subject: fix parsing of commands after @ keywords and hourly bitmap handling; X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=237747028b0a91827ae45708cce65a2177490537;p=openbsd fix parsing of commands after @ keywords and hourly bitmap handling; sheldonh@uunet.co.za --- diff --git a/usr.sbin/cron/entry.c b/usr.sbin/cron/entry.c index 4b39d2650a6..a4283732f6d 100644 --- a/usr.sbin/cron/entry.c +++ b/usr.sbin/cron/entry.c @@ -16,7 +16,7 @@ */ #if !defined(lint) && !defined(LINT) -static char rcsid[] = "$Id: entry.c,v 1.5 1997/12/22 08:10:43 deraadt Exp $"; +static char rcsid[] = "$Id: entry.c,v 1.6 2000/03/18 21:23:04 deraadt Exp $"; #endif /* vix 26jan87 [RCS'd; rest of log is in RCS file] @@ -150,7 +150,7 @@ load_entry(file, error_func, pw, envp) bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); } else if (!strcmp("hourly", cmd)) { bit_set(e->minute, 0); - bit_set(e->hour, (LAST_HOUR-FIRST_HOUR+1)); + bit_nset(e->hour, 0, (LAST_HOUR-FIRST_HOUR+1)); bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); @@ -159,6 +159,14 @@ load_entry(file, error_func, pw, envp) ecode = e_timespec; goto eof; } + /* Advance past whitespace between shortcut and + * username/command. + */ + Skip_Blanks(ch, file); + if (ch == EOF) { + ecode = e_cmd; + goto eof; + } } else { Debug(DPARS, ("load_entry()...about to parse numerics\n"))