bugGNU FreeIPMI - Bugs: bug #38798, timestamps are interpretted as UTC...

 
 

bug #38798: timestamps are interpretted as UTC rather than localtime, violating IPMI 2.0 section 37

Submitter:  Rob Swindell <rswindell>
Submitted:  Mon 22 Apr 2013 04:33:14 AM UTC
   
 
Category:  ipmi-sel Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Improper Behaviour
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 08 May 2013 05:29:38 PM UTC, comment #3: 

I've updated the trunk w/ what I believe to be the right fixes.  Included are 3 new options in all appropriate tools (i.e. ipmi-sel, bmc-device, etc.).  They are --utc-to-localtime, --localtime-to-utc, and --utc-offset.  They do about what they sound like, more info can be found in the manpages.

Albert Chu <chu11>
Group administrator
Sat 27 Apr 2013 03:50:17 PM UTC, comment #2: 

This is going to be a pretty dramatic change in FreeIPMI, so I'm going to aim this for FreeIPMI 1.3.1 instead of a 1.2.X minor release.

After thinking about it, I think the goal is to support a --output-utc-time like-option for users that want UTC time instead of local time and a --assume-utc-time like option/workaround to handle the case that motherboards store times in UTC in the SEL.  Many motherbaords appear to store in the SEL in UTC time, which is probably why FreeIPMI converted to localtime so many years ago when this was first implemented.

Albert Chu <chu11>
Group administrator
Thu 25 Apr 2013 10:42:58 PM UTC, comment #1: 

Here's a patch for one instance of this problem. Like I suggested for bug #38799, a generic "IPMI timestamp" function should be created and used everywhere so as to resolve these issues globally:

===================================================================
--- bmc-device.c        (revision 9608)
+++ bmc-device.c        (working copy)
@@ -1281,7 +1281,7 @@
   memset (&tm, '\0', sizeof(struct tm));

   t = val;
-  localtime_r (&t, &tm);
+  gmtime_r (&t, &tm);
   strftime (timestr, sizeof (timestr), "%m/%d/%Y - %H:%M:%S", &tm);
   pstdout_printf (state_data->pstate,
                   "SEL Time : %s\n",

Rob Swindell <rswindell>
Mon 22 Apr 2013 04:33:14 AM UTC, original submission:  

IPMI 2.0 section 37 ("Timestamp Format") states that all timestamps (e.g. for SDR repository and SEL) are "representing local time ... does not include GMT offset.", yet ipmi-sel and bmc-device interpret timestamps as though they are based on GMT/UTC and apply the local timezone bias before printing in human-readable form.

Rob Swindell <rswindell>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chu11 (Posted a comment)
  • -email is unavailable- added by rswindell (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-05-09 chu11 Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code