Bug#786587: libcgi-pm-perl: change to tempfile handling in 4.05 breaks Ikiwiki

Simon McVittie smcv at debian.org
Sun Jun 7 13:46:14 UTC 2015


forwarded 786587 https://github.com/leejo/CGI.pm/issues/178

On Sat, 23 May 2015 at 09:07:55 +0200, Jonas Smedegaard wrote:
> Ikiwiki attachment plugin messes internally with tempfile object and
> stopped working with the change in 4.05.

On closer examination, this is not actually the case: ikiwiki's preferred
code path uses a documented API. It might not have been documented at the
time it was added (the comment in ikiwiki implied that it wasn't), but it
is now:

"""
If you need to you
can access the temporary file directly. You can access the temp file for a file
upload by passing the file name to the tmpFileName() method:

    my $filename    = $query->param( 'uploaded_file' );
    my $tmpfilename = $query->tmpFileName( $filename );
"""

However, it seems that this no longer works: tmpFileName now expects a
file-handle, as received from $query->upload('uploaded_file'). I've
reported this upstream, <https://github.com/leejo/CGI.pm/issues/178>.

I have what appears to be a valid workaround for ikiwiki (trying the result
of upload() before or after the result of param()), which I'll test and
upload soon.

If the preferred code path fails, ikiwiki does try to use CGI.pm
internals before giving up entirely, but that's only there as a
workaround for Perl 5.8-era CGI.pm. I might delete that, since Perl 5.8
is a decade old at this point.

    S



More information about the pkg-perl-maintainers mailing list