Gentoo Archives: gentoo-commits

From: Matthias Maier <tamiko@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/spice/files/, app-emulation/spice/
Date: Fri, 17 Aug 2018 00:08:05
Message-Id: 1534464468.dfd415b17224737493b36a801d929b382061d82d.tamiko@gentoo
1 commit: dfd415b17224737493b36a801d929b382061d82d
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 16 21:59:36 2018 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 17 00:07:48 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dfd415b1
7
8 app-emulation/spice: patch integer overflow, bug #663330
9
10 Bug: https://bugs.gentoo.org/663330
11 Package-Manager: Portage-2.3.46, Repoman-2.3.10
12
13 ...0.14.0-fix-flexible-array-buffer-overflow.patch | 12 +++
14 app-emulation/spice/spice-0.14.0-r2.ebuild | 102 +++++++++++++++++++++
15 2 files changed, 114 insertions(+)
16
17 diff --git a/app-emulation/spice/files/spice-0.14.0-fix-flexible-array-buffer-overflow.patch b/app-emulation/spice/files/spice-0.14.0-fix-flexible-array-buffer-overflow.patch
18 new file mode 100644
19 index 00000000000..a05bbb7545a
20 --- /dev/null
21 +++ b/app-emulation/spice/files/spice-0.14.0-fix-flexible-array-buffer-overflow.patch
22 @@ -0,0 +1,12 @@
23 +diff --git a/spice-common/python_modules/demarshal.py b/spice-common/python_modules/demarshal.py
24 +index 1ea131d..7172762 100644
25 +--- a/spice-common/python_modules/demarshal.py
26 ++++ b/spice-common/python_modules/demarshal.py
27 +@@ -318,6 +318,7 @@ def write_validate_array_item(writer, container, item, scope, parent_scope, star
28 + writer.assign(nelements, array.size)
29 + elif array.is_remaining_length():
30 + if element_type.is_fixed_nw_size():
31 ++ writer.error_check("%s > message_end" % item.get_position())
32 + if element_type.get_fixed_nw_size() == 1:
33 + writer.assign(nelements, "message_end - %s" % item.get_position())
34 + else:
35
36 diff --git a/app-emulation/spice/spice-0.14.0-r2.ebuild b/app-emulation/spice/spice-0.14.0-r2.ebuild
37 new file mode 100644
38 index 00000000000..823669338c7
39 --- /dev/null
40 +++ b/app-emulation/spice/spice-0.14.0-r2.ebuild
41 @@ -0,0 +1,102 @@
42 +# Copyright 1999-2018 Gentoo Foundation
43 +# Distributed under the terms of the GNU General Public License v2
44 +
45 +EAPI=6
46 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
47 +
48 +inherit autotools ltprune python-any-r1 readme.gentoo-r1 xdg-utils
49 +
50 +DESCRIPTION="SPICE server"
51 +HOMEPAGE="https://www.spice-space.org/"
52 +SRC_URI="https://www.spice-space.org/download/releases/${P}.tar.bz2"
53 +
54 +LICENSE="LGPL-2.1"
55 +SLOT="0"
56 +KEYWORDS="~amd64 ~arm64 ~x86"
57 +IUSE="libressl lz4 sasl smartcard static-libs gstreamer"
58 +
59 +# the libspice-server only uses the headers of libcacard
60 +RDEPEND="
61 + dev-lang/orc[static-libs(+)?]
62 + >=dev-libs/glib-2.22:2[static-libs(+)?]
63 + media-libs/opus[static-libs(+)?]
64 + sys-libs/zlib[static-libs(+)?]
65 + virtual/jpeg:0=[static-libs(+)?]
66 + >=x11-libs/pixman-0.17.7[static-libs(+)?]
67 + !libressl? ( dev-libs/openssl:0=[static-libs(+)?] )
68 + libressl? ( dev-libs/libressl:0=[static-libs(+)?] )
69 + lz4? ( app-arch/lz4:0=[static-libs(+)?] )
70 + smartcard? ( >=app-emulation/libcacard-0.1.2 )
71 + sasl? ( dev-libs/cyrus-sasl[static-libs(+)?] )
72 + gstreamer? (
73 + media-libs/gstreamer:1.0
74 + media-libs/gst-plugins-base:1.0
75 + )"
76 +DEPEND="${RDEPEND}
77 + ${PYTHON_DEPS}
78 + >=app-emulation/spice-protocol-0.12.13
79 + virtual/pkgconfig
80 + $(python_gen_any_dep '
81 + >=dev-python/pyparsing-1.5.6-r2[${PYTHON_USEDEP}]
82 + dev-python/six[${PYTHON_USEDEP}]
83 + ')
84 + smartcard? ( app-emulation/qemu[smartcard] )"
85 +
86 +PATCHES=(
87 + "${FILESDIR}"/${P}-libressl_fix.patch
88 + "${FILESDIR}"/${P}-openssl1.1_fix.patch
89 + "${FILESDIR}"/${P}-fix-flexible-array-buffer-overflow.patch
90 +)
91 +
92 +python_check_deps() {
93 + has_version ">=dev-python/pyparsing-1.5.6-r2[${PYTHON_USEDEP}]"
94 + has_version "dev-python/six[${PYTHON_USEDEP}]"
95 +}
96 +
97 +pkg_setup() {
98 + [[ ${MERGE_TYPE} != binary ]] && python-any-r1_pkg_setup
99 +}
100 +
101 +src_prepare() {
102 + default
103 +
104 + eautoreconf
105 +}
106 +
107 +src_configure() {
108 + # Prevent sandbox violations, bug #586560
109 + # https://bugzilla.gnome.org/show_bug.cgi?id=744134
110 + # https://bugzilla.gnome.org/show_bug.cgi?id=744135
111 + addpredict /dev
112 +
113 + xdg_environment_reset
114 +
115 + local myconf="
116 + $(use_enable static-libs static)
117 + $(use_enable lz4)
118 + $(use_with sasl)
119 + $(use_enable smartcard)
120 + --enable-gstreamer=$(usex gstreamer "1.0" "no")
121 + --disable-celt051
122 + "
123 + econf ${myconf}
124 +}
125 +
126 +src_compile() {
127 + # Prevent sandbox violations, bug #586560
128 + # https://bugzilla.gnome.org/show_bug.cgi?id=744134
129 + # https://bugzilla.gnome.org/show_bug.cgi?id=744135
130 + addpredict /dev
131 +
132 + default
133 +}
134 +
135 +src_install() {
136 + default
137 + use static-libs || prune_libtool_files
138 + readme.gentoo_create_doc
139 +}
140 +
141 +pkg_postinst() {
142 + readme.gentoo_print_elog
143 +}