Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 1082014

Summary: Error: print() on closed filehandle
Product: Red Hat Enterprise Linux 5 Reporter: Marcel Kolaja <mkolaja>
Component: logwatchAssignee: Jan Synacek <jsynacek>
Status: CLOSED WONTFIX QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: low Docs Contact:
Priority: unspecified    
Version: 5.11CC: pb+red-hat
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1017109 Environment:
Last Closed: 2014-10-08 18:00:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1017109    
Bug Blocks:    
Attachments:
Description Flags
messages file to reproduce the issue
none
proposed patch based on the patch from bug #1017109
none
proposed alternative (preferred) patch to be in line with the approach taken in upstream none

Comment 1 Marcel Kolaja 2014-03-28 13:41:13 UTC
Created attachment 879837 [details]
messages file to reproduce the issue

Reproducer:

1. place the attached file in /var/tmp/messages
2. run the following command:

# logwatch --logdir /var/tmp/ --logfile messages --print --range All --splithosts > /dev/null

Actual results:

Displays the following error message:

print() on unopened filehandle OUTFILE at /etc/cron.daily/0logwatch line 1293.

Expected results:

no error message

The issue occurs only when both of the following conditions are met:

(i) there are multiple hosts in the log file
(ii) the --splithosts option is used

Comment 2 Marcel Kolaja 2014-03-28 14:36:20 UTC
Created attachment 879861 [details]
proposed patch based on the patch from bug #1017109

Comment 3 Marcel Kolaja 2014-03-28 15:38:51 UTC
Created attachment 879913 [details]
proposed alternative (preferred) patch to be in line with the approach taken in upstream

upstream bug: http://sourceforge.net/p/logwatch/bugs/14/

Comment 4 Chris Williams 2014-10-08 18:00:31 UTC
RHEL 5 is now in Production Phase 3.
https://access.redhat.com/support/policy/updates/errata/#Production_3_Phase
No further minor release are planned for this product.
This BZ is being closed as it does not meet phase 3 inclusion criteria.