RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 847338 - logrotate ignores create mode
Summary: logrotate ignores create mode
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: logrotate
Version: 6.3
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Jan Kaluža
QA Contact: Tomas Dolezal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-10 15:25 UTC by Daniel Crisman
Modified: 2018-12-03 17:44 UTC (History)
4 users (show)

Fixed In Version: logrotate-3.7.8-17.el6
Doc Type: Bug Fix
Doc Text:
Cause: Setting the ACL on rotated log overwrote the previously set mode of the log file. Consequence: "create" directive was ignored. Fix: When "create" directive is used, ACL are not copied from old log file and mode defined using "create" directive is used instead. Result: "create" mode works like before and is not ignored.
Clone Of:
Environment:
Last Closed: 2013-07-18 09:35:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1095 0 normal SHIPPED_LIVE logrotate bug fix update 2013-07-18 13:34:25 UTC

Description Daniel Crisman 2012-08-10 15:25:33 UTC
Description of problem:
The mode in the directive 'create mode owner group' is ignored when
built with WITH_ACL.

Version-Release number of selected component (if applicable):
logrotate-3.7.8-15.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
echo -e 'weekly\nrotate 4\ncreate\ndateext\n\n"./a.log" {\n    create 0600\n}' > conf
echo -e 'logrotate state -- version 2\n"./a.log" 2000-8-9n' > state
rm -f a.log*
touch a.log
chmod 644 a.log
logrotate -v -s state conf
ls -l a.log*
  
Actual results:
# on RHEL Server 6.3
new a.log is mode 0644

Expected results:
# as it worked on RHEL Server 6.2 and before
new a.log is mode 0600

Additional info:
Caused by the ACL change from bug 683622

acl_set_fd on line 1266 overwrites the mode set in createOutputFile() on line 1259.

acl_set_fd really should be an alternate to fchmod on line 251 inside createOutputFile():
    #ifdef WITH_ACL
        # do acl_set_fd stuff
    #else
        # do fchmod
    #endif
but that probably break other uses of createOutputFile().

Alternate solution to ACL issue would be to allow the mode in the create directive to be a mode (octal number) or acl text (see SHORT TEXT FORM in acl(5) to process with acl_from_text()).

Comment 2 Jan Kaluža 2012-08-13 12:06:32 UTC
Thanks for the report. I think patch I've just committed into logrotate repository should fix this issue. I have also added two tests to test the fix.

https://fedorahosted.org/logrotate/changeset/382

Comment 3 RHEL Program Management 2012-09-07 05:12:06 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 4 Tim Mooney 2012-09-20 15:51:17 UTC
We are being impacted by this issue too and would like to see the fix included in a logrotate release before RHEL 6.4.

Comment 12 errata-xmlrpc 2013-07-18 09:35:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1095.html


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