texlive[47925] Master/texmf-dist/scripts/texlive/fmtutil.pl: fmtutil:

commits+preining at tug.org commits+preining at tug.org
Tue Jun 5 01:45:50 CEST 2018


Revision: 47925
          http://tug.org/svn/texlive?view=revision&revision=47925
Author:   preining
Date:     2018-06-05 01:45:50 +0200 (Tue, 05 Jun 2018)
Log Message:
-----------
fmtutil: use copy instead of move for selinux

Modified Paths:
--------------
    trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl

Modified: trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl	2018-06-04 20:52:57 UTC (rev 47924)
+++ trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl	2018-06-04 23:45:50 UTC (rev 47925)
@@ -719,8 +719,12 @@
 
   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
@@ -727,13 +731,13 @@
     # 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 @@
     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");
     }



More information about the tex-live-commits mailing list