Bug 71480 - Local Time Not Reported for Lease
Local Time Not Reported for Lease
Product: Red Hat Linux
Classification: Retired
Component: pump (Show other bugs)
athlon Linux
medium Severity medium
: ---
: ---
Assigned To: Eido Inoue
Depends On:
  Show dependency treegraph
Reported: 2002-08-14 03:12 EDT by Need Real Name
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-03-11 18:32:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2002-08-14 03:12:19 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
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:

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.

Additional info:
Comment 1 Eido Inoue 2002-11-04 12:54:02 EST
A trivial fix. Seems reasonable.
Comment 2 Eido Inoue 2003-03-11 18:32:08 EST
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);

Note You need to log in before you can comment on or make changes to this bug.