Bug 27257

Summary: rotatelogs with getopt and setuid
Product: Apache httpd-2 Reporter: Sven Goldt <goldt>
Component: supportAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: ASSIGNED ---    
Severity: enhancement Keywords: PatchAvailable
Priority: P3    
Version: 2.0.48   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: more features for rotatelogs and using getopt.
New patch with apr_getopt instead of getopt and #ifdef APR_HAS_USER
Sorry. Don't know how to remove the other attachement. apr_getopt is not quite compatble to getopt so additional error checkings included.

Description Sven Goldt 2004-02-26 15:24:45 UTC
This will be a place to submit a patch for rotatelogs. The main problem with
rotatelogs was to write over NFS to a logfile and this is not always good as root.
While at it it showed to be a good idea to use getopt to make it extendable.
This also means a change in how rotatelogs has to be called. See source code for
details.
Comment 1 Sven Goldt 2004-02-26 15:25:47 UTC
Created attachment 10569 [details]
more features for rotatelogs and using getopt.
Comment 2 Sven Goldt 2004-02-27 09:39:41 UTC
Created attachment 10585 [details]
New patch with apr_getopt instead of getopt and #ifdef APR_HAS_USER
Comment 3 Sven Goldt 2004-02-27 10:11:27 UTC
Created attachment 10586 [details]
Sorry. Don't know how to remove the other attachement. apr_getopt is not quite compatble to getopt so additional error checkings included.
Comment 4 Sven Goldt 2004-02-27 12:47:10 UTC
Well, i don't want to add a new patch for this... i think i don't see the deeper
sense in apt_getlog. You can fool it very easy. So please as another check use
if (argc < 3) instead of if (argc == 1) to display usage instead of starting.
If you run this patched rotatelog with just a dash '-' as option it will not
recognize it as a wrong option !