Commits

Rainer Müller authored 13d54192f8f
sysutils/tardiff: Add patches for CVE-2015-0857, CVE-2015-0858, and other bugs, closes https://trac.macports.org/ticket/51292

git-svn-id: https://svn.macports.org/repository/macports/trunk/dports@148304 d073be05-634f-4543-b044-5fe20cf6d1d6
No tags

sysutils/tardiff/files/patch-CVE-2015-0857.diff

Added
1 +Upstream: https://anonscm.debian.org/cgit/collab-maint/tardiff.git/tree/debian/patches/CVE-2015-0857.diff
2 +Edit: gnutar instead of tar
3 +
4 +Description: Fix local code execution when calling diff (CVE-2015-0857)
5 + Reported by Rainer Müller <raimue@codingfarm.de>. Implemented using
6 + Text::Diff instead of diff and backticks.
7 +Author: Axel Beckert <abe@debian.org>
8 +Bug-CVE: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0857
9 +
10 +Index: tardiff
11 +===================================================================
12 +--- tardiff 2016-04-28 19:19:02.194646937 +0200
13 ++++ tardiff 2016-04-28 19:36:41.253948109 +0200
14 +@@ -6,6 +6,7 @@
15 + # Published under GNU GPL conditions
16 +
17 + use strict;
18 ++use Text::Diff;
19 +
20 + my $VERSION = '0.1';
21 +
22 +@@ -73,7 +74,12 @@
23 + $flag = "-j";
24 + }
25 +
26 +- my $list = `gnutar -C $tempdir $flag -xvf $tarball 2>/dev/null`;
27 ++ open(TARLIST, '-|', qw(gnutar -C), $tempdir, $flag, qw(-xvf), $tarball)
28 ++ or die "Can't call tar as expected: $!";
29 ++ local $/ = undef; # slurp mode
30 ++ my $list = <TARLIST> or die "Couldn't read from tar";
31 ++ close(TARLIST) or warn "tar exited with non-zero exit code";
32 ++
33 + return $list;
34 + }
35 +
36 +@@ -116,7 +122,7 @@
37 + if(-d $file1 and -d $file2){
38 + return 0;
39 + }elsif(-f $file1 and -f $file2){
40 +- my $diff = `diff $file1 $file2`;
41 ++ my $diff = diff $file1, $file2, { STYLE => "OldStyle" };
42 + if($diff){
43 + if($opt_stats){
44 + my $plus = 0;

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut