Bug 247410 - Logrotate 3.7.4 does not honor size directive
Logrotate 3.7.4 does not honor size directive
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: logrotate (Show other bugs)
5.0
All Linux
low Severity low
: ---
: ---
Assigned To: Tomas Smetana
:
: 251596 448622 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-09 00:46 EDT by Seth Robertson
Modified: 2013-04-12 15:13 EDT (History)
4 users (show)

See Also:
Fixed In Version: RHBA-2007-1002
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-15 09:07:41 EST
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 16:02 EDT, Chet Burgess
no flags Details | Diff

  None (edit)
Description Seth Robertson 2007-07-09 00:46:16 EDT
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 03:47:16 EDT
You're right. Thanks for reporting.
Comment 2 Chet Burgess 2007-08-03 16:01:22 EDT
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 16:02:27 EDT
Created attachment 160651 [details]
Patch to address size option not working
Comment 4 Tomas Smetana 2007-08-06 03:46:52 EDT
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 03:48:37 EDT
*** Bug 251596 has been marked as a duplicate of this bug. ***
Comment 12 errata-xmlrpc 2007-11-15 09:07:41 EST
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 08:10:58 EDT
*** 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.