[Webkit-unassigned] [Bug 201945] New: [WPE][GTK] BubblewrapLauncher fails when prgname is long

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 18 14:49:51 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=201945

            Bug ID: 201945
           Summary: [WPE][GTK] BubblewrapLauncher fails when prgname is
                    long
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKitGTK
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mcatanzaro at gnome.org
                CC: bugs-noreply at webkitgtk.org, pgriffis at igalia.com

Create an Epiphany web app with homepage https://gitlab.gnome.org/GNOME/gnome-calendar/-/boards and title "Calendário | GitLab Board". Launching the web app will fail with this error:

bwrap: Can't find source path /run/user/1000/epiphany-calendário-|-gitlab-board-7a7ee47e494991831fefdce8763b44fba593ba63/dbus-proxy-G0AJ8Z: No such file or directory

Problem is that two characters are truncated off the address of the socket that gets created.

Actually, WebKit creates this socket properly first, using g_mkstemp(). Then xdg-dbus-proxy unlinks it in flatpak_proxy_start(), in flatpak-proxy.c, and recreates it by creating a GUnixSocketAddress and then calling g_socket_listener_add_address(). Problem occurs when creating the GUnixSocketAddress. It truncates the path down to UNIX_PATH_MAX characters, which is only 108 on Linux.

E.g. this debug patch:

diff --git a/gio/gunixsocketaddress.c b/gio/gunixsocketaddress.c
index 27e195e47..f36ae3dad 100644
--- a/gio/gunixsocketaddress.c
+++ b/gio/gunixsocketaddress.c
@@ -104,6 +104,9 @@ g_unix_socket_address_set_property (GObject      *object,
       str = g_value_get_string (value);
       if (str)
        {
+          if (strlen (str) >= UNIX_PATH_MAX)
+            g_warning ("Socket address %s will be truncated because its length %zd exceeds maximum length %lu", str, strlen (str), UNIX_PATH_MAX - 1);
+
          g_strlcpy (address->priv->path, str,
                     sizeof (address->priv->path));
          address->priv->path_len = strlen (address->priv->path);

Results in the warning:

(process:140099): GLib-GIO-WARNING **: 16:47:45.169: Socket address /run/user/1000/epiphany-calendário-|-gitlab-board-7a7ee47e494991831fefdce8763b44fba593ba63/dbus-proxy-GND97Z will be truncated because its length 109 exceeds maximum length 107

So... yeah, not sure what to do here. We could truncate the prgname, or just not use the prgname at all in the path, since it's not really needed.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190918/1519e309/attachment.html>


More information about the webkit-unassigned mailing list