Bug 126490

Summary: Pre- and postrotate scripts don't pass logfile name in arg1
Product: [Fedora] Fedora Reporter: Balazs Nagy <js>
Component: logrotateAssignee: Elliot Lee <sopwith>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 2CC: karrer
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-07-16 19:32:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Balazs Nagy 2004-06-22 12:55:41 UTC
Description of problem:

In old logrotate 3.6 a prerotate or postrotate script called with the logfile name in the first 
argument.  Now no argument is passed to scripts.

Version-Release number of selected component (if applicable):
logrotate 3.7

The bug is in execlp(3) call.  In 3.6 there was a system(3) call, which handled everything 
well.  Now execlp() is called as execlp(filespec, logfn, NULL);, but execlp(3) man page says:

       int execlp( const char *file, const char *arg, ...);
...
       The  const  char  *arg  and subsequent ellipses in the execl, execlp, and execle 
functions can be
       thought of as arg0, arg1, ..., argn.  Together they describe a list of one or  more  
pointers  to
...
thus the first parameter (file) is filespec, arg0 is logfn (==the file is run as this name), and 
there're no arguments.  This line should be replaced by execlp(filespec, filespec, logfn, 
NULL);, or - much better - as described in bug 126259 (of course with a good arg0).

Comment 1 Elliot Lee 2004-07-16 19:32:48 UTC
Fixed in CVS. Thanks!

Comment 2 Miloslav Trmač 2004-10-19 16:50:31 UTC
*** Bug 129551 has been marked as a duplicate of this bug. ***