mreynolds / 389-ds-base

Forked from 389-ds-base 6 years ago
Clone

3bcba24 Bug 615100 - log rotationinfo always recreated at startup,

Authored and Committed by nhosoi 13 years ago
    Bug 615100 - log rotationinfo always recreated at startup,
     and corrupted on some platforms
    
    https://bugzilla.redhat.com/show_bug.cgi?id=615100
    
    Description:
    1) At startup log__check_prevlogs() verifies that all logs are
    referenced in the rotationinfo file.  If the rotationinfo file
    doesn't reference all the present log files, it will recreate
    the rotationinfo file based on the log files that are present.
    However, the logic to break out of the loop that performs the
    verification is incorrect so it always considers the rotationinfo
    file to be bogus and recreates it.  I've corrected the logic.
    
    2) Recreating the rotationinfo file isn't bad per se, but the
    code that recreates the rotationinfo file is also broken on HP-UX
    (and probably Solaris). It tries to use the libc function strptime()
    to format a date such as "20100128-153532" into a struct tm, so that
    it can create an epoch date from there.  The format string being
    used for strptime() is "%Y%m%d-%H%M%S", which works on Linux, but
    the strptime() function requires whitespace or alpha-numeric
    separators between format specifiers on HP-UX (and Solaris according
    to their man page), so strptime() fails.  My fix here was to convert
    the compact date string into a string in ISO8601-like format with
    separators so strptime() can parse it.
    
    This patch was provided by Ulf Weltman (ulf.weltman@hp.com).
    
        
file modified
+19 -6