[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libxcb rebootstrap fix for hurd-any



Hello,

libxcb currently FTBFS in the hurd rebootstrap, here is a fix, also
available in my tree

git@salsa.debian.org:sthibault/rebootstrap.git

as f451df6db6d72d52c829093c6df045ecb6971d97

Samuel
commit f451df6db6d72d52c829093c6df045ecb6971d97
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Tue Jul 8 14:47:04 2025 +0200

    hurd: fix PATH_MAX use in libxcb
    
    Submitted upstream as
    https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/65

diff --git a/bootstrap.sh b/bootstrap.sh
index 5784cb9..1e5b46b 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -2854,6 +2854,49 @@ buildenv_libx11() {
 add_automatic libxau
 add_automatic libxaw
 add_automatic libxcb
+patch_libxcb() {
+	echo "Fix PATH_MAX https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/65";
+	drop_privs patch -p1 <<'EOF'
+Index: libxcb-1.17.0/src/xcb_util.c
+===================================================================
+--- libxcb-1.17.0.orig/src/xcb_util.c
++++ libxcb-1.17.0/src/xcb_util.c
+@@ -104,14 +104,12 @@ static int _xcb_parse_display_path_to_so
+                                              int *displayp, int *screenp)
+ {
+     struct stat sbuf;
+-    char path[PATH_MAX];
+-    size_t len;
++    char *path;
+     int _screen = 0, res;
+ 
+-    len = strlen(name);
+-    if (len >= sizeof(path))
++    path = strdup(name);
++    if (!path)
+         return 0;
+-    memcpy(path, name, len + 1);
+     res = stat(path, &sbuf);
+     if (0 != res) {
+         unsigned long lscreen;
+@@ -131,11 +129,10 @@ static int _xcb_parse_display_path_to_so
+         _screen = (int)lscreen;
+     }
+ 
+-    if (host) {
+-        *host = strdup(path);
+-        if (!*host)
+-            return 0;
+-    }
++    if (host)
++        *host = path;
++    else
++        free(path);
+ 
+     if (protocol) {
+         *protocol = strdup("unix");
+EOF
+}
 add_automatic libxcrypt
 add_automatic libxdmcp
 

Reply to: