Bug#555954: cron stops inspection of new cron jobs after a 'Error: bad hour;, while reading' - fixed

2011-04-04 Thread xavier renaut
On 2011.04.03 12:11:55 EDT, Christian Kastner wrote:
 On 04/03/2011 05:45 PM, Josip Rodin wrote:
  On Sun, Apr 03, 2011 at 04:34:18PM +0200, Christian Kastner wrote:
  were any of you able to reproduce the issue you reported using the steps
  described here?
 
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=555954
  
  I tried this on squeeze now and it's better. The original error is logged:
  
  Apr  3 17:39:01 orion /usr/sbin/cron[14418]: (*system*local-test) RELOAD 
  (/etc/cron.d/local-test)
  Apr  3 17:39:01 orion cron[14418]: Error: bad hour; while reading 
  /etc/cron.d/local-test
  Apr  3 17:39:01 orion /usr/sbin/cron[14418]: (*system*local-test) ERROR 
  (Syntax error, this crontab file will be ignored)
  
  And after the mv local-test{~,} (nullify last broken edit), it does work
  fine again.
 
 That's good news!
 
 If you should, by chance, still have a Lenny system around, I'd very
 much appreciate feedback for that, too. Given the original submitter's
 e-mail address, I believe you are my only data point now...
 


this email address is  not dead yet ;-)

this bug is not present in squeeeze, and not present in lenny anymore. i cannot 
reproduce it.

here is my test

SQUEEZE TESTS

echo '* 222 * * * root echo test4  /dev/null'  test4 

Apr 4 12:03:01 ina cron[1904]: Error: bad hour; while reading /etc/cron.d/test4
Apr 4 12:03:01 ina /usr/sbin/cron[1904]: (*system*test4) ERROR (Syntax error, 
this crontab file will be ignored)

ls -ld --full-time /etc/cron.d/{.,test4}
drwxr-xr-x 2 root root 4096 2011-04-04 12:02:45.737444618 -0400 /etc/cron.d/.
-rw-r--r-- 1 root root   40 2011-04-04 12:02:45.737444618 -0400 
/etc/cron.d/test4

vi test4 # correction

drwxr-xr-x 2 root root 4096 2011-04-04 12:04:20.698239008 -0400 /etc/cron.d/.
-rw-r--r-- 1 root root   38 2011-04-04 12:04:20.661444634 -0400 
/etc/cron.d/test4

Apr  4 12:05:01 ina /USR/SBIN/CRON[9045]: (root) CMD (echo test4  /dev/null)

test4 is correctly picked up.





LENNY TESTS


cd /etc/cron.d
cat  test2
* 222 * * * root echo  /dev/null

Apr 4 11:45:01 avaiki /usr/sbin/cron[21942]: (*system*test2) RELOAD 
(/etc/cron.d/test2)
Apr 4 11:45:01 avaiki cron[21942]: Error: bad hour; while reading 
/etc/cron.d/test2
ls -ld --full-time /etc/cron.d/{.,test2,test3}

-rw-r--r-- 1 root root  34 2011-04-04 11:44:01.0 -0400 /etc/cron.d/test2

vi test2

test2 is correctly picked up




-- 
xavier renaut, 514 906 1212 x315 



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#555954: cron stops inspection of new cron jobs after a 'Error: bad hour;, while reading'

2011-04-04 Thread Justin T Pryzby
On Sun, Apr 03, 2011 at 06:11:55PM +0200, Christian Kastner wrote:
 On 04/03/2011 05:45 PM, Josip Rodin wrote:
  On Sun, Apr 03, 2011 at 04:34:18PM +0200, Christian Kastner wrote:

  Regarding the more general issue of invalidating the whole file, do you mind
  if I file a new wishlist bug report?
 
 On the contrary, I'd welcome it.

It's my understanding that ending a parse of a file once any invalid
line is encountered is deliberate, and was (at least intended to) put
in place after cron was used to break into a debian server.  See
#378153.

Justin



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#555954: cron stops inspection of new cron jobs after a 'Error: bad hour;, while reading'

2011-04-04 Thread Josip Rodin

(Cc:ing new bug report. Feel free to drop the old one.)

On Mon, Apr 04, 2011 at 10:13:31AM -0700, Justin T Pryzby wrote:
 On Sun, Apr 03, 2011 at 06:11:55PM +0200, Christian Kastner wrote:
  On 04/03/2011 05:45 PM, Josip Rodin wrote:
   On Sun, Apr 03, 2011 at 04:34:18PM +0200, Christian Kastner wrote:
 
   Regarding the more general issue of invalidating the whole file, do you 
   mind
   if I file a new wishlist bug report?
  
  On the contrary, I'd welcome it.
 
 It's my understanding that ending a parse of a file once any invalid
 line is encountered is deliberate, and was (at least intended to) put
 in place after cron was used to break into a debian server.  See
 #378153.

We have already discussed this in this bug report earlier, as I recall, that
was for a wholly invalid file with binary data or something like that, not a
trivial syntax error in a crontab(5) line.

-- 
 2. That which causes joy or happiness.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#555954: cron stops inspection of new cron jobs after a 'Error: bad hour;, while reading'

2011-04-03 Thread Christian Kastner
Hi,

were any of you able to reproduce the issue you reported using the steps
described here?

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=555954


Regards,
Christian




signature.asc
Description: OpenPGP digital signature


Bug#555954: cron stops inspection of new cron jobs after a 'Error: bad hour;, while reading'

2011-04-03 Thread Christian Kastner
On 04/03/2011 05:45 PM, Josip Rodin wrote:
 On Sun, Apr 03, 2011 at 04:34:18PM +0200, Christian Kastner wrote:
 were any of you able to reproduce the issue you reported using the steps
 described here?

 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=555954
 
 I tried this on squeeze now and it's better. The original error is logged:
 
 Apr  3 17:39:01 orion /usr/sbin/cron[14418]: (*system*local-test) RELOAD 
 (/etc/cron.d/local-test)
 Apr  3 17:39:01 orion cron[14418]: Error: bad hour; while reading 
 /etc/cron.d/local-test
 Apr  3 17:39:01 orion /usr/sbin/cron[14418]: (*system*local-test) ERROR 
 (Syntax error, this crontab file will be ignored)
 
 And after the mv local-test{~,} (nullify last broken edit), it does work
 fine again.

That's good news!

If you should, by chance, still have a Lenny system around, I'd very
much appreciate feedback for that, too. Given the original submitter's
e-mail address, I believe you are my only data point now...

 Regarding the more general issue of invalidating the whole file, do you mind
 if I file a new wishlist bug report?

On the contrary, I'd welcome it.


Thanks again,
Christian



signature.asc
Description: OpenPGP digital signature


Bug#555954: cron stops inspection of new cron jobs after a 'Error: bad hour;, while reading'

2011-04-03 Thread Josip Rodin
On Sun, Apr 03, 2011 at 04:34:18PM +0200, Christian Kastner wrote:
 were any of you able to reproduce the issue you reported using the steps
 described here?
 
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=555954

I tried this on squeeze now and it's better. The original error is logged:

Apr  3 17:39:01 orion /usr/sbin/cron[14418]: (*system*local-test) RELOAD 
(/etc/cron.d/local-test)
Apr  3 17:39:01 orion cron[14418]: Error: bad hour; while reading 
/etc/cron.d/local-test
Apr  3 17:39:01 orion /usr/sbin/cron[14418]: (*system*local-test) ERROR (Syntax 
error, this crontab file will be ignored)

And after the mv local-test{~,} (nullify last broken edit), it does work
fine again.

Regarding the more general issue of invalidating the whole file, do you mind
if I file a new wishlist bug report?

-- 
 2. That which causes joy or happiness.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#555954: cron stops inspection of new cron jobs after a 'Error: bad hour;, while reading'

2011-04-03 Thread Josip Rodin
On Sun, Apr 03, 2011 at 06:11:55PM +0200, Christian Kastner wrote:
 If you should, by chance, still have a Lenny system around, I'd very
 much appreciate feedback for that, too. Given the original submitter's
 e-mail address, I believe you are my only data point now...

Do we really care about lenny at this point? :)

-- 
 2. That which causes joy or happiness.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#555954: cron stops inspection of new cron jobs after a 'Error: bad hour; while reading'

2010-04-22 Thread Christian Kastner
Hello Xavier,

xavier renaut wrote:
 Package: cron
 Version: 3.0pl1-106
 Severity: normal
 
 
 if one creates a cron job in cron.d , wait for the reload,
 change it again with a bad time, ie :
 
 * 222 * * * root echo  /dev/null
 
 cron will report  
 
 cron[26144]: Error: bad hour; while reading /etc/cron.d/test2
 
 
 then you can correct it,
 cron wont reload it, and wont pick up new files in this directory.

I cannot reproduce this. Could you try the following?

a) create a valid crontab as /etc/cron.d/foobar

* * * * * root date  /tmp/dates

b) post output of the following command:

# ls -ld --full-time /etc/cron.d{,/foobar}


c) invalidate crontab

* 666 * * * root date  /tmp/dates

d) repeat step b)


e) correct crontab

* * * * * root date  /tmp/dates


For me, after step e), everthing works as normal...


Christian



signature.asc
Description: OpenPGP digital signature


Bug#555954: cron stops inspection of new cron jobs after a 'Error: bad hour; while reading'

2009-11-12 Thread xavier renaut
Package: cron
Version: 3.0pl1-106
Severity: normal


if one creates a cron job in cron.d , wait for the reload,
change it again with a bad time, ie :

* 222 * * * root echo  /dev/null

cron will report  

cron[26144]: Error: bad hour; while reading /etc/cron.d/test2


then you can correct it,
cron wont reload it, and wont pick up new files in this directory.

thanks.




-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (900, 'testing'), (600, 'unstable'), (550, 'stable'), (549, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30.5.2.6.30.5-2-ws.2009.09.01 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages cron depends on:
ii  adduser   3.111  add and remove users and groups
ii  debianutils   3.2.1  Miscellaneous utilities specific t
ii  libc6 2.10.1-5   GNU C Library: Shared libraries
ii  libpam0g  1.1.0-4Pluggable Authentication Modules l
ii  libselinux1   2.0.87-3   SELinux runtime shared libraries
ii  lsb-base  3.2-23 Linux Standard Base 3.2 init scrip

Versions of packages cron recommends:
ii  exim4 4.69-11metapackage to ease Exim MTA (v4) 
ii  exim4-daemon-heavy [mail-tran 4.69-11+b1 Exim MTA (v4) daemon with extended
ii  lockfile-progs0.1.13 Programs for locking and unlocking

Versions of packages cron suggests:
pn  anacron   none (no description available)
pn  checksecurity none (no description available)
ii  logrotate 3.7.8-4Log rotation utility

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org