'at DAY_OF_WEEK' calculates wrong date when its next year.

Bug #312051 reported by Mike Holland
40
This bug affects 4 people
Affects Status Importance Assigned to Milestone
at (Debian)
Fix Released
Unknown
at (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Binary package hint: at

The parsetime() function gets the wrong date, incorrectly adding a year, when day of week is specified, and
job is to be exectuted in the new year.

Affects 8.04 and 8.10 . Older 5.10 is OK.

e.g.
$ at 9am mon
warning: commands will be executed using /bin/sh
at> foo
at> <EOT>
job 12 at Tue Jan 5 08:00:00 2010

I found the bug in at-3.1.10ubuntu4 parsetime.y line 496:

 else if (!yearspec) {
     if ((exectm.tm_mon < currtm.tm_mon) ||
         ((exectm.tm_mon == currtm.tm_mon &&
       exectm.tm_mday < currtm.tm_mday)))
  exectm.tm_year++;
 }

To handle the case of "at DAY" where DAY is a day of the week that is next year, that first line could be:

 else if (!yearspec && exectm.tm_year == currtm.tm_year ) {

Does that look OK? I know nothing of lex and yacc (flex/bison) .
I suppose this is an upstream problem for debian and GNU?
How do I track it upstream? There doesn't seem to be an 'at' package on the GNU mirrors.

Related branches

Revision history for this message
Mike Holland (z-launchpad-myk-id-au) wrote :

I belatedly found the bug already reported upstream in Debian. Its a couple of years old :-(
Since they are so slow to fix it, can a patch be applied in Ubuntu?

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

Does this come from the FSF/GNU or is it a version written for debian?

Changed in at:
status: Unknown → Fix Committed
Changed in at (Debian):
status: Fix Committed → New
Changed in at (Debian):
status: New → Fix Committed
Changed in at (Ubuntu):
status: New → Fix Committed
assignee: nobody → Ansgar Burchardt (ansgar-43-1)
Changed in at (Debian):
status: Fix Committed → Fix Released
Revision history for this message
Micah Gersten (micahg) wrote :

Marking high as jobs are happening at the wrong time and Triaged as we don't have this in the Ubuntu archive yet.

Changed in at (Ubuntu):
importance: Undecided → High
status: Fix Committed → Triaged
Revision history for this message
C de-Avillez (hggdh2) wrote :

@Ansgar -- are you working on a debdiff for this?

Revision history for this message
Ansgar Burchardt (aburch) wrote : Re: [Bug 312051] Re: 'at DAY_OF_WEEK' calculates wrong date when its next year.

C de-Avillez <email address hidden> writes:
> @Ansgar -- are you working on a debdiff for this?

No, I just assigned the bug to myself while I was working on a patch.
A fixed version is already uploaded to Debian.

The fix for this particular problem is
2160392be1716fc9895f09e3fd1ce148ec0325c9

 assignee nobody

Changed in at (Ubuntu):
assignee: Ansgar Burchardt (ansgar-43-1) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package at - 3.1.12-1ubuntu1

---------------
at (3.1.12-1ubuntu1) maverick; urgency=low

  * Merge from Debian unstable (LP: #559117), remaining changes:
    - Replace init script with Upstart job, and bump build-dependency on
      debhelper for Upstart-aware dh_installinit
    - debian/control: Add missing ${misc:Depends}
    - Suggest: default-mta | mail-transport-agent instead of Recommends:
      exim | mail-transport-agent
  * Dropped changes:
    - Set SENDMAIL to /usr/lib/sendmail: this is wrong, the correct path of
      /usr/sbin/sendmail as mandated by policy for the m-t-a package is
      already used in Debian.
    - Depend on lsb >= 3.2-14: superseded by upstart job and merged in
      Debian.
    - Add the 'status' action to the init script: superseded by upstart job.

at (3.1.12-1) unstable; urgency=low

  * New upstream release:
    + do not increment year twice (Closes: #404965) (LP: #312051)
    + do not increment day of month twice (Closes: #386665)
    + update documentation on removed environment variables
      (Closes: #335374)
    + add -f option to stay in foreground (Closes: #208367) - thanks to
      Marcela Maslanova <email address hidden>
    + error when day of month is 0 (Closes: #372671)
    + make less assumptations on open file descriptors (Closes: #453707)
    + add status action to init script (Closes: #506829)
    + make stdout, stderr available to sendmail process (Closes: #316442)
    + document -b option (LP: #156493)
    + document 4-digit years and ISO date format (Closes: #359010)
    + add test suite for date/time parser (Closes: #86662)
      - add build-dep on perl (>= 5.10.1) for Test::More 0.92
  * use dh_installinit (Closes: #406359)
  * remove support for upgrading from pre-3.1.9
  * remove rc, pam (moved upstream)
  * remove Cyril Brulebois from Uploaders as requested on IRC
  * now depends on lsb-base (>= 3.2-14) for status_of_proc in init script
  * add dependency on libpam-runtime (>= 1.0.1-11) for
    common-session-noninteractive
  * update debian/copyright
  * bump Standards-Version to 3.8.3 (no changes)
  * debian/control: Add DM-Upload-Allowed: yes.
 -- Steve Langasek <email address hidden> Thu, 17 Jun 2010 16:32:42 +0000

Changed in at (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.