Bug 1006 - sudoers/test19: test fails with certain TZ values
sudoers/test19: test fails with certain TZ values
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudoers
1.9.8
PC Linux
: low normal
Assigned To: Todd C. Miller
: 1012 1018 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-10-30 19:02 MDT by James Beddek
Modified: 2022-01-15 08:48 MST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Beddek 2021-10-30 19:02:15 MDT
With TZ set to "Pacific/Auckland", the sudoers test "test19" fails with output such as:

sudoers/test19 (json): FAIL
13,14c13,14
<                         { "notbefore": "20170214073000Z" },
<                         { "notafter": "20170301073000Z" }
---
>                         { "notbefore": "20170214083000Z" },
>                         { "notafter": "20170301083000Z" }
33c33
<                         { "notbefore": "20170214073000Z" }
---

A downstream bug report for Gentoo was filed regarding this, please see https://bugs.gentoo.org/667600 . The solution on Gentoo's side was to set TZ=UTC when running the test suites.

This doesn't happen with all TZ values, I assume just the more uncommon ones.
Comment 1 Todd C. Miller 2021-10-31 08:48:49 MDT
Thanks for the report.  This is fixed by https://www.sudo.ws/repos/sudo/rev/20c60fe8e8fc

The bug only comes into play when the status daylight saving time is different in the parsed timestamp vs. the current time.  In the next release, sudo will use timegm() if available instead.
Comment 2 Todd C. Miller 2021-10-31 10:30:59 MDT
Commit to use timegm() instead:  https://www.sudo.ws/repos/sudo/rev/3ca20dfdb44c
Comment 3 Todd C. Miller 2021-12-11 06:22:16 MST
*** Bug 1012 has been marked as a duplicate of this bug. ***
Comment 4 Todd C. Miller 2022-01-15 08:48:12 MST
*** Bug 1018 has been marked as a duplicate of this bug. ***