Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-misc/x11vnc/, x11-misc/x11vnc/files/
Date: Sun, 27 Nov 2016 21:17:24
Message-Id: 1480281416.31d39424920068b244f74223e501fc462a40ca3a.vapier@gentoo
1 commit: 31d39424920068b244f74223e501fc462a40ca3a
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 27 21:15:02 2016 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 27 21:16:56 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31d39424
7
8 x11-misc/x11vnc: add upstream fixes for -unixpw handling #567612
9
10 .../x11vnc-0.9.14-libvncserver-defines-1.patch | 50 ++++
11 .../x11vnc-0.9.14-libvncserver-defines-2.patch | 264 +++++++++++++++++++++
12 x11-misc/x11vnc/x11vnc-0.9.14-r1.ebuild | 65 +++++
13 3 files changed, 379 insertions(+)
14
15 diff --git a/x11-misc/x11vnc/files/x11vnc-0.9.14-libvncserver-defines-1.patch b/x11-misc/x11vnc/files/x11vnc-0.9.14-libvncserver-defines-1.patch
16 new file mode 100644
17 index 00000000..9129e3c
18 --- /dev/null
19 +++ b/x11-misc/x11vnc/files/x11vnc-0.9.14-libvncserver-defines-1.patch
20 @@ -0,0 +1,50 @@
21 +https://bugs.gentoo.org/567612
22 +
23 +From a6852d61dce708bf5185a7e42770475a070433bc Mon Sep 17 00:00:00 2001
24 +From: Christian Beier <dontmind@×××××××××.org>
25 +Date: Fri, 27 Nov 2015 15:57:51 +0100
26 +Subject: [PATCH] Fix the remaining HAVE_WAITPID occurences.
27 +
28 +---
29 + src/sslhelper.c | 4 ++--
30 + src/unixpw.c | 2 +-
31 + 2 files changed, 3 insertions(+), 3 deletions(-)
32 +
33 +diff --git a/src/sslhelper.c b/src/sslhelper.c
34 +index bae897fd22d1..8045d7706ba5 100644
35 +--- a/src/sslhelper.c
36 ++++ b/src/sslhelper.c
37 +@@ -2964,7 +2964,7 @@ void ssl_helper_pid(pid_t pid, int sock) {
38 + }
39 + }
40 +
41 +-#if LIBVNCSERVER_HAVE_SYS_WAIT_H && LIBVNCSERVER_HAVE_WAITPID
42 ++#if LIBVNCSERVER_HAVE_SYS_WAIT_H && HAVE_WAITPID
43 + wret = waitpid(helpers[i], &status, WNOHANG);
44 +
45 + if (db) fprintf(stderr, "waitpid(%d)\n", helpers[i]);
46 +@@ -3000,7 +3000,7 @@ if (db) fprintf(stderr, "ssl_helper_pid(%d, %d)\n", pid, sock);
47 + for (i=0; i < HPSIZE; i++) {
48 + if (helpers[i] == pid) {
49 + if (sock == -1) {
50 +-#if LIBVNCSERVER_HAVE_SYS_WAIT_H && LIBVNCSERVER_HAVE_WAITPID
51 ++#if LIBVNCSERVER_HAVE_SYS_WAIT_H && HAVE_WAITPID
52 + pid_t wret;
53 + wret = waitpid(helpers[i], &status, WNOHANG);
54 +
55 +diff --git a/src/unixpw.c b/src/unixpw.c
56 +index 4267b5ccf659..3a548808881f 100644
57 +--- a/src/unixpw.c
58 ++++ b/src/unixpw.c
59 +@@ -56,7 +56,7 @@ extern char *crypt(const char*, const char *);
60 + #include "default8x16.h"
61 +
62 + #if LIBVNCSERVER_HAVE_FORK
63 +-#if LIBVNCSERVER_HAVE_SYS_WAIT_H && LIBVNCSERVER_HAVE_WAITPID
64 ++#if LIBVNCSERVER_HAVE_SYS_WAIT_H && HAVE_WAITPID
65 + #define UNIXPW_SU
66 + #endif
67 + #endif
68 +--
69 +2.11.0.rc2
70 +
71
72 diff --git a/x11-misc/x11vnc/files/x11vnc-0.9.14-libvncserver-defines-2.patch b/x11-misc/x11vnc/files/x11vnc-0.9.14-libvncserver-defines-2.patch
73 new file mode 100644
74 index 00000000..d010837
75 --- /dev/null
76 +++ b/x11-misc/x11vnc/files/x11vnc-0.9.14-libvncserver-defines-2.patch
77 @@ -0,0 +1,264 @@
78 +https://bugs.gentoo.org/567612
79 +
80 +From e70123d8f778e3f0c3bf1606f68a70b0d9748c6a Mon Sep 17 00:00:00 2001
81 +From: Christian Beier <dontmind@×××××××××.org>
82 +Date: Tue, 1 Dec 2015 14:14:00 +0100
83 +Subject: [PATCH] Fix the remaining x11vnc-specific defines that are not in
84 + LibVNCServer anymore.
85 +
86 +---
87 + src/macosx.c | 4 ++--
88 + src/macosx_opengl.c | 2 +-
89 + src/screen.c | 2 +-
90 + src/uinput.c | 4 ++--
91 + src/unixpw.c | 30 +++++++++++++++---------------
92 + src/user.c | 6 +++---
93 + src/v4l.c | 2 +-
94 + src/x11vnc.h | 8 ++++----
95 + 8 files changed, 29 insertions(+), 29 deletions(-)
96 +
97 +diff --git a/src/macosx.c b/src/macosx.c
98 +index 6645018968c3..df622db0232d 100644
99 +--- a/src/macosx.c
100 ++++ b/src/macosx.c
101 +@@ -33,7 +33,7 @@ so, delete this exception statement from your version.
102 + /* -- macosx.c -- */
103 +
104 + #include "config.h"
105 +-#if (defined(__MACH__) && defined(__APPLE__) && defined(LIBVNCSERVER_HAVE_MACOSX_NATIVE_DISPLAY))
106 ++#if (defined(__MACH__) && defined(__APPLE__) && defined(HAVE_MACOSX_NATIVE_DISPLAY))
107 +
108 + #define DOMAC 1
109 +
110 +@@ -748,5 +748,5 @@ int macosx_check_clipped(int win, int *list, int n) {
111 + }
112 +
113 +
114 +-#endif /* LIBVNCSERVER_HAVE_MACOSX_NATIVE_DISPLAY */
115 ++#endif /* HAVE_MACOSX_NATIVE_DISPLAY */
116 +
117 +diff --git a/src/macosx_opengl.c b/src/macosx_opengl.c
118 +index 97882797452e..4efc7be94c2e 100644
119 +--- a/src/macosx_opengl.c
120 ++++ b/src/macosx_opengl.c
121 +@@ -38,7 +38,7 @@ so, delete this exception statement from your version.
122 + #include <ApplicationServices/ApplicationServices.h>
123 +
124 + #include <rfb/rfb.h>
125 +-#if LIBVNCSERVER_HAVE_MACOSX_OPENGL_H
126 ++#if HAVE_MACOSX_OPENGL_H
127 + #include <OpenGL/OpenGL.h>
128 + #include <OpenGL/gl.h>
129 + #endif
130 +diff --git a/src/screen.c b/src/screen.c
131 +index 5d37761c9038..bda46903b59a 100644
132 +--- a/src/screen.c
133 ++++ b/src/screen.c
134 +@@ -2119,7 +2119,7 @@ if (db) fprintf(stderr, "initialize_raw_fb reset\n");
135 +
136 + if (sscanf(str, "shm:%d", &shmid) == 1) {
137 + /* shm:N */
138 +-#if HAVE_XSHM || LIBVNCSERVER_HAVE_SHMAT
139 ++#if HAVE_XSHM || HAVE_SHMAT
140 + raw_fb_addr = (char *) shmat(shmid, 0, SHM_RDONLY);
141 + if (! raw_fb_addr) {
142 + rfbLogEnable(1);
143 +diff --git a/src/uinput.c b/src/uinput.c
144 +index ac0324f1b0f0..d9e2b2656a5f 100644
145 +--- a/src/uinput.c
146 ++++ b/src/uinput.c
147 +@@ -42,8 +42,8 @@ so, delete this exception statement from your version.
148 + #include "allowed_input_t.h"
149 +
150 + #if LIBVNCSERVER_HAVE_SYS_IOCTL_H
151 +-#if LIBVNCSERVER_HAVE_LINUX_INPUT_H
152 +-#if LIBVNCSERVER_HAVE_LINUX_UINPUT_H
153 ++#if HAVE_LINUX_INPUT_H
154 ++#if HAVE_LINUX_UINPUT_H
155 + #define UINPUT_OK
156 + #endif
157 + #endif
158 +diff --git a/src/unixpw.c b/src/unixpw.c
159 +index 3a548808881f..66b776f1e8a4 100644
160 +--- a/src/unixpw.c
161 ++++ b/src/unixpw.c
162 +@@ -62,14 +62,14 @@ extern char *crypt(const char*, const char *);
163 + #endif
164 +
165 + #ifdef IGNORE_GETSPNAM
166 +-#undef LIBVNCSERVER_HAVE_GETSPNAM
167 +-#define LIBVNCSERVER_HAVE_GETSPNAM 0
168 ++#undef HAVE_GETSPNAM
169 ++#define HAVE_GETSPNAM 0
170 + #endif
171 +
172 +-#if LIBVNCSERVER_HAVE_PWD_H && LIBVNCSERVER_HAVE_GETPWNAM
173 ++#if LIBVNCSERVER_HAVE_PWD_H && HAVE_GETPWNAM
174 + #if LIBVNCSERVER_HAVE_CRYPT || LIBVNCSERVER_HAVE_LIBCRYPT || HAVE_LIBCRYPT
175 + #define UNIXPW_CRYPT
176 +-#if LIBVNCSERVER_HAVE_GETSPNAM
177 ++#if HAVE_GETSPNAM
178 + #include <shadow.h>
179 + #endif
180 + #endif
181 +@@ -78,10 +78,10 @@ extern char *crypt(const char*, const char *);
182 + #if LIBVNCSERVER_HAVE_SYS_IOCTL_H
183 + #include <sys/ioctl.h>
184 + #endif
185 +-#if LIBVNCSERVER_HAVE_TERMIOS_H
186 ++#if HAVE_TERMIOS_H
187 + #include <termios.h>
188 + #endif
189 +-#if LIBVNCSERVER_HAVE_SYS_STROPTS_H
190 ++#if HAVE_SYS_STROPTS_H
191 + #include <sys/stropts.h>
192 + #endif
193 +
194 +@@ -520,7 +520,7 @@ char *get_pty_ptmx(int *fd_p) {
195 +
196 + *fd_p = -1;
197 +
198 +-#if LIBVNCSERVER_HAVE_GRANTPT
199 ++#if HAVE_GRANTPT
200 +
201 + for (i=0; i < ndevs; i++) {
202 + #ifdef O_NOCTTY
203 +@@ -628,7 +628,7 @@ char *get_pty(int *fd_p) {
204 + #ifdef IS_BSD
205 + return get_pty_loop(fd_p);
206 + #else
207 +-#if LIBVNCSERVER_HAVE_GRANTPT
208 ++#if HAVE_GRANTPT
209 + used_get_pty_ptmx = 1;
210 + return get_pty_ptmx(fd_p);
211 + #else
212 +@@ -644,16 +644,16 @@ void try_to_be_nobody(void) {
213 + pw = getpwnam("nobody");
214 +
215 + if (pw) {
216 +-#if LIBVNCSERVER_HAVE_SETUID
217 ++#if HAVE_SETUID
218 + setuid(pw->pw_uid);
219 + #endif
220 +-#if LIBVNCSERVER_HAVE_SETEUID
221 ++#if HAVE_SETEUID
222 + seteuid(pw->pw_uid);
223 + #endif
224 +-#if LIBVNCSERVER_HAVE_SETGID
225 ++#if HAVE_SETGID
226 + setgid(pw->pw_gid);
227 + #endif
228 +-#if LIBVNCSERVER_HAVE_SETEGID
229 ++#if HAVE_SETEGID
230 + setegid(pw->pw_gid);
231 + #endif
232 + }
233 +@@ -788,7 +788,7 @@ int crypt_verify(char *user, char *pass) {
234 +
235 + if (strlen(realpw) < 12) {
236 + /* e.g. "x", try getspnam(), sometimes root for inetd, etc */
237 +-#if LIBVNCSERVER_HAVE_GETSPNAM
238 ++#if HAVE_GETSPNAM
239 + struct spwd *sp = getspnam(user);
240 + if (sp != NULL && sp->sp_pwdp != NULL) {
241 + if (db) fprintf(stderr, "using getspnam()\n");
242 +@@ -1086,7 +1086,7 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int
243 +
244 + /* streams options fixups, handle cases as they are found: */
245 + #if defined(__hpux)
246 +-#if LIBVNCSERVER_HAVE_SYS_STROPTS_H
247 ++#if HAVE_SYS_STROPTS_H
248 + #if LIBVNCSERVER_HAVE_SYS_IOCTL_H && defined(I_PUSH)
249 + if (used_get_pty_ptmx) {
250 + ioctl(sfd, I_PUSH, "ptem");
251 +@@ -1127,7 +1127,7 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int
252 + chdir("/");
253 +
254 + try_to_be_nobody();
255 +-#if LIBVNCSERVER_HAVE_GETUID
256 ++#if HAVE_GETUID
257 + if (getuid() == 0 || geteuid() == 0) {
258 + exit(1);
259 + }
260 +diff --git a/src/user.c b/src/user.c
261 +index b759a61ae50a..aa14814de2b7 100644
262 +--- a/src/user.c
263 ++++ b/src/user.c
264 +@@ -140,7 +140,7 @@ void check_switched_user(void) {
265 + /* utilities for switching users */
266 + static char *get_login_list(int with_display) {
267 + char *out;
268 +-#if LIBVNCSERVER_HAVE_UTMPX_H
269 ++#if HAVE_UTMPX_H
270 + int i, cnt, max = 200, ut_namesize = 32;
271 + int dpymax = 1000, sawdpy[1000];
272 + struct utmpx *utx;
273 +@@ -761,7 +761,7 @@ static int switch_user_env(uid_t uid, gid_t gid, char *name, char *home, int fb_
274 + int reset_fb = 0;
275 + int grp_ok = 0;
276 +
277 +-#if !LIBVNCSERVER_HAVE_SETUID
278 ++#if !HAVE_SETUID
279 + return 0;
280 + #else
281 + /*
282 +@@ -773,7 +773,7 @@ static int switch_user_env(uid_t uid, gid_t gid, char *name, char *home, int fb_
283 + clean_shm(0);
284 + free_tiles();
285 + }
286 +-#if LIBVNCSERVER_HAVE_INITGROUPS
287 ++#if HAVE_INITGROUPS
288 + #if LIBVNCSERVER_HAVE_PWD_H
289 + if (getpwuid(uid) != NULL && getenv("X11VNC_SINGLE_GROUP") == NULL) {
290 + struct passwd *p = getpwuid(uid);
291 +diff --git a/src/v4l.c b/src/v4l.c
292 +index 86c33a6b9e75..8a3581362599 100644
293 +--- a/src/v4l.c
294 ++++ b/src/v4l.c
295 +@@ -41,7 +41,7 @@ so, delete this exception statement from your version.
296 + #include "keyboard.h"
297 + #include "allowed_input_t.h"
298 +
299 +-#if LIBVNCSERVER_HAVE_LINUX_VIDEODEV_H
300 ++#if HAVE_LINUX_VIDEODEV_H
301 + #if LIBVNCSERVER_HAVE_SYS_IOCTL_H
302 + #include <sys/ioctl.h>
303 + #define CONFIG_VIDEO_V4L1_COMPAT
304 +diff --git a/src/x11vnc.h b/src/x11vnc.h
305 +index 7a84703eabc8..79319a420eec 100644
306 +--- a/src/x11vnc.h
307 ++++ b/src/x11vnc.h
308 +@@ -255,10 +255,10 @@ so, delete this exception statement from your version.
309 + #endif
310 +
311 + #if (SMALL_FOOTPRINT > 2)
312 +-#undef LIBVNCSERVER_HAVE_UTMPX_H
313 ++#undef HAVE_UTMPX_H
314 + #undef LIBVNCSERVER_HAVE_PWD_H
315 + #undef REMOTE_CONTROL
316 +-#define LIBVNCSERVER_HAVE_UTMPX_H 0
317 ++#define HAVE_UTMPX_H 0
318 + #define LIBVNCSERVER_HAVE_PWD_H 0
319 + #define REMOTE_CONTROL 0
320 + #endif
321 +@@ -308,7 +308,7 @@ so, delete this exception statement from your version.
322 + #include <sys/shm.h>
323 + #include <X11/extensions/XShm.h>
324 + #endif
325 +-#if LIBVNCSERVER_HAVE_SHMAT
326 ++#if HAVE_SHMAT
327 + #include <sys/ipc.h>
328 + #include <sys/shm.h>
329 + #endif
330 +@@ -392,7 +392,7 @@ extern int h_errno;
331 + #if LIBVNCSERVER_HAVE_SYS_WAIT_H
332 + #include <sys/wait.h>
333 + #endif
334 +-#if LIBVNCSERVER_HAVE_UTMPX_H
335 ++#if HAVE_UTMPX_H
336 + #include <utmpx.h>
337 + #endif
338 +
339 +--
340 +2.11.0.rc2
341 +
342
343 diff --git a/x11-misc/x11vnc/x11vnc-0.9.14-r1.ebuild b/x11-misc/x11vnc/x11vnc-0.9.14-r1.ebuild
344 new file mode 100644
345 index 00000000..43e7b13
346 --- /dev/null
347 +++ b/x11-misc/x11vnc/x11vnc-0.9.14-r1.ebuild
348 @@ -0,0 +1,65 @@
349 +# Copyright 1999-2016 Gentoo Foundation
350 +# Distributed under the terms of the GNU General Public License v2
351 +
352 +EAPI="5"
353 +
354 +inherit autotools eutils vcs-snapshot
355 +
356 +DESCRIPTION="A VNC server for real X displays"
357 +HOMEPAGE="https://libvnc.github.io/"
358 +SRC_URI="https://github.com/LibVNC/x11vnc/archive/0.9.14.tar.gz -> ${P}.tar.gz"
359 +
360 +LICENSE="GPL-2"
361 +SLOT="0"
362 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
363 +IUSE="crypt fbcon libressl ssl xinerama zeroconf"
364 +
365 +RDEPEND=">=net-libs/libvncserver-0.9.8
366 + x11-libs/libX11
367 + x11-libs/libXdamage
368 + x11-libs/libXext
369 + x11-libs/libXfixes
370 + x11-libs/libXrandr
371 + >=x11-libs/libXtst-1.1.0
372 + ssl? (
373 + !libressl? ( dev-libs/openssl:0= )
374 + libressl? ( dev-libs/libressl:= )
375 + )
376 + xinerama? ( x11-libs/libXinerama )
377 + zeroconf? ( >=net-dns/avahi-0.6.4 )
378 +"
379 +DEPEND="${RDEPEND}
380 + x11-libs/libXt
381 + x11-proto/inputproto
382 + x11-proto/trapproto
383 + x11-proto/recordproto
384 + x11-proto/xproto
385 + x11-proto/xextproto
386 + xinerama? ( x11-proto/xineramaproto )"
387 +
388 +DOCS=(ChangeLog README)
389 +
390 +src_prepare() {
391 + epatch "${FILESDIR}"/${PN}-0.9.13-fix-compiler-detection.patch
392 + epatch "${FILESDIR}"/${P}-libvncserver-defines-1.patch #567612
393 + epatch "${FILESDIR}"/${P}-libvncserver-defines-2.patch #567612
394 + eautoreconf
395 +}
396 +
397 +src_configure() {
398 + # --without-v4l because of missing video4linux 2.x support wrt #389079
399 + econf \
400 + $(use_with crypt) \
401 + $(use_with fbcon fbdev) \
402 + $(use_with ssl) \
403 + $(use_with ssl crypto) \
404 + --without-v4l \
405 + $(use_with xinerama) \
406 + $(use_with zeroconf avahi)
407 +}
408 +
409 +src_install() {
410 + default
411 + doinitd "${FILESDIR}/x11vnc.init.d"
412 + doconfd "${FILESDIR}/x11vnc.conf.d"
413 +}