Bug 71480

Summary: Local Time Not Reported for Lease
Product: [Retired] Red Hat Linux Reporter: Need Real Name <tajohnson>
Component: pumpAssignee: Eido Inoue <havill>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: athlon   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-03-11 23:32:08 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:

Description Need Real Name 2002-08-14 07:12:19 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020615
Debian/1.0.0-3

Description of problem:
The lease time from 'pump -i eth0 --status' is being reported as UTC time, and
perhaps incorrectly.  I am UTC+5, which explains the time difference below, but
the date should be one day later if that is the case.  I checked out a new lease
immediately before checking the status below:

        (details omitted here...)
        Renewal time: Wed Aug 14 08:45:53 2002
        Expiration time: Wed Aug 14 09:45:53 2002
my_machine:/etc/network# date
Wed Aug 14 01:46:05 EST 2002

It would seem preferable to report the lease using the user's local time.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.pump -i eth0
2.pump -i eth0 --status
3.date
	

Actual Results:  Already provided in the above description.

Expected Results:  Should have used my local time.

Additional info:

Comment 1 Eido Inoue 2002-11-04 17:54:02 UTC
A trivial fix. Seems reasonable.

Comment 2 Eido Inoue 2003-03-11 23:32:08 UTC
already fixed in cvs:

      static const char *const fmt = "%c"; /* stupid Y2K paranoid compiler */

      upnow = pumpUptime();
      tzset();
      now = time(NULL);
      localAt = now + (i.renewAt - upnow);
      localExpiration = now + (i.leaseExpiration - upnow);
      strftime(s, sizeof(s), fmt, localtime(&localAt));
      printf(_("\tRenewal time: %s\n"), s);
      strftime(s, sizeof(s), fmt, localtime(&localExpiration));
      printf(_("\tExpiration time: %s\n"), s);