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

Submitted by:  Rob Swindell <rswindell>
Submitted on:  Mon 22 Apr 2013 04:33:14 AM UTC  
 
Category: ipmi-selSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Improper Behaviour
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Operating System: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 09 May 2013 05:10:05 PM UTCchu11Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1