[Bug 1214060] New: html2ps conversion fails with perl >= 5.26
https://bugzilla.suse.com/show_bug.cgi?id=1214060 Bug ID: 1214060 Summary: html2ps conversion fails with perl >= 5.26 Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Other Assignee: screening-team-bugs@suse.de Reporter: christophe@krop.fr QA Contact: qa-bugs@suse.de Target Milestone: --- Found By: --- Blocker: --- Affected: Tumbleweed, Leap, SLE 15 html2ps -f <file> fails with this error: Unimplemented: POSIX::tmpnam(): use File::Temp instead at /usr/bin/html2ps line 498. We're apparently having an old version in openSUSE (some distro have 1.0b7) and it needs patching. Debian has a collection of improvements and fixes: https://salsa.debian.org/debian/html2ps/-/tree/master/debian/patches The important one for this report is perl-deprecation.patch -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1214060 Christophe Marin <christophe@krop.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|screening-team-bugs@suse.de |prusnak@opensuse.org CC| |mpluskal@suse.com, | |werner@suse.com -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1214060 https://bugzilla.suse.com/show_bug.cgi?id=1214060#c1 Bodo Eggert <7eggert@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |7eggert@gmx.de --- Comment #1 from Bodo Eggert <7eggert@gmx.de> --- Partially tested patch: Also fixes unrelated write to a closed file handle --- /bin/html2ps.orig 2024-11-11 21:24:34.494394856 +0100 +++ /bin/html2ps 2024-11-11 22:30:02.293753109 +0100 @@ -357,6 +357,8 @@ EOR use POSIX; $posix = 1; +use File::Temp qw/ tempdir /; + %extend=('quote',1, 'font',1, 'colour',1, 'hyphenation',1); %fal=("serif","times", "sans_serif","helvetica", "monospace","courier"); @fo=("p","pre","h1","h2","h3","h4","h5","h6","i","b","tt","kbd","cite","samp", @@ -495,11 +497,9 @@ die "Ghostscript is required to generate if($opt_D && !$package{'Ghostscript'}); die "Ghostscript is required to generate cross references\n" if($opt_R && !$package{'Ghostscript'}); -$tmpname=$posix?POSIX::tmpnam():"h2p_$$"; -sysopen TMP, $tmpname, O_RDWR|O_CREAT|O_EXCL, 0600 or die "$!"; -close TMP; -($scr=$tmpname)=~/\w+$/; -$tempdir=$`; + +$tempdir = tempdir( CLEANUP => 1 ); +$scr = File::Temp::tempnam( $tempdir, "html2ps_" ); if($opt_u) {$ulanch="t"}; if(defined $opt_x && $opt_x!~/^[0-2]$/) { @@ -4517,6 +4517,7 @@ sub prompt { chop($_[1]=<STDIN>); } sub dbg { + return if !$opt_d; print STDERR $_[0]; print DBG $_[0]; } -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1214060 https://bugzilla.suse.com/show_bug.cgi?id=1214060#c2 Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |christophe@krop.fr Flags| |needinfo?(christophe@krop.f | |r) --- Comment #2 from Dr. Werner Fink <werner@suse.com> --- I've just updated to 1.0b7 and added most of the Debian patches ... please test out!! (In reply to Bodo Eggert from comment #1)
Partially tested patch:
Also fixes unrelated write to a closed file handle
--- /bin/html2ps.orig 2024-11-11 21:24:34.494394856 +0100 +++ /bin/html2ps 2024-11-11 22:30:02.293753109 +0100 @@ -357,6 +357,8 @@ EOR use POSIX; $posix = 1;
+use File::Temp qw/ tempdir /; + %extend=('quote',1, 'font',1, 'colour',1, 'hyphenation',1); %fal=("serif","times", "sans_serif","helvetica", "monospace","courier"); @fo=("p","pre","h1","h2","h3","h4","h5","h6","i","b","tt","kbd","cite", "samp", @@ -495,11 +497,9 @@ die "Ghostscript is required to generate if($opt_D && !$package{'Ghostscript'}); die "Ghostscript is required to generate cross references\n" if($opt_R && !$package{'Ghostscript'}); -$tmpname=$posix?POSIX::tmpnam():"h2p_$$"; -sysopen TMP, $tmpname, O_RDWR|O_CREAT|O_EXCL, 0600 or die "$!"; -close TMP; -($scr=$tmpname)=~/\w+$/; -$tempdir=$`; + +$tempdir = tempdir( CLEANUP => 1 ); +$scr = File::Temp::tempnam( $tempdir, "html2ps_" );
if($opt_u) {$ulanch="t"}; if(defined $opt_x && $opt_x!~/^[0-2]$/) { @@ -4517,6 +4517,7 @@ sub prompt { chop($_[1]=<STDIN>); } sub dbg { + return if !$opt_d; print STDERR $_[0]; print DBG $_[0]; }
is this still required ? -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1214060 https://bugzilla.suse.com/show_bug.cgi?id=1214060#c4 --- Comment #4 from OBSbugzilla Bot <bwiedemann+obsbugzillabot@suse.com> --- This is an autogenerated message for OBS integration: This bug (1214060) was mentioned in https://build.opensuse.org/request/show/1223930 Factory / html2ps -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1214060 https://bugzilla.suse.com/show_bug.cgi?id=1214060#c5 --- Comment #5 from Bodo Eggert <7eggert@gmx.de> --- By the way, using tmpnam is a documented security risk. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1214060 https://bugzilla.suse.com/show_bug.cgi?id=1214060#c6 --- Comment #6 from Dr. Werner Fink <werner@suse.com> --- (In reply to Bodo Eggert from comment #5)
By the way, using tmpnam is a documented security risk.
That should do the job --- html2ps-1.0b7/html2ps +++ html2ps-1.0b7/html2ps 2024-11-14 08:12:35.973246396 +0000 @@ -355,7 +355,8 @@ EOR use POSIX; $posix = 1; -use File::Temp qw/ :POSIX /; +use File::Temp qw/ :POSIX :mktemp /; +use File::Basename; %extend=('quote',1, 'font',1, 'colour',1, 'hyphenation',1); %fal=("serif","times", "sans_serif","helvetica", "monospace","courier"); @@ -495,11 +496,10 @@ die "Ghostscript is required to generate if($opt_D && !$package{'Ghostscript'}); die "Ghostscript is required to generate cross references\n" if($opt_R && !$package{'Ghostscript'}); -$tmpname=$posix?tmpnam():"h2p_$$"; -sysopen TMP, $tmpname, O_RDWR|O_CREAT|O_EXCL, 0600 or die "$!"; -close TMP; +($tmp, $tmpname) = mkstemp("/tmp/h2p_XXXXXXXX") or die "$!"; +close $tmp; ($scr=$tmpname)=~/\w+$/; -$tempdir=$`; +$tempdir=dirname($tmpname); if($opt_u) {$ulanch="t"}; if(defined $opt_x && $opt_x!~/^[0-2]$/) { -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1214060 https://bugzilla.suse.com/show_bug.cgi?id=1214060#c7 --- Comment #7 from OBSbugzilla Bot <bwiedemann+obsbugzillabot@suse.com> --- This is an autogenerated message for OBS integration: This bug (1214060) was mentioned in https://build.opensuse.org/request/show/1224095 Factory / html2ps -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com