Let's ride the major bump caused by the xtrans update. There is no other api change though.
ok? comments ? Index: ChangeLog =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/ChangeLog,v retrieving revision 1.5 diff -u -r1.5 ChangeLog --- ChangeLog 12 Jul 2014 09:49:11 -0000 1.5 +++ ChangeLog 14 Jul 2019 20:12:15 -0000 @@ -1,3 +1,408 @@ +commit 8e6a14c63d6b73cde87cb331439f2a4d19cba5b9 +Author: Alan Coopersmith <alan.coopersm...@oracle.com> +Date: Sun Jul 14 10:37:25 2019 -0700 + + libICE 1.0.10 + + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + +commit b6aad584c1dc278364c295165512b5f5b98c173e +Author: Olivier Fourdan <ofour...@redhat.com> +Date: Thu Apr 11 09:05:15 2019 +0200 + + cleanup: Separate variable assignment and test + + Assigning and testing a value in a single statement hinders code clarity + and may confuses static code analyzers. + + Separate the assignment and the test for clarity. + + Signed-off-by: Olivier Fourdan <ofour...@redhat.com> + +commit 772e5b0fdfc9dbd8bec070bd0c4c7eb5565df2ee +Author: Olivier Fourdan <ofour...@redhat.com> +Date: Wed Apr 10 11:15:11 2019 +0200 + + _IceRead: Avoid possible use-after-free + + `_IceRead()` gets called from multiple places which do not expect the + connection to be freed. + + Do not free the connection data in `_IceRead()` to avoid potential + use-after-free issue in the various callers. + + The connection data will be freed eventually in `ProcessWantToClose()`, + so not freeing it in `_IceRead()` should not introduce an memory leak. + + Signed-off-by: Olivier Fourdan <ofour...@redhat.com> + +commit 1493beba2aa03bdadeed8b4fa5d424df6e113071 +Author: Olivier Fourdan <ofour...@redhat.com> +Date: Wed Apr 10 11:01:31 2019 +0200 + + IceListenForWellKnownConnections: Fix memleak + + The function `_IceTransMakeAllCOTSServerListeners` allocates memory for + `transConns` which is leaked in case of error. + + Signed-off-by: Olivier Fourdan <ofour...@redhat.com> + +commit a67a477eefdc93c32fa82da6ff0b4e69dd4c2ccb +Author: Alan Coopersmith <alan.coopersm...@oracle.com> +Date: Sun Mar 24 15:29:34 2019 -0700 + + IceWritePad: always use zero values for pad bytes + + Previously it would just bump the pointer in the buffer leaving + whatever values were previously there in place. + + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + +commit 2318ace3340009c44e78eab094f159f0e0b4a197 +Author: Alan Coopersmith <alan.coopersm...@oracle.com> +Date: Sun Mar 24 14:36:10 2019 -0700 + + IceOpenConnection: check for malloc failure on connect_to_you too + + Fixes: https://gitlab.freedesktop.org/xorg/lib/libice/issues/4 + + Reported-by: mahendra <mahendr...@samsung.com> + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + +commit b484311c929a1b64966d89da92fafce7263006e1 +Author: Allison Lortie <de...@desrt.ca> +Date: Tue Jun 14 16:09:46 2016 -0400 + + authutil: support $XDG_RUNTIME_DIR/ICEauthority + + If we find that $XDG_RUNTIME_DIR is set (and $ICEAUTHORITY is not), then + the ICEauthority file is stored in the XDG_RUNTIME_DIR instead of the + home directory, and without a leading dot. + + https://bugs.freedesktop.org/show_bug.cgi?id=49173 + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + +commit 48ed5e04b5a8ba64dcfeea090cf3a32d3087b749 +Author: Allison Lortie <de...@desrt.ca> +Date: Tue Jun 14 16:08:21 2016 -0400 + + authutil: fix an out-of-bounds access + + There is a theoretical edge case where the $HOME environment variable + could be set to the empty string. IceAuthFileName() unconditionally + checks index 1 of this string, which is out of bounds. + + Fix that up by rejecting empty strings in the same way as we reject + NULL. + + https://bugs.freedesktop.org/show_bug.cgi?id=49173 + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + +commit 468b83ec4810b4ea2373182b5801f998f3dcd471 +Author: Tobias Stoeckmann <tob...@stoeckmann.org> +Date: Mon Jul 30 20:50:58 2018 +0200 + + Always terminate strncpy results. + + The function strncpy does not guarantee to append a terminating + NUL character to the destination. + + This patch merges libSM's way of handling this issue into libICE. + + Signed-off-by: Tobias Stoeckmann <tob...@stoeckmann.org> + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + +commit 1cc4ae8648590f04557a20c8d88d39cef7fe8119 +Author: walter harms <wha...@bfs.de> +Date: Thu Sep 7 18:52:13 2017 +0200 + + iceauth.c: FIX warning: unused variable 'ret' in 'arc4random_buf' + + commit ff5e59f32255913bb1cdf51441b98c9107ae165b left ret outside the #if + causing a gcc warning: + + In function 'arc4random_buf': + iceauth.c:89:13: warning: unused variable 'ret' [-Wunused-variable] + + fixed by moving #if 1 up + + Signed-off-by: Walter Harms <wha...@bfs.de> + Reviewed-by: Alan Coopersmith <alan.coopersm...@oracle.com> + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + +commit ccbcae7d3409789bf346ca35963264d064f54cba +Author: Alan Coopersmith <alan.coopersm...@oracle.com> +Date: Fri Dec 7 19:29:55 2018 -0800 + + Update configure.ac bug URL for gitlab migration + + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + +commit e72ca90879db149bbee6232dd78a565e630e917d +Author: Alan Coopersmith <alan.coopersm...@oracle.com> +Date: Sun Nov 18 21:48:59 2018 -0800 + + Update README for gitlab migration + + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + +commit dc73ec034c9083b8c7d980e80eb6d4c88bcfaa51 +Author: Alan Coopersmith <alan.coopersm...@oracle.com> +Date: Sat Nov 10 13:13:45 2018 -0800 + + Remove obsolete B16 & B32 tags in struct definitions + + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + +commit f66955f7250d7c150dfb97862878acc2222781e5 +Author: walter harms <wha...@bfs.de> +Date: Fri Sep 8 20:03:03 2017 +0200 + + make IceProtocolShutdown() more readable + + I found IceProtocolShutdown() hard to read only to find that was + it does it aktually very simple. So i rearranged the code to make + it more readable. + + Signed-off-by: Walter Harms <wha...@bfs.de> + Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com> + [Emil Velikov: whitespace fixes] + Signed-off-by: Emil Velikov <emil.veli...@collabora.com> + +commit 936dcaac07f7db569ed91a34e0a4b5944aac205f +Author: walter harms <wha...@bfs.de> +Date: Fri Sep 8 19:59:17 2017 +0200 + + Drop NULL check prior to free() + + free() can handle NULL just fine - remove the check. + + Signed-off-by: Walter Harms <wha...@bfs.de> + Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com> + Reviewed-by: Emil Velikov <emil.veli...@collabora.com> + +commit 43644931cb9cb5cc92391f6f5431535b9b7a3f24 +Author: Eric Engestrom <eric.engest...@imgtec.com> +Date: Fri Jul 7 11:23:48 2017 +0100 + + Make sure string is never NULL + + `error_message` is passed in to strncpy() without any check, which + doesn't handle NULL itself, so let's make it a valid empty string in + cases where it was NULL. + + Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com> + Acked-by: Walter Harms <wha...@bfs.de> + Reviewed-by: Emil Velikov <emil.veli...@collabora.com> + +commit e8c21056134498c49733f6baf572ffbb051ed886 +Author: Eric Engestrom <eric.engest...@imgtec.com> +Date: Fri Jul 7 11:23:47 2017 +0100 + + Make sure error_message is a free-able string + + Similar to the previous commit, assigning a static string would crash + upon freeing. + + Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com> + Acked-by: Walter Harms <wha...@bfs.de> + Reviewed-by: Emil Velikov <emil.veli...@collabora.com> + +commit 7a7844bf5ade915268fe7f9b292908c6cd75f3ba +Author: Eric Engestrom <eric.engest...@imgtec.com> +Date: Fri Jul 7 11:23:46 2017 +0100 + + Make sure errorStr is a free-able string + + If the `errorClass` isn't handled by the switch, `errorStr`'s initial + value would be a pointer to some static memory with an empty string, + and freeing it would most likely crash. + + Let's set it to NULL instead, as is done in other similar places. + + Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com> + Acked-by: Walter Harms <wha...@bfs.de> + Reviewed-by: Emil Velikov <emil.veli...@collabora.com> + +commit 7ef9680caa8c223a09beb637e26fd3471128e6ba +Author: Emil Velikov <emil.l.veli...@gmail.com> +Date: Sun May 8 09:19:36 2016 +0100 + + configure.ac: set TRANS_CLIENT/SERVER + + Similar to ICE_t just set the define globally and remove the multiple + definitions throughout the tree + + Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> + Reviewed-by: Adam Jackson <a...@redhat.com> + Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com> (IRC) + +commit ab64a947b5de5b778f31ede9cfce386566023a14 +Author: Emil Velikov <emil.l.veli...@gmail.com> +Date: Sun May 8 09:19:35 2016 +0100 + + Kill off local ICE_t definitions + + Already defined at global scale in configure.ac + + Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> + Reviewed-by: Adam Jackson <a...@redhat.com> + Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com> (IRC) + +commit f4c00d345edf3dad5893b50ff0ae7cd3e0cfd780 +Author: Emil Velikov <emil.l.veli...@gmail.com> +Date: Sun May 8 09:19:34 2016 +0100 + + Remove unneeded ^L symbols. + + Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> + Reviewed-by: Adam Jackson <a...@redhat.com> + Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com> (IRC) + +commit d603d7d7d989c4ff1094810e9fcf2a29bc00bb0c +Author: Emil Velikov <emil.l.veli...@gmail.com> +Date: Sun May 8 09:19:33 2016 +0100 + + Kill off Time_t macro + + Analogous to previous commit, including the megacommit that removed the + need for it. + + Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> + Reviewed-by: Adam Jackson <a...@redhat.com> + Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com> (IRC) + +commit 82250f26fc76d7b7574cfd472646a98e325d944a +Author: Emil Velikov <emil.l.veli...@gmail.com> +Date: Sun May 8 09:19:32 2016 +0100 + + Kill off Strstr macro + + Directly use the strstr function as opposed to wrapping it in a macro. + The latter is no longer needed as of + + commit 72e353567f8927996a26e72848d86f692c3f0737 + Author: Kaleb Keithley <ka...@freedesktop.org> + Date: Fri Nov 14 16:48:46 2003 +0000 + + XFree86 4.3.0.1 + + Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> + Reviewed-by: Adam Jackson <a...@redhat.com> + Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com> (IRC) + +commit ff5e59f32255913bb1cdf51441b98c9107ae165b +Author: Benjamin Tissoires <benjamin.tissoi...@gmail.com> +Date: Tue Apr 4 19:12:53 2017 +0200 + + Use getentropy() if arc4random_buf() is not available + + This allows to fix CVE-2017-2626 on Linux platforms without pulling in + libbsd. + The libc getentropy() is available since glibc 2.25 but also on OpenBSD. + For Linux, we need at least a v3.17 kernel. If the recommended + arc4random_buf() function is not available, emulate it by first trying + to use getentropy() on a supported glibc and kernel. If the call fails, + fall back to the current (partly vulnerable) code. + + Signed-off-by: Benjamin Tissoires <benjamin.tissoi...@gmail.com> + Reviewed-by: Mark Kettenis <kette...@openbsd.org> + Reviewed-by: Alan Coopersmith <alan.coopersm...@oracle.com> + Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> + +commit 1746abbb1ae1c41ba29c14895c5bd3f1334faef5 +Author: Mihail Konev <k....@ya.ru> +Date: Thu Jan 26 13:52:49 2017 +1000 + + autogen: add default patch prefix + + Signed-off-by: Mihail Konev <k....@ya.ru> + +commit 3aa14db63fefb7634b1bd4370e33ba14c4ea90ae +Author: Emil Velikov <emil.l.veli...@gmail.com> +Date: Mon Mar 9 12:00:52 2015 +0000 + + autogen.sh: use quoted string variables + + Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent + fall-outs, when they contain space. + + Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> + Reviewed-by: Peter Hutterer <peter.hutte...@who-t.net> + Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> + +commit d41c57eaa0c1474acf0a6fb271f22106e3070016 +Author: Peter Hutterer <peter.hutte...@who-t.net> +Date: Tue Jan 24 10:32:07 2017 +1000 + + autogen.sh: use exec instead of waiting for configure to finish + + Syncs the invocation of configure with the one from the server. + + Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> + Reviewed-by: Emil Velikov <emil.veli...@collabora.com> + +commit ac4bb20e74e064b219de70e9b54516a921fdb7c3 +Author: Tobias Stoeckmann <tob...@stoeckmann.org> +Date: Tue Nov 22 20:13:29 2016 +0100 + + Fix use after free on subsequent calls + + The function IceAuthFileName is vulnerable to a use after free. The + flaw can be triggered by calling the function three times: + + - First call succeeds and stores the path in buf, a dynamically + allocated buffer with size bsize. + - Second call fails due to out of memory. It frees buf, but keeps + the old size in bsize. + - Third call only checks if bsize is large enough. Then it uses + buf without allocating it again -- the use after free happens. + + In order to exploit this, an attacker must change environment variables + between each call, namely ICEAUTHORITY or HOME. It also takes subsequent + calls. Due to these limitations, I don't consider this to be of high + priority. + + Reviewed-by: Matthieu Herrb <matth...@herrb.eu> + +commit b1720edc9b9f3e7a05caa3fcd81761e5818ea255 +Author: Remko van der Vossen <b...@yuugen.jp> +Date: Sun Jul 19 08:34:11 2015 -0700 + + Bug 90616 - libICE build fails on array bounds check + + https://bugs.freedesktop.org/show_bug.cgi?id=90616 + + Recent versions of gcc have array bounds checking turned on by default, + this leads to build failures of libICE. As the _IceVersionCount variable + in ICElibint.h is not declared const the compiler cannot assume that the + nested for loop in ProcessConnectionSetup stays within bounds. + + The simple fix is of course to change the declarations of _IceVersionCount, + _IceVersions, and the local variable myVersionCount to const declarations. + + Reviewed-by: Alan Coopersmith <alan.coopersm...@oracle.com> + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + +commit 8a511dad53774693ed818d54d7896e1663942b18 +Author: Jon TURNEY <jon.tur...@dronecode.org.uk> +Date: Sat Sep 13 17:13:44 2014 +0100 + + Include unistd.h for getpid() + + Signed-off-by: Jon TURNEY <jon.tur...@dronecode.org.uk> + Reviewed-by: David Macek <david.mace...@gmail.com> + +commit fd22b62ae6380ddb00fa4c750f5ce175d2a6e76f +Author: Alan Coopersmith <alan.coopersm...@oracle.com> +Date: Sun Sep 14 13:08:17 2014 -0700 + + spec: Convert troff \*Q..\*U to DocBook <quote>...</quote> + + Reported-by: Jasper St. Pierre <jstpie...@mecheye.net> + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + Reviewed-by: Jasper St. Pierre <jstpie...@mecheye.net> + commit 0dfab4253e26d5c6e5f058126eb5e9f7a7732ae8 Author: Alan Coopersmith <alan.coopersm...@oracle.com> Date: Fri Jun 6 18:28:28 2014 -0700 Index: Makefile.am =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/Makefile.am,v retrieving revision 1.4 diff -u -r1.4 Makefile.am --- Makefile.am 4 Mar 2012 18:57:08 -0000 1.4 +++ Makefile.am 14 Jul 2019 20:12:15 -0000 @@ -19,3 +19,5 @@ lint: (cd src && $(MAKE) $(MFLAGS) lint) endif LINT + +EXTRA_DIST = README.md Index: Makefile.bsd-wrapper =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/Makefile.bsd-wrapper,v retrieving revision 1.3 diff -u -r1.3 Makefile.bsd-wrapper --- Makefile.bsd-wrapper 13 Aug 2013 07:07:12 -0000 1.3 +++ Makefile.bsd-wrapper 14 Jul 2019 20:12:15 -0000 @@ -1,5 +1,5 @@ # $OpenBSD: Makefile.bsd-wrapper,v 1.3 2013/08/13 07:07:12 guenther Exp $ -SHARED_LIBS= ICE 10.0 +SHARED_LIBS= ICE 11.0 .include <bsd.xorg.mk> Index: Makefile.in =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/Makefile.in,v retrieving revision 1.11 diff -u -r1.11 Makefile.in --- Makefile.in 11 Oct 2016 22:15:18 -0000 1.11 +++ Makefile.in 14 Jul 2019 20:12:15 -0000 @@ -51,7 +51,7 @@ build_triplet = @build@ host_triplet = @host@ subdir = . -DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ +DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/ice.pc.in $(top_srcdir)/configure AUTHORS COPYING \ ChangeLog INSTALL compile config.guess config.sub depcomp \ @@ -324,6 +324,7 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = ice.pc MAINTAINERCLEANFILES = ChangeLog INSTALL +EXTRA_DIST = README.md all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive Index: README =================================================================== RCS file: README diff -N README --- README 4 Mar 2012 18:57:08 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,30 +0,0 @@ -libICE - Inter-Client Exchange Library - -Documentation for this API can be found in the doc directory of the source -code, or online at: - - http://xorg.freedesktop.org/releases/X11R7.0/doc/PDF/ICElib.pdf - -All questions regarding this software should be directed at the -Xorg mailing list: - - http://lists.freedesktop.org/mailman/listinfo/xorg - -Please submit bug reports to the Xorg bugzilla: - - https://bugs.freedesktop.org/enter_bug.cgi?product=xorg - -The master development code repository can be found at: - - git://anongit.freedesktop.org/git/xorg/lib/libICE - - http://cgit.freedesktop.org/xorg/lib/libICE - -For patch submission instructions, see: - - http://www.x.org/wiki/Development/Documentation/SubmittingPatches - -For more information on the git code manager, see: - - http://wiki.x.org/wiki/GitPage - Index: README.md =================================================================== RCS file: README.md diff -N README.md --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ README.md 14 Jul 2019 20:12:15 -0000 @@ -0,0 +1,23 @@ +libICE - Inter-Client Exchange Library +-------------------------------------- + +Documentation for this API can be found in the doc directory of the source +code, or online at: + + https://www.x.org/releases/current/doc/libICE/ + +All questions regarding this software should be directed at the +Xorg mailing list: + + https://lists.x.org/mailman/listinfo/xorg + +The master development code repository can be found at: + + https://gitlab.freedesktop.org/xorg/lib/libICE + +Please submit bug reports and requests to merge patches there. + +For patch submission instructions, see: + + https://www.x.org/wiki/Development/Documentation/SubmittingPatches + Index: aclocal.m4 =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/aclocal.m4,v retrieving revision 1.14 diff -u -r1.14 aclocal.m4 --- aclocal.m4 11 Oct 2016 22:15:18 -0000 1.14 +++ aclocal.m4 14 Jul 2019 20:12:16 -0000 @@ -8606,32 +8606,63 @@ m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 1 (pkg-config-0.24) -# -# Copyright © 2004 Scott James Remnant <sc...@netsplit.com>. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- +dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +dnl serial 11 (pkg-config-0.29.1) +dnl +dnl Copyright © 2004 Scott James Remnant <sc...@netsplit.com>. +dnl Copyright © 2012-2015 Dan Nicholson <dbn.li...@gmail.com> +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29.1]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) @@ -8653,18 +8684,19 @@ PKG_CONFIG="" fi fi[]dnl -])# PKG_PROG_PKG_CONFIG +])dnl PKG_PROG_PKG_CONFIG -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -# only at the first occurence in configure.ac, so if the first place -# it's called might be skipped (such as if it is within an "if", you -# have to call PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ @@ -8674,8 +8706,10 @@ $3])dnl fi]) -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" @@ -8687,10 +8721,11 @@ else pkg_failed=untried fi[]dnl -])# _PKG_CONFIG +])dnl _PKG_CONFIG -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -8698,19 +8733,17 @@ else _pkg_short_errors_supported=no fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED +])dnl _PKG_SHORT_ERRORS_SUPPORTED -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl @@ -8764,16 +8797,40 @@ AC_MSG_RESULT([yes]) $3 fi[]dnl -])# PKG_CHECK_MODULES +])dnl PKG_CHECK_MODULES -# PKG_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable pkgconfigdir as the location where a module -# should install pkg-config .pc files. By default the directory is -# $libdir/pkgconfig, but the default can be changed by passing -# DIRECTORY. The user can override through the --with-pkgconfigdir -# parameter. +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC + + +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], @@ -8784,16 +8841,18 @@ AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) -]) dnl PKG_INSTALLDIR +])dnl PKG_INSTALLDIR -# PKG_NOARCH_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable noarch_pkgconfigdir as the location where a -# module should install arch-independent pkg-config .pc files. By -# default the directory is $datadir/pkgconfig, but the default can be -# changed by passing DIRECTORY. The user can override through the -# --with-noarch-pkgconfigdir parameter. +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], @@ -8804,7 +8863,24 @@ AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) -]) dnl PKG_NOARCH_INSTALLDIR +])dnl PKG_NOARCH_INSTALLDIR + + +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])dnl PKG_CHECK_VAR # Copyright (C) 2002-2012 Free Software Foundation, Inc. # @@ -9829,7 +9905,7 @@ dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. dnl -dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. +dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the "Software"), @@ -9866,7 +9942,7 @@ # See the "minimum version" comment for each macro you use to see what # version you require. m4_defun([XORG_MACROS_VERSION],[ -m4_define([vers_have], [1.19.0]) +m4_define([vers_have], [1.19.2]) m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) m4_if(m4_cmp(maj_have, maj_needed), 0,, @@ -9944,6 +10020,17 @@ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_SED]) +case $host_os in + solaris*) + # Solaris 2.0 - 11.3 use SysV man page section numbers, so we + # check for a man page file found in later versions that use + # traditional section numbers instead + AC_CHECK_FILE([/usr/share/man/man7/attributes.7], + [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true]) + ;; + *) SYSV_MAN_SECTIONS=false ;; +esac + if test x$APP_MAN_SUFFIX = x ; then APP_MAN_SUFFIX=1 fi @@ -9959,9 +10046,9 @@ fi if test x$FILE_MAN_SUFFIX = x ; then - case $host_os in - solaris*) FILE_MAN_SUFFIX=4 ;; - *) FILE_MAN_SUFFIX=5 ;; + case $SYSV_MAN_SECTIONS in + true) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; esac fi if test x$FILE_MAN_DIR = x ; then @@ -9969,9 +10056,9 @@ fi if test x$MISC_MAN_SUFFIX = x ; then - case $host_os in - solaris*) MISC_MAN_SUFFIX=5 ;; - *) MISC_MAN_SUFFIX=7 ;; + case $SYSV_MAN_SECTIONS in + true) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; esac fi if test x$MISC_MAN_DIR = x ; then @@ -9979,9 +10066,9 @@ fi if test x$DRIVER_MAN_SUFFIX = x ; then - case $host_os in - solaris*) DRIVER_MAN_SUFFIX=7 ;; - *) DRIVER_MAN_SUFFIX=4 ;; + case $SYSV_MAN_SECTIONS in + true) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; esac fi if test x$DRIVER_MAN_DIR = x ; then @@ -9989,9 +10076,9 @@ fi if test x$ADMIN_MAN_SUFFIX = x ; then - case $host_os in - solaris*) ADMIN_MAN_SUFFIX=1m ;; - *) ADMIN_MAN_SUFFIX=8 ;; + case $SYSV_MAN_SECTIONS in + true) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; esac fi if test x$ADMIN_MAN_DIR = x ; then @@ -10252,13 +10339,24 @@ fi]) # Test for the ability of xmlto to generate a text target +# +# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the +# following test for empty XML docbook files. +# For compatibility reasons use the following empty XML docbook file and if +# it fails try it again with a non-empty XML file. have_xmlto_text=no cat > conftest.xml << "EOF" EOF AS_IF([test "$have_xmlto" = yes], [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], [have_xmlto_text=yes], - [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) + [# Try it again with a non-empty XML file. + cat > conftest.xml << "EOF" +<x></x> +EOF + AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], + [have_xmlto_text=yes], + [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])]) rm -f conftest.xml AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) @@ -11654,8 +11752,9 @@ macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ -|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ -echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" +|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \ +touch \$(top_srcdir)/INSTALL; \ +echo 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))" AC_SUBST([INSTALL_CMD]) ]) # XORG_INSTALL dnl Copyright 2005 Red Hat, Inc @@ -11716,10 +11815,11 @@ # # AC_DEFUN([XORG_CHANGELOG], [ -CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ +CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ -|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ -echo 'git directory not found: installing possibly empty changelog.' >&2)" +|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \ +touch \$(top_srcdir)/ChangeLog; \ +echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))" AC_SUBST([CHANGELOG_CMD]) ]) # XORG_CHANGELOG Index: compile =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/compile,v retrieving revision 1.1 diff -u -r1.1 compile --- compile 12 Jul 2014 09:49:11 -0000 1.1 +++ compile 14 Jul 2019 20:12:16 -0000 @@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey <tro...@cygnus.com>. # # This program is free software; you can redistribute it and/or modify Index: config.h.in =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/config.h.in,v retrieving revision 1.7 diff -u -r1.7 config.h.in --- config.h.in 12 Jul 2014 09:49:11 -0000 1.7 +++ config.h.in 14 Jul 2019 20:12:16 -0000 @@ -12,6 +12,9 @@ /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the `getentropy' function. */ +#undef HAVE_GETENTROPY + /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H @@ -96,6 +99,12 @@ /* Support TCP socket connections */ #undef TCPCONN + +/* Xtrans transport client code */ +#undef TRANS_CLIENT + +/* Xtrans transport server code */ +#undef TRANS_SERVER /* Support UNIX socket connections */ #undef UNIXCONN Index: configure =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/configure,v retrieving revision 1.14 diff -u -r1.14 configure --- configure 11 Oct 2016 22:15:18 -0000 1.14 +++ configure 14 Jul 2019 20:12:16 -0000 @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libICE 1.0.9. +# Generated by GNU Autoconf 2.69 for libICE 1.0.10. # -# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. +# Report bugs to <https://gitlab.freedesktop.org/xorg/lib/libICE/issues>. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -275,7 +275,7 @@ $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoc...@gnu.org and -$0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg +$0: https://gitlab.freedesktop.org/xorg/lib/libICE/issues $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do @@ -651,9 +651,9 @@ # Identity of this package. PACKAGE_NAME='libICE' PACKAGE_TARNAME='libICE' -PACKAGE_VERSION='1.0.9' -PACKAGE_STRING='libICE 1.0.9' -PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' +PACKAGE_VERSION='1.0.10' +PACKAGE_STRING='libICE 1.0.10' +PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/lib/libICE/issues' PACKAGE_URL='' ac_unique_file="Makefile.am" @@ -1449,7 +1449,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libICE 1.0.9 to adapt to many kinds of systems. +\`configure' configures libICE 1.0.10 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1519,7 +1519,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libICE 1.0.9:";; + short | recursive ) echo "Configuration of libICE 1.0.10:";; esac cat <<\_ACEOF @@ -1597,7 +1597,7 @@ Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. +Report bugs to <https://gitlab.freedesktop.org/xorg/lib/libICE/issues>. _ACEOF ac_status=$? fi @@ -1660,7 +1660,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libICE configure 1.0.9 +libICE configure 1.0.10 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1819,9 +1819,9 @@ $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ---------------------------------------------------------------------- ## -## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg ## -## ---------------------------------------------------------------------- ##" +( $as_echo "## -------------------------------------------------------------------- ## +## Report this to https://gitlab.freedesktop.org/xorg/lib/libICE/issues ## +## -------------------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac @@ -2186,7 +2186,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libICE $as_me 1.0.9, which was +It was created by libICE $as_me 1.0.10, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4330,7 +4330,7 @@ # Define the identity of the package. PACKAGE='libICE' - VERSION='1.0.9' + VERSION='1.0.10' cat >>confdefs.h <<_ACEOF @@ -17766,10 +17766,11 @@ -CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ +CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ -|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ -echo 'git directory not found: installing possibly empty changelog.' >&2)" +|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \ +touch \$(top_srcdir)/ChangeLog; \ +echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))" @@ -17777,14 +17778,45 @@ macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ -|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ -echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" +|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \ +touch \$(top_srcdir)/INSTALL; \ +echo 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))" +case $host_os in + solaris*) + # Solaris 2.0 - 11.3 use SysV man page section numbers, so we + # check for a man page file found in later versions that use + # traditional section numbers instead + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/man/man7/attributes.7" >&5 +$as_echo_n "checking for /usr/share/man/man7/attributes.7... " >&6; } +if ${ac_cv_file__usr_share_man_man7_attributes_7+:} false; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/usr/share/man/man7/attributes.7"; then + ac_cv_file__usr_share_man_man7_attributes_7=yes +else + ac_cv_file__usr_share_man_man7_attributes_7=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_man_man7_attributes_7" >&5 +$as_echo "$ac_cv_file__usr_share_man_man7_attributes_7" >&6; } +if test "x$ac_cv_file__usr_share_man_man7_attributes_7" = xyes; then : + SYSV_MAN_SECTIONS=false +else + SYSV_MAN_SECTIONS=true +fi + + ;; + *) SYSV_MAN_SECTIONS=false ;; +esac + if test x$APP_MAN_SUFFIX = x ; then APP_MAN_SUFFIX=1 fi @@ -17800,9 +17832,9 @@ fi if test x$FILE_MAN_SUFFIX = x ; then - case $host_os in - solaris*) FILE_MAN_SUFFIX=4 ;; - *) FILE_MAN_SUFFIX=5 ;; + case $SYSV_MAN_SECTIONS in + true) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; esac fi if test x$FILE_MAN_DIR = x ; then @@ -17810,9 +17842,9 @@ fi if test x$MISC_MAN_SUFFIX = x ; then - case $host_os in - solaris*) MISC_MAN_SUFFIX=5 ;; - *) MISC_MAN_SUFFIX=7 ;; + case $SYSV_MAN_SECTIONS in + true) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; esac fi if test x$MISC_MAN_DIR = x ; then @@ -17820,9 +17852,9 @@ fi if test x$DRIVER_MAN_SUFFIX = x ; then - case $host_os in - solaris*) DRIVER_MAN_SUFFIX=7 ;; - *) DRIVER_MAN_SUFFIX=4 ;; + case $SYSV_MAN_SECTIONS in + true) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; esac fi if test x$DRIVER_MAN_DIR = x ; then @@ -17830,9 +17862,9 @@ fi if test x$ADMIN_MAN_SUFFIX = x ; then - case $host_os in - solaris*) ADMIN_MAN_SUFFIX=1m ;; - *) ADMIN_MAN_SUFFIX=8 ;; + case $SYSV_MAN_SECTIONS in + true) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; esac fi if test x$ADMIN_MAN_DIR = x ; then @@ -18103,6 +18135,11 @@ fi # Test for the ability of xmlto to generate a text target +# +# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the +# following test for empty XML docbook files. +# For compatibility reasons use the following empty XML docbook file and if +# it fails try it again with a non-empty XML file. have_xmlto_text=no cat > conftest.xml << "EOF" EOF @@ -18110,10 +18147,18 @@ if $XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1; then : have_xmlto_text=yes else + # Try it again with a non-empty XML file. + cat > conftest.xml << "EOF" +<x></x> +EOF + if $XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1; then : + have_xmlto_text=yes +else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: xmlto cannot generate text format, this format skipped" >&5 $as_echo "$as_me: WARNING: xmlto cannot generate text format, this format skipped" >&2;} fi fi +fi rm -f conftest.xml if test $have_xmlto_text = yes; then HAVE_XMLTO_TEXT_TRUE= @@ -18846,6 +18891,12 @@ $as_echo "#define ICE_t 1" >>confdefs.h +$as_echo "#define TRANS_CLIENT 1" >>confdefs.h + + +$as_echo "#define TRANS_SERVER 1" >>confdefs.h + + # Checks for library functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf in -lbsd" >&5 $as_echo_n "checking for arc4random_buf in -lbsd... " >&6; } @@ -18892,7 +18943,7 @@ fi -for ac_func in asprintf arc4random_buf +for ac_func in asprintf arc4random_buf getentropy do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -19611,7 +19662,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libICE $as_me 1.0.9, which was +This file was extended by libICE $as_me 1.0.10, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19671,13 +19722,13 @@ Configuration commands: $config_commands -Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>." +Report bugs to <https://gitlab.freedesktop.org/xorg/lib/libICE/issues>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libICE config.status 1.0.9 +libICE config.status 1.0.10 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Index: configure.ac =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/configure.ac,v retrieving revision 1.6 diff -u -r1.6 configure.ac --- configure.ac 12 Jul 2014 09:49:11 -0000 1.6 +++ configure.ac 14 Jul 2019 20:12:16 -0000 @@ -1,8 +1,8 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([libICE], [1.0.9], - [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libICE]) +AC_INIT([libICE], [1.0.10], + [https://gitlab.freedesktop.org/xorg/lib/libICE/issues], [libICE]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) @@ -35,10 +35,12 @@ # Transport selection macro from xtrans.m4 XTRANS_CONNECTION_FLAGS AC_DEFINE(ICE_t, 1, [Xtrans transport type]) +AC_DEFINE(TRANS_CLIENT, 1, [Xtrans transport client code]) +AC_DEFINE(TRANS_SERVER, 1, [Xtrans transport server code]) # Checks for library functions. AC_CHECK_LIB([bsd], [arc4random_buf]) -AC_CHECK_FUNCS([asprintf arc4random_buf]) +AC_CHECK_FUNCS([asprintf arc4random_buf getentropy]) # Allow checking code with lint, sparse, etc. XORG_WITH_LINT Index: doc/ICElib.xml =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/doc/ICElib.xml,v retrieving revision 1.1 diff -u -r1.1 ICElib.xml --- doc/ICElib.xml 4 Mar 2012 18:57:09 -0000 1.1 +++ doc/ICElib.xml 14 Jul 2019 20:12:16 -0000 @@ -2738,7 +2738,7 @@ CARD8 major_opcode; CARD8 minor_opcode; CARD8 data[2]; - CARD32 length B32; + CARD32 length; </literallayout> <para> Index: include/X11/ICE/ICEmsg.h =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/include/X11/ICE/ICEmsg.h,v retrieving revision 1.4 diff -u -r1.4 ICEmsg.h --- include/X11/ICE/ICEmsg.h 12 Jul 2014 09:49:11 -0000 1.4 +++ include/X11/ICE/ICEmsg.h 14 Jul 2019 20:12:16 -0000 @@ -214,16 +214,8 @@ #define IceWritePad(_iceConn, _bytes) \ { \ - if ((_iceConn->outbufptr + (_bytes)) > _iceConn->outbufmax) \ - { \ - char _dummy[7] = { 0 }; \ - IceFlush (_iceConn); \ - _IceWrite (_iceConn, (unsigned long) (_bytes), _dummy); \ - } \ - else \ - { \ - _iceConn->outbufptr += (_bytes); \ - } \ + char _dummy[7] = { 0 }; \ + IceWriteData (_iceConn, (_bytes), _dummy); \ } Index: include/X11/ICE/ICEproto.h =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/include/X11/ICE/ICEproto.h,v retrieving revision 1.2 diff -u -r1.2 ICEproto.h --- include/X11/ICE/ICEproto.h 4 Mar 2012 18:57:09 -0000 1.2 +++ include/X11/ICE/ICEproto.h 14 Jul 2019 20:12:16 -0000 @@ -35,18 +35,18 @@ CARD8 majorOpcode; CARD8 minorOpcode; CARD8 data[2]; - CARD32 length B32; + CARD32 length; } iceMsg; typedef struct { CARD8 majorOpcode; CARD8 minorOpcode; - CARD16 errorClass B16; - CARD32 length B32; + CARD16 errorClass; + CARD32 length; CARD8 offendingMinorOpcode; CARD8 severity; - CARD16 unused B16; - CARD32 offendingSequenceNum B32; + CARD16 unused; + CARD32 offendingSequenceNum; /* n varying values */ /* p p = pad (n, 8) */ } iceErrorMsg; @@ -56,7 +56,7 @@ CARD8 minorOpcode; CARD8 byteOrder; CARD8 unused; - CARD32 length B32; + CARD32 length; } iceByteOrderMsg; typedef struct { @@ -64,7 +64,7 @@ CARD8 minorOpcode; CARD8 versionCount; CARD8 authCount; - CARD32 length B32; + CARD32 length; CARD8 mustAuthenticate; CARD8 unused[7]; /* i STRING vendor */ @@ -79,8 +79,8 @@ CARD8 minorOpcode; CARD8 authIndex; CARD8 unused1; - CARD32 length B32; - CARD16 authDataLength B16; + CARD32 length; + CARD16 authDataLength; CARD8 unused2[6]; /* n varying data */ /* p p = pad (n, 8) */ @@ -90,8 +90,8 @@ CARD8 majorOpcode; CARD8 minorOpcode; CARD8 unused1[2]; - CARD32 length B32; - CARD16 authDataLength B16; + CARD32 length; + CARD16 authDataLength; CARD8 unused2[6]; /* n varying data */ /* p p = pad (n, 8) */ @@ -101,8 +101,8 @@ CARD8 majorOpcode; CARD8 minorOpcode; CARD8 unused1[2]; - CARD32 length B32; - CARD16 authDataLength B16; + CARD32 length; + CARD16 authDataLength; CARD8 unused2[6]; /* n varying data */ /* p p = pad (n, 8) */ @@ -113,7 +113,7 @@ CARD8 minorOpcode; CARD8 versionIndex; CARD8 unused; - CARD32 length B32; + CARD32 length; /* i STRING vendor */ /* j STRING release */ /* p p = pad (i+j, 8) */ @@ -124,7 +124,7 @@ CARD8 minorOpcode; CARD8 protocolOpcode; CARD8 mustAuthenticate; - CARD32 length B32; + CARD32 length; CARD8 versionCount; CARD8 authCount; CARD8 unused[6]; @@ -141,7 +141,7 @@ CARD8 minorOpcode; CARD8 versionIndex; CARD8 protocolOpcode; - CARD32 length B32; + CARD32 length; /* i STRING vendor */ /* j STRING release */ /* p p = pad (i+j, 8) */ Index: specs/ice.xml =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/specs/ice.xml,v retrieving revision 1.1 diff -u -r1.1 ice.xml --- specs/ice.xml 4 Mar 2012 18:57:09 -0000 1.1 +++ specs/ice.xml 14 Jul 2019 20:12:16 -0000 @@ -95,8 +95,8 @@ <para>Through some mechanism outside ICE, two parties make themselves known to each other and agree that they would like to communicate using an ICE subprotocol. ICE assumes that this negotation includes some notion by which -the parties will decide which is the \*Qoriginating\*U party and which is -the \*Qanswering\*U party. The negotiation will also need to provide the +the parties will decide which is the <quote>originating</quote> party and which is +the <quote>answering</quote> party. The negotiation will also need to provide the originating party with a name or address of the answering party. Examples of mechanisms by which parties can make themselves known to each other are the X selection mechanism, environment @@ -227,7 +227,7 @@ byte order and the receiver is required to swap it appropriately. In order to support 64-bit machines, ICE messages are padded to multiples of 8 bytes. All messages are designed so that -fields are \*Qnaturally\*U aligned on 16-, 32-, and 64-bit boundaries. +fields are <quote>naturally</quote> aligned on 16-, 32-, and 64-bit boundaries. The following formula gives the number of bytes necessary to pad <emphasis remap='I'>E</emphasis> bytes to the next multiple of <emphasis remap='I'>b</emphasis>:</para> @@ -485,7 +485,7 @@ </para> <para> -In the following message descriptions, \*QExpected errors\*U indicates +In the following message descriptions, <quote>Expected errors</quote> indicates errors that may occur in the normal course of events. Other errors (in particular <function>BadMajor</function> @@ -1465,7 +1465,7 @@ <para> The major opcode specified was already registered. This is -fatal to the \*Qnew\*U protocol being set up by +fatal to the <quote>new</quote> protocol being set up by <function>ProtocolSetup</function> but it does not affect the existing registration. </para> Index: src/ICElibint.h =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/ICElibint.h,v retrieving revision 1.5 diff -u -r1.5 ICElibint.h --- src/ICElibint.h 12 Jul 2014 09:49:11 -0000 1.5 +++ src/ICElibint.h 14 Jul 2019 20:12:16 -0000 @@ -244,7 +244,7 @@ } - + /* * Byte swapping */ @@ -259,7 +259,7 @@ #define lswaps(_val) ((((_val) & 0xff) << 8) | (((_val) >> 8) & 0xff)) - + /* * ICE replies (not processed via callbacks because we block) */ @@ -334,28 +334,28 @@ * Extern declarations */ -extern IceConn _IceConnectionObjs[]; -extern char *_IceConnectionStrings[]; -extern int _IceConnectionCount; +extern IceConn _IceConnectionObjs[]; +extern char *_IceConnectionStrings[]; +extern int _IceConnectionCount; -extern _IceProtocol _IceProtocols[]; -extern int _IceLastMajorOpcode; +extern _IceProtocol _IceProtocols[]; +extern int _IceLastMajorOpcode; -extern int _IceAuthCount; -extern const char *_IceAuthNames[]; -extern IcePoAuthProc _IcePoAuthProcs[]; -extern IcePaAuthProc _IcePaAuthProcs[]; +extern int _IceAuthCount; +extern const char *_IceAuthNames[]; +extern IcePoAuthProc _IcePoAuthProcs[]; +extern IcePaAuthProc _IcePaAuthProcs[]; -extern int _IceVersionCount; -extern _IceVersion _IceVersions[]; +extern const int _IceVersionCount; +extern const _IceVersion _IceVersions[]; -extern _IceWatchProc *_IceWatchProcs; +extern _IceWatchProc *_IceWatchProcs; -extern IceErrorHandler _IceErrorHandler; -extern IceIOErrorHandler _IceIOErrorHandler; +extern IceErrorHandler _IceErrorHandler; +extern IceIOErrorHandler _IceIOErrorHandler; -extern IceAuthDataEntry _IcePaAuthDataEntries[]; -extern int _IcePaAuthDataEntryCount; +extern IceAuthDataEntry _IcePaAuthDataEntries[]; +extern int _IcePaAuthDataEntryCount; extern void _IceErrorBadMajor ( IceConn /* iceConn */, Index: src/Makefile.am =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/Makefile.am,v retrieving revision 1.4 diff -u -r1.4 Makefile.am --- src/Makefile.am 4 Mar 2012 18:57:09 -0000 1.4 +++ src/Makefile.am 14 Jul 2019 20:12:16 -0000 @@ -4,8 +4,7 @@ AM_CFLAGS = \ $(ICE_CFLAGS) \ - $(CWARNFLAGS) \ - -DICE_t -DTRANS_CLIENT -DTRANS_SERVER + $(CWARNFLAGS) libICE_la_LDFLAGS = -version-number 6:3:0 -no-undefined Index: src/Makefile.in =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/Makefile.in,v retrieving revision 1.10 diff -u -r1.10 Makefile.in --- src/Makefile.in 11 Oct 2016 22:15:19 -0000 1.10 +++ src/Makefile.in 14 Jul 2019 20:12:16 -0000 @@ -302,8 +302,7 @@ AM_CPPFLAGS = -I${top_srcdir}/include AM_CFLAGS = \ $(ICE_CFLAGS) \ - $(CWARNFLAGS) \ - -DICE_t -DTRANS_CLIENT -DTRANS_SERVER + $(CWARNFLAGS) libICE_la_LDFLAGS = -version-number 6:3:0 -no-undefined libICE_la_LIBADD = $(ICE_LIBS) Index: src/authutil.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/authutil.c,v retrieving revision 1.4 diff -u -r1.4 authutil.c --- src/authutil.c 12 Jul 2014 09:49:11 -0000 1.4 +++ src/authutil.c 14 Jul 2019 20:12:16 -0000 @@ -38,7 +38,6 @@ #include <limits.h> #include <time.h> -#define Time_t time_t #ifndef X_NOT_POSIX #include <unistd.h> #else @@ -57,7 +56,7 @@ static Status write_counted_string (FILE *file, unsigned short count, const char *string); - + /* * The following routines are for manipulating the .ICEauthority file * These are utility functions - they are not part of the standard @@ -67,7 +66,7 @@ char * IceAuthFileName (void) { - static char slashDotICEauthority[] = "/.ICEauthority"; + const char *ICEauthority_name = ".ICEauthority"; char *name; static char *buf; static size_t bsize; @@ -82,9 +81,14 @@ if ((name = getenv ("ICEAUTHORITY"))) return (name); - name = getenv ("HOME"); + /* If it's in the XDG_RUNTIME_DIR, don't use a dotfile */ + if ((name = getenv ("XDG_RUNTIME_DIR"))) + ICEauthority_name++; + + if (!name || !name[0]) + name = getenv ("HOME"); - if (!name) + if (!name || !name[0]) { #ifdef WIN32 register char *ptr1; @@ -102,31 +106,36 @@ snprintf (dir, sizeof(dir), "%s%s", ptr1, (ptr2) ? ptr2 : ""); name = dir; } - if (!name) + if (!name || !name[0]) #endif return (NULL); } - size = strlen (name) + strlen (&slashDotICEauthority[1]) + 2; + /* Special case for "/". We will add our own '/' later. */ + if (name[1] == '\0') + name++; + + size = strlen (name) + 1 + strlen (ICEauthority_name) + 1; if (size > bsize) { - if (buf) - free (buf); + + free (buf); buf = malloc (size); - if (!buf) + if (!buf) { + bsize = 0; return (NULL); + } bsize = size; } - snprintf (buf, bsize, "%s%s", name, - slashDotICEauthority + (name[1] == '\0' ? 1 : 0)); + snprintf (buf, bsize, "%s/%s", name, ICEauthority_name); return (buf); } - + int IceLockAuthFile ( const char *file_name, @@ -137,7 +146,7 @@ { char creat_name[1025], link_name[1025]; struct stat statb; - Time_t now; + time_t now; int creat_fd = -1; if ((int) strlen (file_name) > 1022) @@ -148,7 +157,7 @@ if (stat (creat_name, &statb) != -1) { - now = time ((Time_t *) 0); + now = time ((time_t *) 0); /* * NFS may cause ctime to be before now, special @@ -200,7 +209,7 @@ } - + void IceUnlockAuthFile ( const char *file_name @@ -223,7 +232,7 @@ } - + IceAuthFileEntry * IceReadAuthFileEntry ( FILE *auth_file @@ -264,17 +273,17 @@ bad: - if (local.protocol_name) free (local.protocol_name); - if (local.protocol_data) free (local.protocol_data); - if (local.network_id) free (local.network_id); - if (local.auth_name) free (local.auth_name); - if (local.auth_data) free (local.auth_data); + free (local.protocol_name); + free (local.protocol_data); + free (local.network_id); + free (local.auth_name); + free (local.auth_data); return (NULL); } - + void IceFreeAuthFileEntry ( IceAuthFileEntry *auth @@ -282,17 +291,17 @@ { if (auth) { - if (auth->protocol_name) free (auth->protocol_name); - if (auth->protocol_data) free (auth->protocol_data); - if (auth->network_id) free (auth->network_id); - if (auth->auth_name) free (auth->auth_name); - if (auth->auth_data) free (auth->auth_data); + free (auth->protocol_name); + free (auth->protocol_data); + free (auth->network_id); + free (auth->auth_name); + free (auth->auth_data); free (auth); } } - + Status IceWriteAuthFileEntry ( FILE *auth_file, @@ -320,7 +329,7 @@ } - + IceAuthFileEntry * IceGetAuthFileEntry ( const char *protocol_name, @@ -362,7 +371,7 @@ } - + /* * local routines */ Index: src/connect.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/connect.c,v retrieving revision 1.4 diff -u -r1.4 connect.c --- src/connect.c 12 Jul 2014 09:49:11 -0000 1.4 +++ src/connect.c 14 Jul 2019 20:12:16 -0000 @@ -37,8 +37,6 @@ static XtransConnInfo ConnectToPeer(char *networkIdsList, char **actualConnectionRet); -#define Strstr strstr - IceConn IceOpenConnection ( char *networkIdsList, @@ -68,8 +66,11 @@ if (networkIdsList == NULL || *networkIdsList == '\0') { - strncpy (errorStringRet, - "networkIdsList argument is NULL", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, + "networkIdsList argument is NULL", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } return (NULL); } @@ -93,7 +94,7 @@ for (i = 0; i < _IceConnectionCount; i++) { char *strptr; - if ((strptr = (char *) Strstr ( + if ((strptr = (char *) strstr ( networkIdsList, _IceConnectionStrings[i])) != NULL) { char ch = *(strptr + strlen (_IceConnectionStrings[i])); @@ -146,7 +147,10 @@ if ((iceConn = malloc (sizeof (struct _IceConn))) == NULL) { - strncpy (errorStringRet, "Can't malloc", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, "Can't malloc", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } return (NULL); } @@ -159,7 +163,10 @@ &iceConn->connection_string)) == NULL) { free (iceConn); - strncpy (errorStringRet, "Could not open network socket", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, "Could not open network socket", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } return (NULL); } @@ -197,7 +204,10 @@ if ((iceConn->inbuf = iceConn->inbufptr = malloc (ICE_INBUFSIZE)) == NULL) { _IceFreeConnection (iceConn); - strncpy (errorStringRet, "Can't malloc", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, "Can't malloc", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } return (NULL); } @@ -206,7 +216,10 @@ if ((iceConn->outbuf = iceConn->outbufptr = calloc (1, ICE_OUTBUFSIZE)) == NULL) { _IceFreeConnection (iceConn); - strncpy (errorStringRet, "Can't malloc", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, "Can't malloc", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } return (NULL); } @@ -223,6 +236,15 @@ iceConn->ping_waits = NULL; iceConn->connect_to_you = malloc (sizeof (_IceConnectToYouInfo)); + if (iceConn->connect_to_you == NULL) + { + _IceFreeConnection (iceConn); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, "Can't malloc", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } + return (NULL); + } iceConn->connect_to_you->auth_active = 0; /* @@ -259,8 +281,11 @@ if (ioErrorOccured) { _IceFreeConnection (iceConn); - strncpy (errorStringRet, "IO error occured opening connection", - errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, "IO error occured opening connection", + errorLength); + errorStringRet[errorLength - 1] = '\0'; + } return (NULL); } @@ -271,9 +296,12 @@ */ _IceFreeConnection (iceConn); - strncpy (errorStringRet, - "Internal error - did not receive the expected ByteOrder message", - errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, + "Internal error - did not receive the expected ByteOrder " + "message", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } return (NULL); } @@ -357,8 +385,11 @@ if (ioErrorOccured) { - strncpy (errorStringRet, "IO error occured opening connection", - errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, "IO error occured opening connection", + errorLength); + errorStringRet[errorLength - 1] = '\0'; + } _IceFreeConnection (iceConn); iceConn = NULL; } @@ -368,9 +399,12 @@ { if (reply.connection_reply.version_index >= _IceVersionCount) { - strncpy (errorStringRet, - "Got a bad version index in the Connection Reply", - errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, + "Got a bad version index in the Connection Reply", + errorLength); + errorStringRet[errorLength - 1] = '\0'; + } free (reply.connection_reply.vendor); free (reply.connection_reply.release); @@ -399,8 +433,11 @@ { /* Connection failed */ - strncpy (errorStringRet, reply.connection_error.error_message, - errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, + reply.connection_error.error_message, errorLength); + errorStringRet[errorLength - 1] = '\0'; + } free (reply.connection_error.error_message); @@ -423,7 +460,7 @@ } - + IcePointer IceGetConnectionContext ( IceConn iceConn @@ -433,7 +470,7 @@ } - + /* ------------------------------------------------------------------------- * * local routines * * ------------------------------------------------------------------------- */ Index: src/error.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/error.c,v retrieving revision 1.3 diff -u -r1.3 error.c --- src/error.c 4 Mar 2012 18:57:09 -0000 1.3 +++ src/error.c 14 Jul 2019 20:12:16 -0000 @@ -32,10 +32,9 @@ #include <X11/ICE/ICElib.h> #include "ICElibint.h" #include <stdio.h> - +#include <unistd.h> #include <errno.h> - void _IceErrorBadMinor ( IceConn iceConn, @@ -348,7 +347,7 @@ } - + /* * Default error handler. */ @@ -563,7 +562,7 @@ IceErrorHandler _IceErrorHandler = _IceDefaultErrorHandler; - + /* * This procedure sets the ICE error handler to be the specified * routine. If NULL is passed in the default error handler is restored. @@ -586,7 +585,7 @@ } - + /* * Default IO error handler. */ @@ -605,7 +604,7 @@ IceIOErrorHandler _IceIOErrorHandler = _IceDefaultIOErrorHandler; - + /* * This procedure sets the ICE fatal I/O error handler to be the * specified routine. If NULL is passed in the default error Index: src/getauth.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/getauth.c,v retrieving revision 1.5 diff -u -r1.5 getauth.c --- src/getauth.c 12 Jul 2014 09:49:11 -0000 1.5 +++ src/getauth.c 14 Jul 2019 20:12:16 -0000 @@ -35,7 +35,7 @@ static Bool auth_valid (const char *auth_name, int num_auth_names, const char **auth_names, int *index_ret); - + /* * The functions in this file are not a standard part of ICElib. * @@ -83,7 +83,7 @@ } - + void _IceGetPaAuthData ( const char *protocolName, @@ -122,7 +122,7 @@ } - + void _IceGetPoValidAuthIndices ( const char *protocol_name, @@ -181,7 +181,7 @@ } - + void _IceGetPaValidAuthIndices ( const char *protocol_name, @@ -225,7 +225,7 @@ } - + /* * local routines */ Index: src/iceauth.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/iceauth.c,v retrieving revision 1.5 diff -u -r1.5 iceauth.c --- src/iceauth.c 12 Jul 2014 09:49:11 -0000 1.5 +++ src/iceauth.c 14 Jul 2019 20:12:16 -0000 @@ -34,39 +34,28 @@ #include <X11/ICE/ICEutil.h> #include <time.h> -#define Time_t time_t #ifdef HAVE_LIBBSD #include <bsd/stdlib.h> /* for arc4random_buf() */ #endif +#include <unistd.h> + static int was_called_state; -/* - * MIT-MAGIC-COOKIE-1 is a sample authentication method implemented by - * the SI. It is not part of standard ICElib. - */ +#ifndef HAVE_ARC4RANDOM_BUF - -char * -IceGenerateMagicCookie ( +static void +emulate_getrandom_buf ( + char *auth, int len ) { - char *auth; -#ifndef HAVE_ARC4RANDOM_BUF long ldata[2]; int seed; int value; int i; -#endif - if ((auth = malloc (len + 1)) == NULL) - return (NULL); - -#ifdef HAVE_ARC4RANDOM_BUF - arc4random_buf(auth, len); -#else #ifdef ITIMER_REAL { struct timeval now; @@ -74,13 +63,13 @@ ldata[0] = now.tv_sec; ldata[1] = now.tv_usec; } -#else +#else /* ITIMER_REAL */ { long time (); ldata[0] = time ((long *) 0); ldata[1] = getpid (); } -#endif +#endif /* ITIMER_REAL */ seed = (ldata[0]) + (ldata[1] << 16); srand (seed); for (i = 0; i < len; i++) @@ -88,13 +77,52 @@ value = rand (); auth[i] = value & 0xff; } -#endif +} + +static void +arc4random_buf ( + char *auth, + int len +) +{ +#if HAVE_GETENTROPY + int ret; + + /* weak emulation of arc4random through the entropy libc */ + ret = getentropy (auth, len); + if (ret == 0) + return; +#endif /* HAVE_GETENTROPY */ + + emulate_getrandom_buf (auth, len); +} + +#endif /* !defined(HAVE_ARC4RANDOM_BUF) */ + +/* + * MIT-MAGIC-COOKIE-1 is a sample authentication method implemented by + * the SI. It is not part of standard ICElib. + */ + + +char * +IceGenerateMagicCookie ( + int len +) +{ + char *auth; + + if ((auth = malloc (len + 1)) == NULL) + return (NULL); + + arc4random_buf (auth, len); + auth[len] = '\0'; return (auth); } - + IcePoAuthStatus _IcePoMagicCookie1Proc ( IceConn iceConn, Index: src/icetrans.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/icetrans.c,v retrieving revision 1.2 diff -u -r1.2 icetrans.c --- src/icetrans.c 9 Apr 2009 20:29:45 -0000 1.2 +++ src/icetrans.c 14 Jul 2019 20:12:16 -0000 @@ -24,8 +24,4 @@ #include <config.h> #endif -#define ICE_t 1 -#define TRANS_CLIENT 1 -#define TRANS_SERVER 1 - #include <X11/Xtrans/transport.c> Index: src/listen.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/listen.c,v retrieving revision 1.4 diff -u -r1.4 listen.c --- src/listen.c 12 Jul 2014 09:49:11 -0000 1.4 +++ src/listen.c 14 Jul 2019 20:12:16 -0000 @@ -34,7 +34,7 @@ #include <X11/Xtrans/Xtrans.h> #include <stdio.h> - + Status IceListenForConnections ( int *countRet, @@ -56,8 +56,11 @@ *listenObjsRet = NULL; *countRet = 0; - strncpy (errorStringRet, - "Cannot establish any listening sockets", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, + "Cannot establish any listening sockets", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } return (0); } @@ -91,8 +94,11 @@ { *listenObjsRet = NULL; - strncpy (errorStringRet, - "Cannot establish any listening sockets", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, + "Cannot establish any listening sockets", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } status = 0; } @@ -102,7 +108,10 @@ if (*listenObjsRet == NULL) { - strncpy (errorStringRet, "Malloc failed", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, "Malloc failed", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } status = 0; } @@ -114,7 +123,10 @@ if ((*listenObjsRet)[i] == NULL) { - strncpy (errorStringRet, "Malloc failed", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, "Malloc failed", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } for (j = 0; j < i; j++) free ((*listenObjsRet)[j]); @@ -156,7 +168,7 @@ } - + int IceGetListenConnectionNumber ( IceListenObj listenObj @@ -166,7 +178,7 @@ } - + char * IceGetListenConnectionString ( IceListenObj listenObj @@ -176,7 +188,7 @@ } - + char * IceComposeNetworkIdList ( int count, @@ -233,7 +245,7 @@ } - + void IceFreeListenObjs ( int count, @@ -253,7 +265,7 @@ } - + /* * Allow host based authentication for the ICE Connection Setup. * Do not confuse with the host based authentication callbacks that Index: src/listenwk.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/listenwk.c,v retrieving revision 1.4 diff -u -r1.4 listenwk.c --- src/listenwk.c 12 Jul 2014 09:49:11 -0000 1.4 +++ src/listenwk.c 14 Jul 2019 20:12:16 -0000 @@ -35,7 +35,7 @@ #include <X11/Xtrans/Xtrans.h> #include <stdio.h> - + Status IceListenForWellKnownConnections ( char *port, @@ -58,9 +58,13 @@ *listenObjsRet = NULL; *countRet = 0; - strncpy (errorStringRet, - "Cannot establish any listening sockets", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, + "Cannot establish any listening sockets", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } + free (transConns); return (0); } @@ -91,8 +95,11 @@ { *listenObjsRet = NULL; - strncpy (errorStringRet, - "Cannot establish any listening sockets", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, + "Cannot establish any listening sockets", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } status = 0; } @@ -102,7 +109,10 @@ if (*listenObjsRet == NULL) { - strncpy (errorStringRet, "Malloc failed", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, "Malloc failed", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } status = 0; } @@ -114,7 +124,10 @@ if ((*listenObjsRet)[i] == NULL) { - strncpy (errorStringRet, "Malloc failed", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, "Malloc failed", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } for (j = 0; j < i; j++) free ((*listenObjsRet)[j]); Index: src/misc.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/misc.c,v retrieving revision 1.4 diff -u -r1.4 misc.c --- src/misc.c 12 Jul 2014 09:49:11 -0000 1.4 +++ src/misc.c 14 Jul 2019 20:12:16 -0000 @@ -41,7 +41,7 @@ #include <X11/Xw32defs.h> #endif - + /* * scratch buffer */ @@ -54,8 +54,7 @@ { if (!iceConn->scratch || size > iceConn->scratch_size) { - if (iceConn->scratch) - free (iceConn->scratch); + free (iceConn->scratch); iceConn->scratch = malloc (size); iceConn->scratch_size = size; @@ -65,7 +64,7 @@ } - + /* * Output/Input buffer functions */ @@ -102,7 +101,7 @@ } - + /* * informational functions */ @@ -202,7 +201,7 @@ } - + /* * Read "n" bytes from a connection. * @@ -242,7 +241,6 @@ */ _IceConnectionClosed (iceConn); /* invoke watch procs */ - _IceFreeConnection (iceConn); return (0); } @@ -302,7 +300,7 @@ } - + /* * If we read a message header with a bad major or minor opcode, * we need to advance to the end of the message. This way, the next @@ -327,7 +325,7 @@ } - + /* * Write "n" bytes to a connection. */ @@ -407,7 +405,7 @@ } - + void _IceAddOpcodeMapping ( IceConn iceConn, @@ -489,14 +487,14 @@ } - + char * IceGetPeerName (IceConn iceConn) { return (_IceTransGetPeerNetworkId (iceConn->trans_conn)); } - + char * _IceGetPeerName (IceConn iceConn) { Index: src/process.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/process.c,v retrieving revision 1.4 diff -u -r1.4 process.c --- src/process.c 12 Jul 2014 09:49:11 -0000 1.4 +++ src/process.c 14 Jul 2019 20:12:16 -0000 @@ -111,7 +111,7 @@ } #endif - + /* * IceProcessMessages: * @@ -430,7 +430,7 @@ } - + static void AuthRequired ( IceConn iceConn, @@ -457,7 +457,7 @@ } - + static void AuthReply ( IceConn iceConn, @@ -482,7 +482,7 @@ } - + static void AuthNextPhase ( IceConn iceConn, @@ -507,7 +507,7 @@ } - + static void AcceptConnection ( IceConn iceConn, @@ -535,7 +535,7 @@ } - + static void AcceptProtocol ( IceConn iceConn, @@ -575,7 +575,7 @@ } - + static void PingReply ( IceConn iceConn @@ -586,7 +586,7 @@ } - + static Bool ProcessError ( IceConn iceConn, @@ -704,6 +704,11 @@ invokeHandler = 1; } + if (!errorStr) + { + errorStr = strdup(""); + } + errorReply->type = ICE_CONNECTION_ERROR; errorReply->error_message = errorStr; } @@ -715,7 +720,7 @@ { _IceProtocolError *errorReply = &(((_IceReply *) (replyWait->reply))->protocol_error); - char *errorStr = ""; + char *errorStr = NULL; const char *prefix; char *temp; @@ -794,6 +799,11 @@ invokeHandler = 1; } + if (!errorStr) + { + errorStr = strdup(""); + } + errorReply->type = ICE_PROTOCOL_ERROR; errorReply->error_message = errorStr; } @@ -847,7 +857,7 @@ } - + static int ProcessConnectionSetup ( IceConn iceConn, @@ -856,7 +866,8 @@ ) { iceConnectionSetupMsg *message; - int myVersionCount, hisVersionCount; + const int myVersionCount = _IceVersionCount; + int hisVersionCount; int myVersionIndex, hisVersionIndex; int hisMajorVersion, hisMinorVersion; int myAuthCount, hisAuthCount; @@ -919,14 +930,14 @@ EXTRACT_STRING (pData, swap, vendor); EXTRACT_STRING (pData, swap, release); - if ((hisAuthCount = message->authCount) > 0) + hisAuthCount = message->authCount; + if (hisAuthCount > 0) { hisAuthNames = malloc (hisAuthCount * sizeof (char *)); EXTRACT_LISTOF_STRING (pData, swap, hisAuthCount, hisAuthNames); } hisVersionCount = message->versionCount; - myVersionCount = _IceVersionCount; hisVersionIndex = myVersionIndex = found = 0; @@ -1026,8 +1037,7 @@ iceConn->connection_status = IceConnectRejected; } - if (hostname) - free (hostname); + free (hostname); } if (iceConn->connection_status == IceConnectRejected) @@ -1080,8 +1090,7 @@ if (authData && authDataLen > 0) free (authData); - if (errorString) - free (errorString); + free (errorString); } if (accept_setup_now) @@ -1106,7 +1115,7 @@ } - + static Bool ProcessAuthRequired ( IceConn iceConn, @@ -1270,7 +1279,7 @@ } if (asprintf (&returnErrorString, "%s%s", prefix, errorString) == -1) - returnErrorString = NULL; + returnErrorString = strdup(""); free (errorString); if (iceConn->connect_to_you) @@ -1300,7 +1309,7 @@ } - + static int ProcessAuthReply ( IceConn iceConn, @@ -1369,8 +1378,7 @@ status = IcePaAuthAccepted; } - if (hostname) - free (hostname); + free (hostname); } if (status != IcePaAuthAccepted) @@ -1444,8 +1452,7 @@ status = IcePaAuthAccepted; } - if (hostname) - free (hostname); + free (hostname); } if (status == IcePaAuthRejected) @@ -1559,18 +1566,15 @@ _IceErrorSetupFailed (iceConn, ICE_ProtocolSetup, failureReason); - if (failureReason) - free (failureReason); + free (failureReason); } } if (free_setup_info) { - if (iceConn->protosetup_to_me->his_vendor) - free (iceConn->protosetup_to_me->his_vendor); - if (iceConn->protosetup_to_me->his_release) - free (iceConn->protosetup_to_me->his_release); + free (iceConn->protosetup_to_me->his_vendor); + free (iceConn->protosetup_to_me->his_release); free (iceConn->protosetup_to_me); iceConn->protosetup_to_me = NULL; } @@ -1587,15 +1591,15 @@ if (authData && authDataLen > 0) free (authData); - if (errorString) - free (errorString); + + free (errorString); IceDisposeCompleteMessage (iceConn, replyData); return (0); } - + static Bool ProcessAuthNextPhase ( IceConn iceConn, @@ -1697,7 +1701,7 @@ } if (asprintf (&returnErrorString, "%s%s", prefix, errorString) == -1) - returnErrorString = NULL; + returnErrorString = strdup(""); free (errorString); if (iceConn->connect_to_you) @@ -1727,7 +1731,7 @@ } - + static Bool ProcessConnectionReply ( IceConn iceConn, @@ -1797,7 +1801,7 @@ errorReply->type = ICE_CONNECTION_ERROR; errorReply->error_message = - "Received bad version index in Connection Reply"; + strdup("Received bad version index in Connection Reply"); } else { @@ -1829,7 +1833,7 @@ } - + static int ProcessProtocolSetup ( IceConn iceConn, @@ -1965,7 +1969,8 @@ EXTRACT_STRING (pData, swap, vendor); EXTRACT_STRING (pData, swap, release); - if ((hisAuthCount = message->authCount) > 0) + hisAuthCount = message->authCount; + if (hisAuthCount > 0) { hisAuthNames = malloc (hisAuthCount * sizeof (char *)); EXTRACT_LISTOF_STRING (pData, swap, hisAuthCount, hisAuthNames); @@ -2071,8 +2076,7 @@ ICE_ProtocolSetup, "None of the authentication protocols specified are supported and host-based authentication failed"); } - if (hostname) - free (hostname); + free (hostname); } } else @@ -2118,8 +2122,8 @@ if (authData && authDataLen > 0) free (authData); - if (errorString) - free (errorString); + + free (errorString); } if (accept_setup_now) @@ -2202,16 +2206,13 @@ _IceErrorSetupFailed (iceConn, ICE_ProtocolSetup, failureReason); - if (failureReason) - free (failureReason); + free (failureReason); } } - if (vendor) - free (vendor); - if (release) - free (release); + free (vendor); + free (release); if (hisAuthCount > 0) { @@ -2226,7 +2227,7 @@ } - + static Bool ProcessProtocolReply ( IceConn iceConn, @@ -2300,7 +2301,7 @@ errorReply->type = ICE_PROTOCOL_ERROR; errorReply->error_message = - "Received bad version index in Protocol Reply"; + strdup("Received bad version index in Protocol Reply"); } else { @@ -2330,7 +2331,7 @@ } - + static int ProcessPing ( IceConn iceConn, @@ -2346,7 +2347,7 @@ } - + static int ProcessPingReply ( IceConn iceConn, @@ -2375,7 +2376,7 @@ } - + static int ProcessWantToClose ( IceConn iceConn, @@ -2434,7 +2435,7 @@ } - + static int ProcessNoClose ( IceConn iceConn, @@ -2462,7 +2463,7 @@ } - + static void _IceProcessCoreMessage ( IceConn iceConn, @@ -2551,7 +2552,7 @@ *replyReadyRet = replyReady; } -int _IceVersionCount = 1; -_IceVersion _IceVersions[] = { - {IceProtoMajor, IceProtoMinor, _IceProcessCoreMessage}}; +const int _IceVersionCount = 1; +const _IceVersion _IceVersions[] = { + {IceProtoMajor, IceProtoMinor, _IceProcessCoreMessage}}; Index: src/protosetup.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/protosetup.c,v retrieving revision 1.4 diff -u -r1.4 protosetup.c --- src/protosetup.c 12 Jul 2014 09:49:11 -0000 1.4 +++ src/protosetup.c 14 Jul 2019 20:12:16 -0000 @@ -71,7 +71,10 @@ if (myOpcode < 1 || myOpcode > _IceLastMajorOpcode) { - strncpy (errorStringRet, "myOpcode out of range", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, "myOpcode out of range", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } return (IceProtocolSetupFailure); } @@ -79,8 +82,11 @@ if (myProtocol->orig_client == NULL) { - strncpy (errorStringRet, - "IceRegisterForProtocolSetup was not called", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, + "IceRegisterForProtocolSetup was not called", errorLength); + errorStringRet[errorLength - 1] = '\0'; + } return (IceProtocolSetupFailure); } @@ -198,9 +204,12 @@ if (ioErrorOccured) { - strncpy (errorStringRet, - "IO error occured doing Protocol Setup on connection", - errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, + "IO error occured doing Protocol Setup on connection", + errorLength); + errorStringRet[errorLength - 1] = '\0'; + } return (IceProtocolSetupIOError); } else if (gotReply) @@ -210,9 +219,12 @@ if (reply.protocol_reply.version_index >= myProtocol->orig_client->version_count) { - strncpy (errorStringRet, - "Got a bad version index in the Protocol Reply", - errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, + "Got a bad version index in the Protocol Reply", + errorLength); + errorStringRet[errorLength - 1] = '\0'; + } free (reply.protocol_reply.vendor); free (reply.protocol_reply.release); @@ -229,8 +241,11 @@ { /* Protocol Setup failed */ - strncpy (errorStringRet, reply.protocol_error.error_message, - errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, reply.protocol_error.error_message, + errorLength); + errorStringRet[errorLength - 1] = '\0'; + } free (reply.protocol_error.error_message); } Index: src/register.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/register.c,v retrieving revision 1.4 diff -u -r1.4 register.c --- src/register.c 12 Jul 2014 09:49:11 -0000 1.4 +++ src/register.c 14 Jul 2019 20:12:16 -0000 @@ -122,7 +122,7 @@ } - + int IceRegisterForProtocolReply ( const char *protocolName, Index: src/replywait.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/replywait.c,v retrieving revision 1.4 diff -u -r1.4 replywait.c --- src/replywait.c 12 Jul 2014 09:49:11 -0000 1.4 +++ src/replywait.c 14 Jul 2019 20:12:16 -0000 @@ -72,7 +72,7 @@ } - + IceReplyWaitInfo * _IceSearchReplyWaits ( IceConn iceConn, @@ -95,7 +95,7 @@ } - + void _IceSetReplyReady ( IceConn iceConn, @@ -116,7 +116,7 @@ } - + Bool _IceCheckReplyReady ( IceConn iceConn, Index: src/setauth.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/setauth.c,v retrieving revision 1.4 diff -u -r1.4 setauth.c --- src/setauth.c 12 Jul 2014 09:49:11 -0000 1.4 +++ src/setauth.c 14 Jul 2019 20:12:16 -0000 @@ -33,7 +33,7 @@ #include "ICElibint.h" #include <X11/ICE/ICEutil.h> - + /* * IceSetPaAuthData is not a standard part of ICElib, it is specific * to the sample implementation. Index: src/shutdown.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/shutdown.c,v retrieving revision 1.4 diff -u -r1.4 shutdown.c --- src/shutdown.c 12 Jul 2014 09:49:11 -0000 1.4 +++ src/shutdown.c 14 Jul 2019 20:12:16 -0000 @@ -40,49 +40,41 @@ int majorOpcode ) { + int i; + if (iceConn->proto_ref_count == 0 || iceConn->process_msg_info == NULL || majorOpcode < 1 || majorOpcode > _IceLastMajorOpcode) { return (0); } - else - { - /* - * Make sure this majorOpcode is really being used. - */ - int i; - for (i = iceConn->his_min_opcode; i <= iceConn->his_max_opcode; i++) - { - if (iceConn->process_msg_info[ - i - iceConn->his_min_opcode].in_use && - iceConn->process_msg_info[ - i - iceConn->his_min_opcode].my_opcode == majorOpcode) - break; - } + /* + * Make sure this majorOpcode is really being used. + */ - if (i > iceConn->his_max_opcode) - { - return (0); - } - else + for (i = iceConn->his_min_opcode; i <= iceConn->his_max_opcode; i++) + { + int n = i - iceConn->his_min_opcode; + if (iceConn->process_msg_info[n].in_use && + iceConn->process_msg_info[n].my_opcode == majorOpcode) { + /* * OK, we can shut down the protocol. */ - iceConn->process_msg_info[ - i - iceConn->his_min_opcode].in_use = False; + iceConn->process_msg_info[n].in_use = False; iceConn->proto_ref_count--; - return (1); } } + + return (0); } - + void IceSetShutdownNegotiation ( IceConn iceConn, @@ -93,7 +85,7 @@ } - + Bool IceCheckShutdownNegotiation ( IceConn iceConn @@ -103,7 +95,7 @@ } - + IceCloseStatus IceCloseConnection ( IceConn iceConn @@ -245,7 +237,7 @@ } - + void _IceFreeConnection ( IceConn iceConn @@ -282,39 +274,17 @@ if (iceConn->trans_conn) _IceTransClose (iceConn->trans_conn); - if (iceConn->connection_string) - free (iceConn->connection_string); - - if (iceConn->vendor) - free (iceConn->vendor); - - if (iceConn->release) - free (iceConn->release); - - if (iceConn->inbuf) - free (iceConn->inbuf); - - if (iceConn->outbuf) - free (iceConn->outbuf); - - if (iceConn->scratch) - free (iceConn->scratch); - - if (iceConn->process_msg_info) - free (iceConn->process_msg_info); - - if (iceConn->connect_to_you) - free (iceConn->connect_to_you); - - if (iceConn->protosetup_to_you) - free (iceConn->protosetup_to_you); - - if (iceConn->connect_to_me) - free (iceConn->connect_to_me); - - if (iceConn->protosetup_to_me) - free (iceConn->protosetup_to_me); - + free (iceConn->connection_string); + free (iceConn->vendor); + free (iceConn->release); + free (iceConn->inbuf); + free (iceConn->outbuf); + free (iceConn->scratch); + free (iceConn->process_msg_info); + free (iceConn->connect_to_you); + free (iceConn->protosetup_to_you); + free (iceConn->connect_to_me); + free (iceConn->protosetup_to_me); free (iceConn); } Index: src/watch.c =================================================================== RCS file: /cvs/OpenBSD/xenocara/lib/libICE/src/watch.c,v retrieving revision 1.4 diff -u -r1.4 watch.c --- src/watch.c 12 Jul 2014 09:49:11 -0000 1.4 +++ src/watch.c 14 Jul 2019 20:12:16 -0000 @@ -89,7 +89,7 @@ } - + void IceRemoveConnectionWatch ( IceWatchProc watchProc, @@ -129,7 +129,7 @@ } - + void _IceConnectionOpened ( IceConn iceConn @@ -163,7 +163,7 @@ } - + void _IceConnectionClosed ( IceConn iceConn -- Matthieu Herrb