Bug 13805 - pam_windbind miscalculates password expiry times around daylight savings changes
Summary: pam_windbind miscalculates password expiry times around daylight savings changes
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Winbind (show other bugs)
Version: 4.10.0rc3
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Guenther Deschner
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-26 00:10 UTC by Douglas Bagnall
Modified: 2019-02-27 08:49 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Douglas Bagnall 2019-02-26 00:10:55 UTC
This is picked up in the testsuite when it is run in the last hour of the day in the six weeks leading up to daylight savings starting in the environment's locale. 

Like this:

UNEXPECTED(failure):
samba.tests.pam_winbind_warn_pwd_expire(domain).samba.tests.pam_winbind_warn_pwd_expire.PasswordExpirePamTests.test_auth_expire_warning(ad_member)
REASON: Exception: Exception: Traceback (most recent call last):
  File
"/memdisk/metze/W/b2272648/samba-ad-member/bin/python/samba/tests/pam_winbind_warn_pwd_expire.py",
line 44, in test_auth_expire_warning
    self.assertEqual(res.info[0], u"Your password will expire in 42
days.\n")
AssertionError: 'Your password will expire in 44 days.\n' != 'Your
password will expire in 42 days.\n'
- Your password will expire in 44 days.
?                               ^
+ Your password will expire in 42 days.
?                               ^

It would be understandable to say "43 days", but adding 44 is going too far. 

pam_winbind is using localtime_r() and rounding to the day start, which clearly has something to do with it.