Gentoo Archives: gentoo-commits

From: Richard Farina <zerochaos@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/ettercap/, net-analyzer/ettercap/files/
Date: Sat, 24 Feb 2018 05:07:02
Message-Id: 1519448762.30594418a8d35519a5a055157ea8be27d8c49e9f.zerochaos@gentoo
1 commit: 30594418a8d35519a5a055157ea8be27d8c49e9f
2 Author: Zero_Chaos <zerochaos <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 24 05:06:02 2018 +0000
4 Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 24 05:06:02 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30594418
7
8 net-analyzer/ettercap: bug #612226
9
10 Package-Manager: Portage-2.3.24, Repoman-2.3.6
11
12 net-analyzer/ettercap/ettercap-0.8.2-r1.ebuild | 62 ++++++++++++++++++++++
13 net-analyzer/ettercap/files/cve-2017-6430.patch | 68 +++++++++++++++++++++++++
14 2 files changed, 130 insertions(+)
15
16 diff --git a/net-analyzer/ettercap/ettercap-0.8.2-r1.ebuild b/net-analyzer/ettercap/ettercap-0.8.2-r1.ebuild
17 new file mode 100644
18 index 00000000000..71fe6afb63c
19 --- /dev/null
20 +++ b/net-analyzer/ettercap/ettercap-0.8.2-r1.ebuild
21 @@ -0,0 +1,62 @@
22 +# Copyright 1999-2018 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=5
26 +
27 +inherit cmake-utils
28 +
29 +DESCRIPTION="A suite for man in the middle attacks"
30 +HOMEPAGE="https://github.com/Ettercap/ettercap"
31 +SRC_URI="https://github.com/Ettercap/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" #mirror does not work
32 +
33 +LICENSE="GPL-2+"
34 +SLOT="0"
35 +KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
36 +IUSE="gtk ipv6 ncurses +plugins"
37 +
38 +RDEPEND="dev-libs/libbsd
39 + dev-libs/libpcre
40 + dev-libs/openssl:0=
41 + net-libs/libnet:1.1
42 + >=net-libs/libpcap-0.8.1
43 + sys-libs/zlib
44 + gtk? (
45 + >=dev-libs/atk-1.2.4
46 + >=dev-libs/glib-2.2.2:2
47 + media-libs/freetype
48 + x11-libs/cairo
49 + x11-libs/gdk-pixbuf:2
50 + >=x11-libs/gtk+-2.2.2:2
51 + >=x11-libs/pango-1.2.3
52 + )
53 + ncurses? ( >=sys-libs/ncurses-5.3:= )
54 + plugins? ( >=net-misc/curl-7.26.0 )"
55 +DEPEND="${RDEPEND}
56 + sys-devel/flex
57 + virtual/yacc"
58 +
59 +src_prepare() {
60 + sed -i "s:Release:Release Gentoo:" CMakeLists.txt || die
61 + epatch "${FILESDIR}"/cve-2017-6430.patch
62 + cmake-utils_src_prepare
63 +}
64 +
65 +src_configure() {
66 + local mycmakeargs=(
67 + $(cmake-utils_use_enable ncurses CURSES)
68 + $(cmake-utils_use_enable gtk)
69 + $(cmake-utils_use_enable plugins)
70 + $(cmake-utils_use_enable ipv6)
71 + -DBUNDLED_LIBS=OFF
72 + -DSYSTEM_LIBS=ON
73 + -DINSTALL_SYSCONFDIR="${EROOT}"etc
74 + )
75 + #right now we only support gtk2, but ettercap also supports gtk3
76 + #do we care? do we want to support both?
77 +
78 + #we want to enable testing but it fails right now
79 + #we want to disable the bundled crap, but we are missing at least "libcheck"
80 + #if we want to enable tests, we need to fix it, and either package libcheck or allow bundled version
81 + #$(cmake-utils_use_enable test TESTS)
82 + cmake-utils_src_configure
83 +}
84
85 diff --git a/net-analyzer/ettercap/files/cve-2017-6430.patch b/net-analyzer/ettercap/files/cve-2017-6430.patch
86 new file mode 100644
87 index 00000000000..67483dcc024
88 --- /dev/null
89 +++ b/net-analyzer/ettercap/files/cve-2017-6430.patch
90 @@ -0,0 +1,68 @@
91 +From 4ad7f85dc01202e363659aa473c99470b3f4e1f4 Mon Sep 17 00:00:00 2001
92 +From: Gianfranco Costamagna <costamagnagianfranco@×××××.it>
93 +Date: Tue, 7 Mar 2017 22:05:31 +0100
94 +Subject: [PATCH] Fix issue #782
95 +
96 +---
97 + utils/etterfilter/ef_compiler.c | 4 +++-
98 + utils/etterfilter/ef_main.c | 10 +++++++---
99 + utils/etterfilter/ef_output.c | 3 +++
100 + 3 files changed, 13 insertions(+), 4 deletions(-)
101 +
102 +diff --git a/utils/etterfilter/ef_compiler.c b/utils/etterfilter/ef_compiler.c
103 +index db876636e..ddb73bd30 100644
104 +--- a/utils/etterfilter/ef_compiler.c
105 ++++ b/utils/etterfilter/ef_compiler.c
106 +@@ -239,7 +239,9 @@ size_t compile_tree(struct filter_op **fop)
107 + struct filter_op *array = NULL;
108 + struct unfold_elm *ue;
109 +
110 +- BUG_IF(tree_root == NULL);
111 ++ // invalid file
112 ++ if (tree_root == NULL)
113 ++ return 0;
114 +
115 + fprintf(stdout, " Unfolding the meta-tree ");
116 + fflush(stdout);
117 +diff --git a/utils/etterfilter/ef_main.c b/utils/etterfilter/ef_main.c
118 +index ae4591344..431084b91 100644
119 +--- a/utils/etterfilter/ef_main.c
120 ++++ b/utils/etterfilter/ef_main.c
121 +@@ -39,7 +39,7 @@ struct globals *gbls;
122 +
123 + int main(int argc, char *argv[])
124 + {
125 +-
126 ++ int ret_value = 0;
127 + globals_alloc();
128 + /* etterfilter copyright */
129 + fprintf(stdout, "\n" EC_COLOR_BOLD "%s %s" EC_COLOR_END " copyright %s %s\n\n",
130 +@@ -84,8 +84,12 @@ int main(int argc, char *argv[])
131 + fprintf(stdout, "\n\nThe script contains errors...\n\n");
132 +
133 + /* write to file */
134 +- if (write_output() != E_SUCCESS)
135 +- FATAL_ERROR("Cannot write output file (%s)", GBL_OPTIONS->output_file);
136 ++ ret_value = write_output();
137 ++ if (ret_value == -E_NOTHANDLED)
138 ++ FATAL_ERROR("Cannot write output file (%s): the filter is not correctly handled.", GBL_OPTIONS->output_file);
139 ++ else if (ret_value == -E_INVALID)
140 ++ FATAL_ERROR("Cannot write output file (%s): the filter format is not correct. ", GBL_OPTIONS->output_file);
141 ++
142 + globals_free();
143 + return 0;
144 + }
145 +diff --git a/utils/etterfilter/ef_output.c b/utils/etterfilter/ef_output.c
146 +index 5ae591904..fcf19f010 100644
147 +--- a/utils/etterfilter/ef_output.c
148 ++++ b/utils/etterfilter/ef_output.c
149 +@@ -51,6 +51,9 @@ int write_output(void)
150 + if (fop == NULL)
151 + return -E_NOTHANDLED;
152 +
153 ++ if (ninst == 0)
154 ++ return -E_INVALID;
155 ++
156 + /* create the file */
157 + fd = open(GBL_OPTIONS->output_file, O_CREAT | O_RDWR | O_TRUNC | O_BINARY, 0644);
158 + ON_ERROR(fd, -1, "Can't create file %s", GBL_OPTIONS->output_file);