Bug 126490 - Pre- and postrotate scripts don't pass logfile name in arg1
Pre- and postrotate scripts don't pass logfile name in arg1
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: logrotate (Show other bugs)
2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Elliot Lee
:
: 129551 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-06-22 08:55 EDT by Balazs Nagy
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-07-16 15:32:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Balazs Nagy 2004-06-22 08:55:41 EDT
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 15:32:48 EDT
Fixed in CVS. Thanks!
Comment 2 Miloslav Trmač 2004-10-19 12:50:31 EDT
*** Bug 129551 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.