Bug 247410 - Logrotate 3.7.4 does not honor size directive
Summary: Logrotate 3.7.4 does not honor size directive
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: logrotate (Show other bugs)
(Show other bugs)
Version: 5.0
Hardware: All Linux
low
low
Target Milestone: ---
: ---
Assignee: Tomas Smetana
QA Contact:
URL:
Whiteboard:
Keywords:
: 251596 448622 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-07-09 04:46 UTC by Seth Robertson
Modified: 2018-10-19 23:00 UTC (History)
4 users (show)

Fixed In Version: RHBA-2007-1002
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-15 14:07:41 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to address size option not working (649 bytes, patch)
2007-08-03 20:02 UTC, Chet Burgess
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:1002 normal SHIPPED_LIVE logrotate bug fix update 2007-11-15 14:07:38 UTC

Description Seth Robertson 2007-07-09 04:46:16 UTC
Description of problem:


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


How reproducible:


Steps to Reproduce:
1. echo foo > foo
2. cat > foo.logrotate <<EOF
$PWD/foo {
size 1
rotate 2
}
EOF
3. logrotate -dv foo
  
Actual results:
logrotate -dv foo.logrotate 
reading config file foo.logrotate
reading config info for /tmp/logrotate-3.7.4/foo 

Handling 1 logs

rotating pattern: /tmp/logrotate-3.7.4/foo  1048576 bytes (2 rotations)
empty log files are rotated, only log files >= 1 bytes are rotated, old logs are
removed
considering log /tmp/logrotate-3.7.4/foo
  log does not need rotating


Expected results:
reading config file foo.logrotate
reading config info for /tmp/logrotate-3.7.4/foo 

Handling 1 logs

rotating pattern: /tmp/logrotate-3.7.4/foo  1 bytes (2 rotations)
empty log files are rotated, old logs are removed
considering log /tmp/logrotate-3.7.4/foo
  log needs rotating
rotating log /tmp/logrotate-3.7.4/foo, log->rotateCount is 2
renaming /tmp/logrotate-3.7.4/foo.2 to /tmp/logrotate-3.7.4/foo.3 (rotatecount
2, logstart 1, i 2), 
renaming /tmp/logrotate-3.7.4/foo.1 to /tmp/logrotate-3.7.4/foo.2 (rotatecount
2, logstart 1, i 1), 
renaming /tmp/logrotate-3.7.4/foo.0 to /tmp/logrotate-3.7.4/foo.1 (rotatecount
2, logstart 1, i 0), 
renaming /tmp/logrotate-3.7.4/foo to /tmp/logrotate-3.7.4/foo.1
removing old log /tmp/logrotate-3.7.4/foo.3


Additional info:

Bug is at config.c line 620 being interfered with by 589.  You compare size
against opt, but the string opt pointed to was restored to its original value on
line 589 which causes the match to fail.  This means assignments to size and
minsize always get assigned to minsize.

Comment 1 Tomas Smetana 2007-07-09 07:47:16 UTC
You're right. Thanks for reporting.

Comment 2 Chet Burgess 2007-08-03 20:01:22 UTC
I didn't see a fix for this issue and since I needed the latest logrotate to
address another bug I was encountering I have created a patch for this bug. I
have attached a simple fix for this issue.

Comment 3 Chet Burgess 2007-08-03 20:02:27 UTC
Created attachment 160651 [details]
Patch to address size option not working

Comment 4 Tomas Smetana 2007-08-06 07:46:52 UTC
This bug is against RHEL, so you have to wait for the next update. If you
require a hotfix then you must contact the customer support.

Comment 5 Tomas Smetana 2007-08-13 07:48:37 UTC
*** Bug 251596 has been marked as a duplicate of this bug. ***

Comment 12 errata-xmlrpc 2007-11-15 14:07:41 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-1002.html


Comment 14 Tomas Smetana 2008-06-03 12:10:58 UTC
*** Bug 448622 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.