Uploaded image for project: 'Percona Server'
  1. Percona Server
  2. PS-226

Audit Log Creates Unparsable Date String

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 5.5, 5.6, 5.7, 8.0
    • Fix Version/s: 8.0.15-5
    • Component/s: None
    • Labels:

      Description

      The audit log currently produces time stamps like this:

      2016-11-15T12:12:34 UTC

      This is not a recognized standard for ISO8601.

      If the time is in UTC, add a Z directly after the time without a space. Z is the zone designator for the zero UTC offset. "09:30 UTC" is therefore represented as "09:30Z" or "0930Z". "14:45:15 UTC" would be "14:45:15Z" or "144515Z".

      Please consider the following patch to correct this:

      diff --git a/audit_log.c b/audit_log.c
      index 39078fa..4c3224d 100644
      --- a/audit_log.c
      +++ b/audit_log.c
      @@ -134,7 +134,7 @@ char *make_timestamp(char *buf, size_t buf_len, time_t t)
         struct tm tm;
      
         memset(&tm, 0, sizeof(tm));
      -  strftime(buf, buf_len, "%FT%T UTC", gmtime_r(&t, &tm));
      +  strftime(buf, buf_len, "%FT%TZ", gmtime_r(&t, &tm));
      
         return buf;
       }
      

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  satya.bodapati Satya Bodapati
                  Reporter:
                  matthew.boehm@percona.com Matthew Boehm
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 4 hours
                    4h