(Jakub bounced, so I dropped him from CC:)

Christian Kastner wrote:
> Jakub Chmielewski wrote:
>> I put some files in /etc/cron.d but have found out that the cron does not 
>> run then, though 
>> they are marked as loaded (RELOAD in the log). I've dug the source and found 
>> the load_user 
>> routine in user.c. When it loads environment ([near] line 89)
>>
>> while ((status = load_env(envstr, file)) >= OK) {
>>
>> and load_env fails with ERR, which actually happens when there's no \n 
>> trailing the crontab 
>> entry it just skips the crontab without any warning notice.
>> Besides, the code never seems to reach the code in the switch statement with 
>> ERR label, 
>> as ERR is always less than OK. 
> 
> I completely missed this bug report, probably because of the merge.
> Which is too bad, because finding it myself was a pain I would have
> gladly avoided. Well, at least we have independent confirmation of the
> issue.
> 
> A fix been committed for the basic issue (see #76625), but Justin raised
> a valid point here:
> 
>> It's unclear how to elegantly handle this during editing (crontab.c);
>> at that point, it should effect a (specific) warning and prompt about
>> "retry the same edit?".
> 
> I am therefore unmerging the two bugs and leaving this one open until
> this second issue is properly resolved.

I have committed a fix for this. crontab(1) will refuse to install a
crontab with a missing newline before EOF.

Thanks again to both of you for your analysis!


Christian


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to