+++ This bug was initially created as a clone of Bug #540119 +++ 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 404667 [details] patch ported from Debian
fixed in logrotate-3.7.8-8.fc14