NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/48944: cron ignores '?' (question mark) time field



>Number:         48944
>Category:       bin
>Synopsis:       cron ignores '?' (question mark) time field
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 24 08:25:00 +0000 2014
>Originator:     Hiramatsu Yoshifumi
>Release:        NetBSD 6.0.1
>Organization:
>Environment:
NetBSD onamae-vps.jgoamakf.info 6.0.1 NetBSD 6.0.1 (GENERIC) amd64

>Description:
man page of crontab (man 5 crontab) says

-----------------------
A field may begin with a question mark (`?'), which indicates a single
value randomly selected when the crontab file is read.
-----------------------

However, when I entered following line, cron ignores it

?      12      *       *       *       /home/scripts/backup.sh

>How-To-Repeat:
Use question mark for time field of crontab.

>Fix:
In src/external/bsd/cron/dist.entry.c, else if block for '?' is
empty due to duplicate line(probably merge error?).

RCS file: /cvsroot/src/external/bsd/cron/dist/entry.c,v
retrieving revision 1.4
diff -b -u -r1.4 entry.c
--- dist/entry.c        15 Jul 2010 20:03:28 -0000      1.4
+++ dist/entry.c        24 Jun 2014 08:02:03 -0000
@@ -479,7 +479,6 @@
                if (ch == EOF)
                        return (EOF);
        } else if (ch == '?') {
-       } else if (ch == '?') {
                qmark = TRUE;
                ch = get_char(file);
                if (ch == EOF)



Home | Main Index | Thread Index | Old Index