Steve Greenland wrote: > On 09-Nov-00, 05:57 (CST), Thue <[email protected]> wrote: >> Package: cron >> Version: 3.0pl1-60 >> Severity: normal >> >> Entering a single line via crontab, without a linebreak at the end, cron >> ignored it. >> > > Yes, I know. It's intentional in the original code: > > ch = get_string(cmd, MAX_COMMAND, file, "\n"); > > /* a file without a \n before the EOF is rude, so we'll complain... > */ > if (ch == EOF) { > ecode = e_cmd; > goto eof; > } > > However, it should at least whine at you about, rather failing > silently. I'll check into it.
As Steve indicated, this is intentional. Justin provided some plausible explanations. To fix this issue, Steve added a log statement to the code above, which was the obvious, correct and simplest thing to do. The reason his fix didn't work is that despite Paul Vixie's comment indicating so, the code referenced above /is never reached/ due to a bug in the original code. I have committed a proper fix. Starting with the next release, crontabs lacking a newline before EOF will be logged to syslog. Thanks to everyone for contributing to this issue, either with information or with patches. Christian
signature.asc
Description: OpenPGP digital signature

