1 |
commit: d542c2249df5d4c2a05ec486b4365591220f7b2d |
2 |
Author: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Aug 26 19:27:44 2019 +0000 |
4 |
Commit: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Aug 26 19:28:02 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d542c224 |
7 |
|
8 |
net-misc/rdesktop: backport fix for some failing connections |
9 |
|
10 |
1.8.6 fails with some servers (like W2003) |
11 |
|
12 |
Closes: https://bugs.gentoo.org/692042 |
13 |
Package-Manager: Portage-2.3.73, Repoman-2.3.17 |
14 |
Signed-off-by: Bernard Cafarelli <voyageur <AT> gentoo.org> |
15 |
|
16 |
.../files/rdesktop-1.8.6-sec_decrypt.patch | 59 ++++++++++++++++++ |
17 |
net-misc/rdesktop/rdesktop-1.8.6-r1.ebuild | 72 ++++++++++++++++++++++ |
18 |
2 files changed, 131 insertions(+) |
19 |
|
20 |
diff --git a/net-misc/rdesktop/files/rdesktop-1.8.6-sec_decrypt.patch b/net-misc/rdesktop/files/rdesktop-1.8.6-sec_decrypt.patch |
21 |
new file mode 100644 |
22 |
index 00000000000..dbb0d0e9baf |
23 |
--- /dev/null |
24 |
+++ b/net-misc/rdesktop/files/rdesktop-1.8.6-sec_decrypt.patch |
25 |
@@ -0,0 +1,59 @@ |
26 |
+From 7841030279c5300d5073b2348b58f3f41e136f82 Mon Sep 17 00:00:00 2001 |
27 |
+From: Markus Beth <markus.beth@×××.de> |
28 |
+Date: Tue, 11 Jun 2019 22:57:31 +0200 |
29 |
+Subject: [PATCH] sec_decrypt() the correct amount of data |
30 |
+ |
31 |
+Save the correct amount of data to sec_decrypt() because after |
32 |
+inout_uint8p() the macro s_remaining(s) will find nothing left. |
33 |
+--- |
34 |
+ secure.c | 16 ++++++++++------ |
35 |
+ 1 file changed, 10 insertions(+), 6 deletions(-) |
36 |
+ |
37 |
+diff --git a/secure.c b/secure.c |
38 |
+index 8f65b3aa..9b301e1f 100644 |
39 |
+--- a/secure.c |
40 |
++++ b/secure.c |
41 |
+@@ -813,6 +813,7 @@ sec_recv(uint8 * rdpver) |
42 |
+ STREAM s; |
43 |
+ struct stream packet; |
44 |
+ size_t data_offset; |
45 |
++ size_t remaining; |
46 |
+ unsigned char *data; |
47 |
+ |
48 |
+ while ((s = mcs_recv(&channel, rdpver)) != NULL) |
49 |
+@@ -832,8 +833,9 @@ sec_recv(uint8 * rdpver) |
50 |
+ |
51 |
+ data_offset = s_tell(s); |
52 |
+ |
53 |
+- inout_uint8p(s, data, s_remaining(s)); |
54 |
+- sec_decrypt(data, s_remaining(s)); |
55 |
++ remaining = s_remaining(s); |
56 |
++ inout_uint8p(s, data, remaining); |
57 |
++ sec_decrypt(data, remaining); |
58 |
+ |
59 |
+ s_seek(s, data_offset); |
60 |
+ } |
61 |
+@@ -860,8 +862,9 @@ sec_recv(uint8 * rdpver) |
62 |
+ |
63 |
+ data_offset = s_tell(s); |
64 |
+ |
65 |
+- inout_uint8p(s, data, s_remaining(s)); |
66 |
+- sec_decrypt(data, s_remaining(s)); |
67 |
++ remaining = s_remaining(s); |
68 |
++ inout_uint8p(s, data, remaining); |
69 |
++ sec_decrypt(data, remaining); |
70 |
+ } |
71 |
+ |
72 |
+ if (sec_flags & SEC_LICENCE_NEG) |
73 |
+@@ -883,8 +886,9 @@ sec_recv(uint8 * rdpver) |
74 |
+ |
75 |
+ data_offset = s_tell(s); |
76 |
+ |
77 |
+- inout_uint8p(s, data, s_remaining(s)); |
78 |
+- sec_decrypt(data, s_remaining(s)); |
79 |
++ remaining = s_remaining(s); |
80 |
++ inout_uint8p(s, data, remaining); |
81 |
++ sec_decrypt(data, remaining); |
82 |
+ |
83 |
+ /* Check for a redirect packet, starts with 00 04 */ |
84 |
+ if (data[0] == 0 && data[1] == 4) |
85 |
|
86 |
diff --git a/net-misc/rdesktop/rdesktop-1.8.6-r1.ebuild b/net-misc/rdesktop/rdesktop-1.8.6-r1.ebuild |
87 |
new file mode 100644 |
88 |
index 00000000000..023a23ca970 |
89 |
--- /dev/null |
90 |
+++ b/net-misc/rdesktop/rdesktop-1.8.6-r1.ebuild |
91 |
@@ -0,0 +1,72 @@ |
92 |
+# Copyright 1999-2019 Gentoo Authors |
93 |
+# Distributed under the terms of the GNU General Public License v2 |
94 |
+ |
95 |
+EAPI=7 |
96 |
+inherit autotools eutils |
97 |
+ |
98 |
+MY_PV=${PV/_/-} |
99 |
+ |
100 |
+DESCRIPTION="A Remote Desktop Protocol Client" |
101 |
+HOMEPAGE="http://www.rdesktop.org/" |
102 |
+SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.gz" |
103 |
+ |
104 |
+LICENSE="GPL-3" |
105 |
+SLOT="0" |
106 |
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris" |
107 |
+IUSE="alsa ao debug ipv6 kerberos libressl libsamplerate oss pcsc-lite xrandr" |
108 |
+ |
109 |
+S=${WORKDIR}/${PN}-${MY_PV} |
110 |
+ |
111 |
+RDEPEND=" |
112 |
+ !libressl? ( dev-libs/openssl:0= ) |
113 |
+ libressl? ( dev-libs/libressl:= ) |
114 |
+ x11-libs/libX11 |
115 |
+ x11-libs/libXext |
116 |
+ x11-libs/libXau |
117 |
+ x11-libs/libXdmcp |
118 |
+ alsa? ( media-libs/alsa-lib ) |
119 |
+ ao? ( >=media-libs/libao-0.8.6 ) |
120 |
+ kerberos? ( virtual/krb5 ) |
121 |
+ libsamplerate? ( media-libs/libsamplerate ) |
122 |
+ pcsc-lite? ( >=sys-apps/pcsc-lite-1.6.6 ) |
123 |
+ xrandr? ( x11-libs/libXrandr )" |
124 |
+DEPEND="${RDEPEND} |
125 |
+ x11-libs/libXt" |
126 |
+BDEPEND=virtual/pkgconfig |
127 |
+ |
128 |
+PATCHES=( |
129 |
+ "${FILESDIR}"/${PN}-1.6.0-sound_configure.patch |
130 |
+ "${FILESDIR}"/${PN}-1.8.3-no_strip.patch |
131 |
+ "${FILESDIR}"/${PN}-1.8.3-xrandr_configure.patch |
132 |
+ "${FILESDIR}"/${PN}-1.8.4-libressl.patch |
133 |
+ "${FILESDIR}"/${PN}-1.8.5-use_standard_gssapi.patch |
134 |
+ "${FILESDIR}"/${P}-sec_decrypt.patch |
135 |
+) |
136 |
+ |
137 |
+DOCS=( doc/HACKING doc/TODO doc/keymapping.txt ) |
138 |
+ |
139 |
+src_prepare() { |
140 |
+ default |
141 |
+ eautoreconf |
142 |
+} |
143 |
+ |
144 |
+src_configure() { |
145 |
+ if use ao; then |
146 |
+ sound_conf=$(use_with ao sound libao) |
147 |
+ else if use alsa; then |
148 |
+ sound_conf=$(use_with alsa sound alsa) |
149 |
+ else |
150 |
+ sound_conf=$(use_with oss sound oss) |
151 |
+ fi |
152 |
+ fi |
153 |
+ |
154 |
+ econf \ |
155 |
+ --with-openssl="${EPREFIX}"/usr \ |
156 |
+ $(use_with debug) \ |
157 |
+ $(use_with ipv6) \ |
158 |
+ $(use_with libsamplerate) \ |
159 |
+ $(use_with xrandr) \ |
160 |
+ $(use_enable kerberos credssp) \ |
161 |
+ $(use_enable pcsc-lite smartcard) \ |
162 |
+ ${sound_conf} |
163 |
+} |