[Xcb-commit] libxcb: 7 commits - configure.ac NEWS src

Uli Schlachter psychon at kemper.freedesktop.org
Sat Dec 21 05:47:57 PST 2013


 NEWS            |   39 ++++++++++++++++++++++++++++++++++++++-
 configure.ac    |    2 +-
 src/Makefile.am |    6 +++---
 src/c_client.py |    4 ++--
 src/xcb.h       |   20 ++++++++++++++++++++
 src/xcb_in.c    |   12 +++++++-----
 6 files changed, 71 insertions(+), 12 deletions(-)

New commits:
commit f653464554469b5767f1c99abced25a76bace047
Author: Julien Cristau <jcristau at debian.org>
Date:   Sat Dec 14 06:16:37 2013 +0100

    Add NEWS for 1.10
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>

diff --git a/NEWS b/NEWS
index 70bc3ba..d0198f5 100644
--- a/NEWS
+++ b/NEWS
@@ -1,12 +1,27 @@
+Release 1.10 (2013-12-XX)
+=========================
+* Bump libxcb-xkb SONAME due to ABI break introduced in 1.9.2
+* Enable libxcb-xkb by default
+* Bump libxcb-sync SONAME
+* c_client.py: Fix _sizeof() functions
+* c_client.py: Do not create pointers in unions
+* c_client.py: Always initialize xcb_align_to
+* Re-introduce xcb_ge_event_t (deprecated, xcb_ge_generic_event_t should be
+  used instead)
+* Fix alignment issues in FD passing code
+* Fix poll() if POLLIN == ROLLRDNORM|POLLRDBAND
+* Use /usr/spool/sockets/X11/ on HP-UX for UNIX sockets
+* Make xsltproc optional
+
 Release 1.9.3 (2013-11-07)
-========================
+==========================
 * Check if we need to define _XOPEN_SOURCE for struct msghdr.msg_control
 * Add configure option to enable or disable fd passing with sendmsg
 * Switch to using the CMSG_* macros for FD passing
 * Initialize automake earlier (bugfix for #66413)
 
 Release 1.9.2 (2013-11-07)
-========================
+==========================
 * Add Present extension
 * Add DRI3 library
 * Add event queue splitting
@@ -17,7 +32,7 @@ Release 1.9.2 (2013-11-07)
 * c_client.py: Handle multiple expr. in a bitcase
 
 Release 1.9.1 (2013-05-30)
-========================
+==========================
 * Fix python code to work with python-3
 * Security fix for integer overflow in read_packet() [CVE-2013-2064]
 
commit 9c2a6dc20c64ce93e0acd2fceec6d3cab8fc9134
Author: Uli Schlachter <psychon at znc.in>
Date:   Fri Nov 15 22:33:12 2013 +0100

    Add NEWS entries for releases 1.9.1 to 1.9.3
    
    libxcb 1.9.1 was released from a branch and thus its NEWS entries never made it
    into the master branch. The other releases didn't update NEWS.
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>
    Signed-off-by: Julien Cristau <jcristau at debian.org>

diff --git a/NEWS b/NEWS
index 533d72b..70bc3ba 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,28 @@
-Release 1.9 (2012-10-05)
+Release 1.9.3 (2013-11-07)
+========================
+* Check if we need to define _XOPEN_SOURCE for struct msghdr.msg_control
+* Add configure option to enable or disable fd passing with sendmsg
+* Switch to using the CMSG_* macros for FD passing
+* Initialize automake earlier (bugfix for #66413)
+
+Release 1.9.2 (2013-11-07)
 ========================
+* Add Present extension
+* Add DRI3 library
+* Add event queue splitting
+* Add support for receiving fds in replies
+* Add xcb_send_fd API
+* Remove xcb_ge_event_t from xcb.h
+* c_client.py: Inject full_sequence into GE events
+* c_client.py: Handle multiple expr. in a bitcase
+
+Release 1.9.1 (2013-05-30)
+========================
+* Fix python code to work with python-3
+* Security fix for integer overflow in read_packet() [CVE-2013-2064]
 
+Release 1.9 (2012-10-05)
+========================
 * Always include "config.h" at the start of all C source files.
 * Add AC_USE_SYSTEM_EXTENSIONS to allow use of more system functionality
 * Return connection failure if display string specifies non-existent screen
commit ea4406a8e0193cad8effe569e7835f8b67894e54
Author: Julien Cristau <jcristau at debian.org>
Date:   Sat Dec 14 05:54:20 2013 +0100

    Bump xcb-proto requirement to 1.10
    
    Makes sure we generate the new generic event struct.
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>

diff --git a/configure.ac b/configure.ac
index 87804ba..294bd1a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,7 +41,7 @@ fi
 AC_SUBST(HTML_CHECK_RESULT)
 
 # Checks for pkg-config packages
-PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 1.9)
+PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 1.10)
 NEEDED="pthread-stubs xau >= 0.99.2"
 PKG_CHECK_MODULES(NEEDED, $NEEDED)
 
commit a1299eb2a210b5788a2b827b82a3d825caa1f201
Author: PHO <pho at cielonegro.org>
Date:   Tue Dec 3 12:43:04 2013 +0900

    Test the value of msg_controllen for platforms whose CMSG_FIRSTHDR() does not test it for us
    
    As RFC 2292 points out, some platforms (e.g. Darwin 9.8.0) provide
    CMSG_FIRSTHDR(msg) which just returns msg.msg_control without first
    checking if msg.msg_controllen is non-zero. We need a workaround for
    such platforms not to let _xcb_in_read() segfault.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=72253
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>

diff --git a/src/xcb_in.c b/src/xcb_in.c
index fd6c2ef..95087be 100644
--- a/src/xcb_in.c
+++ b/src/xcb_in.c
@@ -918,11 +918,13 @@ int _xcb_in_read(xcb_connection_t *c)
 #if HAVE_SENDMSG
         struct cmsghdr *hdr;
 
-        for (hdr = CMSG_FIRSTHDR(&msg); hdr; hdr = CMSG_NXTHDR(&msg, hdr)) {
-            if (hdr->cmsg_level == SOL_SOCKET && hdr->cmsg_type == SCM_RIGHTS) {
-                int nfd = (hdr->cmsg_len - CMSG_LEN(0)) / sizeof (int);
-                memcpy(&c->in.in_fd.fd[c->in.in_fd.nfd], CMSG_DATA(hdr), nfd * sizeof (int));
-                c->in.in_fd.nfd += nfd;
+        if (msg.msg_controllen >= sizeof (struct cmsghdr)) {
+            for (hdr = CMSG_FIRSTHDR(&msg); hdr; hdr = CMSG_NXTHDR(&msg, hdr)) {
+                if (hdr->cmsg_level == SOL_SOCKET && hdr->cmsg_type == SCM_RIGHTS) {
+                    int nfd = (hdr->cmsg_len - CMSG_LEN(0)) / sizeof (int);
+                    memcpy(&c->in.in_fd.fd[c->in.in_fd.nfd], CMSG_DATA(hdr), nfd * sizeof (int));
+                    c->in.in_fd.nfd += nfd;
+                }
             }
         }
 #endif
commit b30b11ac49d934541312b03c41d1ab83047a59f4
Author: Uli Schlachter <psychon at znc.in>
Date:   Mon Nov 18 20:28:08 2013 +0100

    Increment the "current" version info for sync, xinput and xkb
    
    Sync: Due to commit e6a246e50e62cbcba3 "sync: Change value list param of
    CreateAlarm and ChangeAlarm into switch", various symbols disappeared,
    for example xcb_sync_{change,create}_alarm_sizeof.
    
    xinput: This extension was updated from version 1.4 to 2.3. This means
    that lots of new things are generated. However, this change is
    backwards-compatible and thus age gets set to 1.
    
    xkb: In commit 37d0f55392d6 "xkb: Work around alignment problems in
    GetNames and GetMap replies", some padding fields were introduced into
    structures for which an _unpack() function is generated. This changed
    the size of the struct and caused offsets into this struct to change.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=71507
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>
    Signed-off-by: Julien Cristau <jcristau at debian.org>

diff --git a/src/Makefile.am b/src/Makefile.am
index 346ee03..f2875dd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -139,7 +139,7 @@ endif
 EXTSOURCES += sync.c
 if BUILD_SYNC
 lib_LTLIBRARIES += libxcb-sync.la
-libxcb_sync_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
+libxcb_sync_la_LDFLAGS = -version-info 1:0:0 -no-undefined @lt_enable_auto_import@
 libxcb_sync_la_LIBADD = $(XCB_LIBS)
 nodist_libxcb_sync_la_SOURCES = sync.c sync.h
 endif
@@ -179,7 +179,7 @@ endif
 EXTSOURCES += xinput.c
 if BUILD_XINPUT
 lib_LTLIBRARIES += libxcb-xinput.la
-libxcb_xinput_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
+libxcb_xinput_la_LDFLAGS = -version-info 1:0:1 -no-undefined @lt_enable_auto_import@
 libxcb_xinput_la_LIBADD = $(XCB_LIBS)
 nodist_libxcb_xinput_la_SOURCES = xinput.c xinput.h
 endif
@@ -187,7 +187,7 @@ endif
 EXTSOURCES += xkb.c
 if BUILD_XKB
 lib_LTLIBRARIES += libxcb-xkb.la
-libxcb_xkb_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_xkb_la_LDFLAGS = -version-info 1:0:0 -no-undefined
 libxcb_xkb_la_LIBADD = $(XCB_LIBS)
 nodist_libxcb_xkb_la_SOURCES = xkb.c xkb.h
 endif
commit ce5395eb4611341ba7c243ed524d023a616f73bb
Author: Uli Schlachter <psychon at znc.in>
Date:   Mon Nov 18 20:30:18 2013 +0100

    Revert "Remove xcb_ge_event_t from xcb.h"
    
    This reverts commit f4d5b84800f960831e4fbb3ad9848bbb701020be.
    
    The version of this struct that the code generator produces breaks the API,
    because it gives the fields different (albeit better) names. Thus, we need to
    restore the old version of this struct.
    
    Additionally to the revert, this struct is documented as being deprecated. The
    replacement was added to xcb-proto.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71502
    Signed-off-by: Uli Schlachter <psychon at znc.in>
    Signed-off-by: Julien Cristau <jcristau at debian.org>

diff --git a/src/xcb.h b/src/xcb.h
index 63864dc..e62c985 100644
--- a/src/xcb.h
+++ b/src/xcb.h
@@ -141,6 +141,26 @@ typedef struct {
 } xcb_generic_event_t;
 
 /**
+ * @brief GE event
+ *
+ * An event as sent by the XGE extension. The length field specifies the
+ * number of 4-byte blocks trailing the struct.
+ *
+ * @deprecated Since some fields in this struct have unfortunate names, it is
+ * recommended to use xcb_ge_generic_event_t instead.
+ */
+typedef struct {
+    uint8_t  response_type;  /**< Type of the response */
+    uint8_t  pad0;           /**< Padding */
+    uint16_t sequence;       /**< Sequence number */
+    uint32_t length;
+    uint16_t event_type;
+    uint16_t pad1;
+    uint32_t pad[5];         /**< Padding */
+    uint32_t full_sequence;  /**< full sequence */
+} xcb_ge_event_t;
+
+/**
  * @brief Generic error.
  *
  * A generic error structure.
commit 18f0afab3f0de68114fe185e89d8b25a8c072a2c
Author: Daniel Martin <consume.noise at gmail.com>
Date:   Fri Nov 22 23:27:28 2013 +0100

    c_client.py: Fix _sizeof() functions
    
    Currently, it is not possible to correctly iterate over the replies of
    some requests. For example, the list of XIDeviceInfo returned by
    the XIQueryDevice request from xinput2 is read as garbage starting from
    the second entry.
    
    The culprits are the _sizeof() used by the iterators. In the above case:
    
        int
        xcb_input_xi_device_info_sizeof (const void  *_buffer  /**< */)
        {
            char *xcb_tmp = (char *)_buffer;
            [...]
            unsigned int xcb_block_len = 0;
            [...]
    
            xcb_block_len += sizeof(xcb_input_xi_device_info_t);
            xcb_tmp += xcb_block_len;
            /* name */
            xcb_block_len += (((_aux->name_len + 3) / 4) * 4) * sizeof(char);
            xcb_tmp += xcb_block_len;
            [...]
        }
    
    The problem here is that `xcb_block_len` is not zero'd right above the
    `/* name */` comment, causing `xcb_tmp` to be incremented by
    `sizeof(xcb_input_xi_device_info_t)` twice. The returned size is too
    large.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=68387
    
    Tested-by: Ran Benita <ran234 at gmail.com>
    Reviewed-by: Ran Benita <ran234 at gmail.com>
    Reviewed-by: Daniel Martin <consume.noise at gmail.com>
    Signed-off-by: Ran Benita <ran234 at gmail.com>
    Signed-off-by: Julien Cristau <jcristau at debian.org>

diff --git a/src/c_client.py b/src/c_client.py
index 7280004..99fd307 100644
--- a/src/c_client.py
+++ b/src/c_client.py
@@ -1061,8 +1061,8 @@ def _c_serialize_helper(context, complex_type,
         if context in ('unserialize', 'unpack', 'sizeof') and not self.var_followed_by_fixed_fields:
             code_lines.append('%s    xcb_block_len += sizeof(%s);' % (space, self.c_type))
             code_lines.append('%s    xcb_tmp += xcb_block_len;' % space)
-            # probably not needed
-            #_c_serialize_helper_insert_padding(context, code_lines, space, False)
+            code_lines.append('%s    xcb_buffer_len += xcb_block_len;' % space)
+            code_lines.append('%s    xcb_block_len = 0;' % space)
 
         count += _c_serialize_helper_fields(context, self, 
                                             code_lines, temp_vars, 


More information about the xcb-commit mailing list