Description of problem: globs for filenames are processed before the options for a log file are processed, causing the code that attempts to handle glob errors not to work correctly. Version-Release number of selected component (if applicable): logrotate-3.7.4-9 [RHEL 5] logrotate-3.7.8-5.fc12 [Fedora 12] Steps to Reproduce: 1. Add to /etc/logrotate.conf === /var/log/missing/foo { missingok } /var/log/missing2/foo* { missingok } === 2. Run logrotate Actual results: No error is produced for the first stanza where no glob is involved, the second stanza produces: === error: error accessing /var/log/missing2: No such file or directory error: /etc/logrotate.conf:39 glob failed for /var/log/missing2/foo* error: found error in /var/log/missing2/foo* , skipping ==== (The last line occurs for Fedora 12, in RHEL 5, the entire log rotation process fails.) Expected results: missingok causes log rotation to be silently skipped, even when a glob is involved. Additional info: There are two problems in the code in config.c: 1. The 'globerr' function has no access to the flags for the logfile and prints the first line above unconditionally. Current logInfo could be stored in a global variable. 2. The glob parsing is done before the options for the log file have been read, so even though the code checks: if (rc == GLOB_ABORTED) { if (newlog->flags & LOG_FLAG_MISSINGOK) continue; that has no affect if the flag is set in the options for that log file.
Created attachment 406281 [details] patch ported from Debian
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 unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux.
This request was erroneously denied for the current release of Red Hat Enterprise Linux. The error has been fixed and this request has been re-proposed for the current release.
Would be great to have this solved ...
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 therefore 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-2011-0816.html