Bug 1006

Summary: sudoers/test19: test fails with certain TZ values
Product: Sudo Reporter: James Beddek <telans>
Component: SudoersAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal CC: brickviking, mh+sudo-bugzilla
Priority: low    
Version: 1.9.8   
Hardware: PC   
OS: Linux   

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. ***