From: Bernd Blessmann Date: Thu, 27 Oct 2011 11:38:29 +0000 (+0200) Subject: Umgebungsvariable openin_any=p setzen. X-Git-Tag: release-2.7.0beta1~194^2^2~1 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f353a0b278266d6626c9a1753f4298c6b8f681ba;p=kivitendo-erp.git Umgebungsvariable openin_any=p setzen. Damit können keine Dateien aus höheren Verzeichnissen als in TEXINPUTS eingebunden werden. TEXINPUTS zeigt das Users und das Vorlagen-Verzeichnis. --- diff --git a/SL/Template/LaTeX.pm b/SL/Template/LaTeX.pm index c7d51e0e0..f38d7fb2a 100644 --- a/SL/Template/LaTeX.pm +++ b/SL/Template/LaTeX.pm @@ -387,13 +387,16 @@ sub convert_to_postscript { my $latex = $self->_get_latex_path(); my $old_home = $ENV{HOME}; + my $old_openin_any = $ENV{openin_any}; $ENV{HOME} = $userspath =~ m|^/| ? $userspath : getcwd() . "/" . $userspath; + $ENV{openin_any} = "p"; for (my $run = 1; $run <= 2; $run++) { system("${latex} --interaction=nonstopmode $form->{tmpfile} " . "> $form->{tmpfile}.err"); if ($?) { $ENV{HOME} = $old_home; + $ENV{openin_any} = $old_openin_any; $self->{"error"} = $form->cleanup($latex); return 0; } @@ -403,6 +406,7 @@ sub convert_to_postscript { system("dvips $form->{tmpfile} -o -q > /dev/null"); $ENV{HOME} = $old_home; + $ENV{openin_any} = $old_openin_any; if ($?) { $self->{"error"} = "dvips : $!"; @@ -432,19 +436,23 @@ sub convert_to_pdf { my $latex = $self->_get_latex_path(); my $old_home = $ENV{HOME}; + my $old_openin_any = $ENV{openin_any}; $ENV{HOME} = $userspath =~ m|^/| ? $userspath : getcwd() . "/" . $userspath; + $ENV{openin_any} = "p"; for (my $run = 1; $run <= 2; $run++) { system("${latex} --interaction=nonstopmode $form->{tmpfile} " . "> $form->{tmpfile}.err"); if ($?) { $ENV{HOME} = $old_home; + $ENV{openin_any} = $old_openin_any; $self->{error} = $form->cleanup($latex); return 0; } } $ENV{HOME} = $old_home; + $ENV{openin_any} = $old_openin_any; $form->{tmpfile} =~ s/tex$/pdf/; $self->cleanup();