diff options
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/fmtutil.pl | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl index 606eb34f854..0b82a60046c 100755 --- a/Master/texmf-dist/scripts/texlive/fmtutil.pl +++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl @@ -719,21 +719,25 @@ sub rebuild_one_format { TeXLive::TLUtils::mkdirhier($destdir); - if (!File::Copy::move( $logfile, "$destdir/$logfile")) { - print_deferred_error("Cannot move $logfile to $destdir.\n"); + # here and in the following we use copy instead of move + # to make sure that in SElinux enabled cases the rules of + # the destination directory are applied.] + # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900580 + if (!File::Copy::copy( $logfile, "$destdir/$logfile")) { + print_deferred_error("Cannot copy $logfile to $destdir.\n"); } if ($opts{'recorder'}) { # the recorder output is used by check-fmttriggers to determine # package dependencies for each format. Unfortunately omega-based # engines gratuitiously changed the extension from .fls to .ofl. my $recfile = $fmt . ($fmt =~ m/^(aleph|lamed)$/ ? ".ofl" : ".fls"); - if (!File::Copy::move( $recfile, "$destdir/$recfile")) { - print_deferred_error("Cannot move $recfile to $destdir.\n"); + if (!File::Copy::copy( $recfile, "$destdir/$recfile")) { + print_deferred_error("Cannot copy $recfile to $destdir.\n"); } } my $destfile = "$destdir/$fmtfile"; - if (File::Copy::move( $fmtfile, $destfile )) { + if (File::Copy::copy( $fmtfile, $destfile )) { print_info("$destfile installed.\n"); # # original fmtutil.sh did some magic trick for mplib-luatex.mem @@ -780,10 +784,10 @@ sub rebuild_one_format { return $FMT_SUCCESS; } else { - print_deferred_error("Cannot move $fmtfile to $destfile.\n"); + print_deferred_error("Cannot copy $fmtfile to $destfile.\n"); if (-f $destfile) { # remove the empty file possibly left over if near-full file system. - print_verbose("Removing partial file after move failure: $destfile\n"); + print_verbose("Removing partial file after copy failure: $destfile\n"); unlink($destfile) || print_deferred_error("unlink($destfile) failed: $!\n"); } |