Bug 126490 - Pre- and postrotate scripts don't pass logfile name in arg1
Summary: Pre- and postrotate scripts don't pass logfile name in arg1
Alias: None
Product: Fedora
Classification: Fedora
Component: logrotate   
(Show other bugs)
Version: 2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Elliot Lee
QA Contact:
: 129551 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2004-06-22 12:55 UTC by Balazs Nagy
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

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

Attachments (Terms of Use)

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. ***

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