Thursday, August 09, 2018

update: x11/x11vnc

Hi,

Here an update for x11vnc. I changed the upstream in order to get an
maintained version.

0.9.13 was the last release by the original author Karl Runge.
LibVNC/x11vnc on github is continued by LibVNC.

Changes related to upstream switch:
- x11vnc/ directory moved to src/ (so patches moved)
- libvncserver splited out

Changes since 0.9.13 (2010-12-20):
- see https://github.com/LibVNC/x11vnc/blob/0.9.15/NEWS for details

it includes buffer overflow and memleak fixes.


Regarding the port: I fighted a bit with autohell, and I am unsure about
the solution^Wworkaround I have. The project needs to run autoreconf
(the ./autogen.sh invoke autoreconf -v --install), and I didn't managed
to have something working with options in CONFIGURE_STYLE. I ended with
CONFIGURE_STYLE=gnu + CONFIGURE_SCRIPT=autogen.sh ... reviews and/or
advices would be welcome :)

Thanks.
--
Sebastien Marie


Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/x11vnc/Makefile,v
retrieving revision 1.48
diff -u -p -r1.48 Makefile
--- Makefile 27 Jun 2018 21:04:23 -0000 1.48
+++ Makefile 9 Aug 2018 12:40:18 -0000
@@ -2,36 +2,41 @@

COMMENT = VNC server for real X displays

-DISTNAME = x11vnc-0.9.13
-REVISION = 11
+GH_ACCOUNT = LibVNC
+GH_PROJECT = x11vnc
+GH_TAGNAME = 0.9.15

CATEGORIES = x11
-HOMEPAGE = http://www.karlrunge.com/x11vnc/

# GPLv2
PERMIT_PACKAGE_CDROM = Yes

-WANTLIB += X11 Xdamage Xext Xfixes Xinerama Xrandr Xtst c crypto
-WANTLIB += pthread ssl z jpeg avahi-client avahi-common
+WANTLIB += X11 Xcomposite Xcursor Xdamage Xext Xfixes Xi Xinerama
+WANTLIB += Xrandr Xtst avahi-client avahi-common c cairo crypto
+WANTLIB += pthread ssl vncclient vncserver

-MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=libvncserver/}
MODULES = x11/tk
RUN_DEPENDS = devel/desktop-file-utils \
${MODTK_RUN_DEPENDS}
-LIB_DEPENDS = graphics/jpeg \
- net/avahi
-
-AUTOCONF_VERSION = 2.59
-CONFIGURE_STYLE = autoconf
+LIB_DEPENDS = graphics/cairo \
+ net/avahi \
+ net/libvncserver
+
+USE_GMAKE = Yes
+CONFIGURE_STYLE = gnu
+CONFIGURE_SCRIPT = autogen.sh
CONFIGURE_ARGS += --with-x \
--with-avahi
CONFIGURE_ENV += CPPFLAGS="-I${LOCALBASE}/include" \
- LDFLAGS="-L${LOCALBASE}/lib"
+ LDFLAGS="-L${LOCALBASE}/lib" \
+ AUTOCONF_VERSION=${AUTOCONF_VERSION} \
+ AUTOMAKE_VERSION=${AUTOMAKE_VERSION}

-REORDER_DEPENDENCIES = ${FILESDIR}/automake.dep
+AUTOCONF_VERSION = 2.69
+AUTOMAKE_VERSION = 1.15

pre-configure:
- ${SUBST_CMD} ${WRKSRC}/x11vnc/gui.c
+ ${SUBST_CMD} ${WRKSRC}/src/gui.c

post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/x11vnc
Index: distinfo
===================================================================
RCS file: /cvs/ports/x11/x11vnc/distinfo,v
retrieving revision 1.12
diff -u -p -r1.12 distinfo
--- distinfo 18 Jan 2015 03:16:04 -0000 1.12
+++ distinfo 9 Aug 2018 09:50:22 -0000
@@ -1,2 +1,2 @@
-SHA256 (x11vnc-0.9.13.tar.gz) = 9oKfLmKWZ6UoTeYrCAsTEmoHNkmf5HzbRHrtsHpZ8Ts=
-SIZE (x11vnc-0.9.13.tar.gz) = 2853769
+SHA256 (x11vnc-0.9.15.tar.gz) = PkO9h17cPH9SoNNnbE7H3pEPzSECQO4gtFIt6yv4TP8=
+SIZE (x11vnc-0.9.15.tar.gz) = 1701821
Index: files/automake.dep
===================================================================
RCS file: files/automake.dep
diff -N files/automake.dep
--- files/automake.dep 17 Dec 2012 19:02:48 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,4 +0,0 @@
-# $OpenBSD: automake.dep,v 1.1 2012/12/17 19:02:48 naddy Exp $
-rfbconfig.h.in configure.ac
-rfbconfig.h.in aclocal.m4
-/rfbconfig.h configure.ac
Index: patches/patch-configure_ac
===================================================================
RCS file: /cvs/ports/x11/x11vnc/patches/patch-configure_ac,v
retrieving revision 1.1
diff -u -p -r1.1 patch-configure_ac
--- patches/patch-configure_ac 17 Dec 2012 19:02:48 -0000 1.1
+++ patches/patch-configure_ac 9 Aug 2018 09:58:26 -0000
@@ -1,12 +1,13 @@
$OpenBSD: patch-configure_ac,v 1.1 2012/12/17 19:02:48 naddy Exp $
---- configure.ac.orig Mon Dec 10 21:38:46 2012
-+++ configure.ac Mon Dec 10 21:39:06 2012
-@@ -777,7 +777,7 @@ fi
- AC_CHECK_FUNCS([ftime gethostbyname gethostname gettimeofday inet_ntoa memmove memset mmap mkfifo select socket strchr strcspn strdup strerror strstr])
- # x11vnc only:
- if test "$build_x11vnc" = "yes"; then
-- AC_CHECK_FUNCS([setsid setpgrp getpwuid getpwnam getspnam getuid geteuid setuid setgid seteuid setegid initgroups waitpid setutxent grantpt shmat])
-+ AC_CHECK_FUNCS([setsid setpgrp getpwuid getpwnam getspnam getuid geteuid setuid setgid seteuid setegid initgroups waitpid setutxent posix_openpt grantpt shmat])
+Index: configure.ac
+--- configure.ac.orig
++++ configure.ac
+@@ -482,7 +482,7 @@ if test "x$uname_s" = "xHP-UX"; then
fi
+
+ AC_CHECK_FUNCS([ftime gethostbyname gethostname gettimeofday inet_ntoa memmove memset mmap mkfifo select socket strchr strcspn strdup strerror strstr])
+-AC_CHECK_FUNCS([setsid setpgrp getpwuid getpwnam getspnam getuid geteuid setuid setgid seteuid setegid initgroups waitpid setutxent grantpt shmat])
++AC_CHECK_FUNCS([setsid setpgrp getpwuid getpwnam getspnam getuid geteuid setuid setgid seteuid setegid initgroups waitpid setutxent posix_openpt grantpt shmat])
+

# check, if shmget is in cygipc.a
Index: patches/patch-src_enc_h
===================================================================
RCS file: patches/patch-src_enc_h
diff -N patches/patch-src_enc_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_enc_h 9 Aug 2018 09:58:29 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: src/enc.h
+--- src/enc.h.orig
++++ src/enc.h
+@@ -1449,7 +1449,7 @@ static void securevnc_setup(int conn1, int conn2) {
+ fprintf(stderr, "securevnc_setup: RAND_pseudo_bytes() rc=%d\n", rc);
+ if (getenv("RANDSTR")) {
+ char *s = getenv("RANDSTR");
+- fprintf(stderr, "securevnc_setup: seeding with RANDSTR len=%d\n", strlen(s));
++ fprintf(stderr, "securevnc_setup: seeding with RANDSTR len=%zd\n", strlen(s));
+ RAND_add(s, strlen(s), strlen(s));
+ }
+ }
Index: patches/patch-src_gui_c
===================================================================
RCS file: patches/patch-src_gui_c
diff -N patches/patch-src_gui_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_gui_c 9 Aug 2018 09:53:31 -0000
@@ -0,0 +1,15 @@
+$OpenBSD: patch-x11vnc_gui_c,v 1.5 2010/04/02 00:42:25 sthen Exp $
+--- src/gui.c.orig Mon Dec 21 04:58:10 2009
++++ src/gui.c Wed Dec 23 22:02:45 2009
+@@ -263,9 +263,8 @@ static void sigusr1 (int sig) {
+
+ /* Most of the following mess is for wish on Solaris: */
+
+-static char *extra_path = ":/usr/local/bin:/usr/bin/X11:/usr/sfw/bin"
+- ":/usr/X11R6/bin:/usr/openwin/bin:/usr/dt/bin:/opt/sfw/bin";
+-static char *wishes[] = {"wish8.4", "wish", "wish8.3", "wish8.5", "wish8.6", "wish8.7", "wishx", "wish8.0", NULL};
++static char *extra_path = ":${PREFIX}/bin:${LOCALBASE}/bin:${X11BASE}/bin";
++static char *wishes[] = {"wish${MODTK_VERSION}", NULL};
+
+ static void run_gui(char *gui_xdisplay, int connect_to_x11vnc, int start_x11vnc,
+ int simple_gui, pid_t parent, char *gui_opts) {
Index: patches/patch-src_help_c
===================================================================
RCS file: patches/patch-src_help_c
diff -N patches/patch-src_help_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_help_c 9 Aug 2018 09:58:24 -0000
@@ -0,0 +1,13 @@
+$OpenBSD: patch-x11vnc_help_c,v 1.6 2017/04/16 12:43:20 ajacoutot Exp $
+Index: src/help.c
+--- src/help.c.orig
++++ src/help.c
+@@ -5956,7 +5956,7 @@ void xopen_display_fail_message(char *disp) {
+ fprintf(stderr, " -auth /var/lib/gdm/:0.Xauth\n");
+ fprintf(stderr, " kdm: -auth /var/lib/kdm/A:0-crWk72\n");
+ fprintf(stderr, " -auth /var/run/xauth/A:0-crWk72\n");
+- fprintf(stderr, " xdm: -auth /var/lib/xdm/authdir/authfiles/A:0-XQvaJk\n");
++ fprintf(stderr, " xenodm: -auth /etc/X11/xenodm/authdir/authfiles/A:0-XQvaJk\n");
+ fprintf(stderr, " dtlogin: -auth /var/dt/A:0-UgaaXa\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, " Sometimes the command \"ps wwwwaux | grep auth\""
Index: patches/patch-src_sslhelper_c
===================================================================
RCS file: patches/patch-src_sslhelper_c
diff -N patches/patch-src_sslhelper_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_sslhelper_c 9 Aug 2018 11:55:13 -0000
@@ -0,0 +1,85 @@
+$OpenBSD$
+
+Index: src/sslhelper.c
+--- src/sslhelper.c.orig
++++ src/sslhelper.c
+@@ -803,7 +803,7 @@ static int pem_passwd_callback(char *buf, int size, in
+ static int crl_callback(X509_STORE_CTX *callback_ctx) {
+ const ASN1_INTEGER *revoked_serial;
+ X509_STORE_CTX *store_ctx;
+-#if OPENSSL_VERSION_NUMBER > 0x10100000L
++#if OPENSSL_VERSION_NUMBER > 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ X509_OBJECT *obj;
+ #else
+ X509_OBJECT obj;
+@@ -829,7 +829,7 @@ static int crl_callback(X509_STORE_CTX *callback_ctx)
+ * the current certificate in order to verify it's integrity. */
+ store_ctx = X509_STORE_CTX_new();
+ X509_STORE_CTX_init(store_ctx, revocation_store, NULL, NULL);
+-#if OPENSSL_VERSION_NUMBER > 0x10100000L
++#if OPENSSL_VERSION_NUMBER > 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ obj = X509_OBJECT_new();
+ rc=X509_STORE_get_by_subject(store_ctx, X509_LU_CRL, subject, obj);
+ crl = X509_OBJECT_get0_X509_CRL(obj);
+@@ -865,7 +865,7 @@ static int crl_callback(X509_STORE_CTX *callback_ctx)
+ rfbLog("Invalid signature on CRL\n");
+ X509_STORE_CTX_set_error(callback_ctx,
+ X509_V_ERR_CRL_SIGNATURE_FAILURE);
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ X509_OBJECT_free(obj);
+ #else
+ X509_OBJECT_free_contents(&obj);
+@@ -883,7 +883,7 @@ static int crl_callback(X509_STORE_CTX *callback_ctx)
+ rfbLog("Found CRL has invalid nextUpdate field\n");
+ X509_STORE_CTX_set_error(callback_ctx,
+ X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD);
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ X509_OBJECT_free(obj);
+ #else
+ X509_OBJECT_free_contents(&obj);
+@@ -894,14 +894,14 @@ static int crl_callback(X509_STORE_CTX *callback_ctx)
+ rfbLog("Found CRL is expired - "
+ "revoking all certificates until you get updated CRL\n");
+ X509_STORE_CTX_set_error(callback_ctx, X509_V_ERR_CRL_HAS_EXPIRED);
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ X509_OBJECT_free(obj);
+ #else
+ X509_OBJECT_free_contents(&obj);
+

No comments:

Post a Comment