Bug 64321

Summary: rotatelogs: preserve log messages in case of rotation
Product: Apache httpd-2 Reporter: jlp72 <gigranata>
Component: supportAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 2.4.43   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: patch for rotatelogs - 2.4.43

Description jlp72 2020-04-07 11:39:05 UTC
Created attachment 37153 [details]
patch for rotatelogs - 2.4.43

I noticed that the ROTATELOGS program loses messages in case you pass the -n option.
For simplicity I indicate FILE_NAME the file passed as input to ROTATE_LOGS.
When I start Apache, rotatelogs always restarts from FILE_NAME even if the last write occurred in the FILE_NAME.x file (with 0 <x <n).
With the proposed modification, carried out on Apache version 2.4.39, the last modified file is checked in chronological order and the process starts in append on that file.

The error is present from version 2.4.37 (probably earlier) to 2.4.43.

In attach the patch obtained from version 2.4.43