[Koha-bugs] [Bug 11188] New: Make gather_print_notices.pl die on failed open()

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Nov 2 19:16:10 CET 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11188

            Bug ID: 11188
           Summary: Make gather_print_notices.pl die on failed open()
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P5 - low
         Component: Command-line Utilities
          Assignee: magnus at enger.priv.no
          Reporter: magnus at enger.priv.no
        QA Contact: testopia at bugs.koha-community.org

Currently, gather_print_notices.pl tries to open a file to write notices to,
but it does not check that the open() succeeded. This can result in the
following error error, if you point at a location you do not have write access
to:

print() on closed filehandle $OUTPUT at
/usr/share/koha/bin/cronjobs/gather_print_notices.pl line 129.

But the script proceeds on its merry way, and marks the "pending" messages it
found as "sent", which means you can't re-run the script with another location
and gather up the notices you meant to gather up. 

I'll propose to replace the current "open(...)" with an "open(...) or die()". 

(I'll probably do a patch for this during training on Monday, so please don't
fix it before that :-)

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list