Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
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.
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()).
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 3RHEL 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.
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
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()).