Bug 736037

Summary: system-config-user calculates wrong expiry date
Product: Red Hat Enterprise Linux 6 Reporter: Nils Philippsen <nphilipp>
Component: system-config-usersAssignee: Nils Philippsen <nphilipp>
Status: CLOSED ERRATA QA Contact: David Spurek <dspurek>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: dspurek, ebenes, mvadkert, nphilipp
Target Milestone: rcKeywords: EasyFix, Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 735933
: 1889334 (view as bug list) Environment:
Last Closed: 2012-10-18 11:44:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 735933    
Bug Blocks: 1889334    

Description Nils Philippsen 2011-09-06 13:31:42 UTC
+++ This bug was initially created as a clone of Bug #735933 +++

+++ This bug was initially created as a clone of Bug #447710 +++

Description of problem:

system-config-user calculates the wrong expire date.
When the expire date is set to 0 it shows the 01-02-1970, but not the
01-01-1970. All other dates are one day later!

Version-Release number of selected component (if applicable):
system-config-users-1.2.110-1

How reproducible:
100%

Steps to Reproduce:
1. Start system-config-user, set the expire date to 1970-01-01
2. Look into /etc/shadow -> correct 0
3. Load the user with system-config-user again and hav a look to the expire
date: 1970-01-02

  
Actual results:
One day later

Expected results:
same date

Additional info:

--- Additional comment from nphilipp on 2011-09-06 07:15:41 EDT ---

This actually only applies to expiration dates before 1970-01-01 UTC.

--- Additional comment from nphilipp on 2011-09-06 07:18:02 EDT ---

fixed in git:

commit 57ba7b55d6d6606792ec2bf444fe62958ff15b0c
Author:     Nils Philippsen <nils>
AuthorDate: Tue Sep 6 13:16:08 2011 +0200

    correctly calculate expiration dates before the epoch (#735933)

Comment 7 David Spurek 2012-09-05 07:32:16 UTC
Hi, I am not able to reproduce this bug as you describe it.

When I set the expire date to 1970-01-01, in /etc/shadow is 1, Load the user with system-config-user again and have a look to the expire
date: 1970-01-01

But when I set expire date to 1969-01-01 and load the user with system-config-user again and have a look to the expire
date: 1969-01-02

Depend bug on timezone setup?

Comment 8 Nils Philippsen 2012-09-05 08:10:18 UTC
(In reply to comment #7)
> Hi, I am not able to reproduce this bug as you describe it.
> 
> When I set the expire date to 1970-01-01, in /etc/shadow is 1, Load the user
> with system-config-user again and have a look to the expire
> date: 1970-01-01
> 
> But when I set expire date to 1969-01-01 and load the user with
> system-config-user again and have a look to the expire
> date: 1969-01-02
> 
> Depend bug on timezone setup?

Yes, if you're looking at the time span around begin of epoch (1970-01-01 0:00 UTC) the bug depends on the time zone. For the bug to manifest, the time/date set must be before begin of epoch -- so setting it to 1970-01-01 will only exhibit the bug if the time zone is before UTC (e.g. Central European Time). If you set the expiration date to 1969-01-01, it will be before 1970-01-01 0:00 UTC regardless of the time zone set, therefore you see the bug in this case.

Comment 11 errata-xmlrpc 2012-10-18 11:44:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-1387.html