diff options
Diffstat (limited to '0006-latex2man-use-predictable-tmp.patch')
-rw-r--r-- | 0006-latex2man-use-predictable-tmp.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/0006-latex2man-use-predictable-tmp.patch b/0006-latex2man-use-predictable-tmp.patch new file mode 100644 index 0000000..581b0be --- /dev/null +++ b/0006-latex2man-use-predictable-tmp.patch @@ -0,0 +1,46 @@ +From 5dd262d2db90dc44097131fb8f160772aed407ad Mon Sep 17 00:00:00 2001 +From: Mikle Kolyada <zlogene@gentoo.org> +Date: Sun, 2 Jun 2019 14:50:27 +0300 +Subject: [PATCH 6/6] latex2man: use predictable tmp + +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=668779 +https://bugs.gentoo.org/show_bug.cgi?id=432144 +CVE-2012-2120 (http://nvd.nist.gov/nvd.cfm?cvename=CVE-2012-2120) +--- + texk/texlive/linked_scripts/latex2man/latex2man | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/texk/texlive/linked_scripts/latex2man/latex2man b/texk/texlive/linked_scripts/latex2man/latex2man +index e117d337..285c19fd 100755 +--- a/texk/texlive/linked_scripts/latex2man/latex2man ++++ b/texk/texlive/linked_scripts/latex2man/latex2man +@@ -31,8 +31,6 @@ sub date2str; + $VERSION = "1.29"; + $DATE = date2str ('$Date: 2018/11/25 13:05:37 $' =~ m|(\d+/\d+/\d+)|); + +-$tmp = "/tmp/$CMD.$$"; +- + ################################################################## + # check option and arguments + ################################################################## +@@ -153,7 +151,7 @@ $first_word = 1; # true, if the next word to be processed is the first + $list_nest = 0; # counts nesting of itemize/enumerate/description envrionments + $cur_list[0] = "";# array, indexed with list_nest, indicates kind of list: + # values are: 'enum' / 'descr' / 'item' +-$item_nr[0] = 0; # array, indexed with list_nest, counts the number of \item in the ++$item_nr[0] = 0; # array, indexed with list_nest, counts the number of W\item in the + # list + $manRS = 0; # true, if for Man a .RS was given after a \item + +@@ -2018,6 +2016,8 @@ if ($opt_t) { + open (my $SRC, "<$SrcFile") || die "$CMD: Can't open file \`$SrcFile' for reading.\n"; + if ($opt_H || $opt_T) { + # DestFile will be written in the postprocess ++ $tmp = `mktemp` || die; ++ chomp $tmp; + open (DEST, ">$tmp") || die "$CMD: Can't open file \`$tmp' for writing.\n"; + } else { + open (DEST, ">$DestFile") || die "$CMD: Can't open file \`$DestFile' for writing.\n"; +-- +2.21.0 + |