Red Hat Bugzilla – Bug 71480
Local Time Not Reported for Lease
Last modified: 2008-05-01 11:38:03 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020615
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
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):
Steps to Reproduce:
1.pump -i eth0
2.pump -i eth0 --status
Actual Results: Already provided in the above description.
Expected Results: Should have used my local time.
A trivial fix. Seems reasonable.
already fixed in cvs:
static const char *const fmt = "%c"; /* stupid Y2K paranoid compiler */
upnow = pumpUptime();
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);