mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-28 13:12:10 +01:00
gio/gdbusserver: use non-abstract socket for unix:tmpdir=
This implements https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/350 for GDBus's server implementation. Abstract sockets belong to the network namespace instead of the mount namespace. As a result, mount namespace-based sandboxes (e.g. Flatpak) cannot restrict access to abstract sockets (and therefore GDBus's unix:tmpdir= server addresses), at least for applications with network access permission, which may result in sandbox escapes unless the application running the GDBus server explicitly check that the connecting process is not in a sandbox. As of the time of writing, no known applications using GDBusServer does this. Fix this by always using non-abstract sockets for unix:tmpdir=, which is allowed by the DBus specification.
This commit is contained in:
parent
86430a27d2
commit
c0a1a3b384
@ -725,14 +725,7 @@ try_unix (GDBusServer *server,
|
|||||||
for (n = 0; n < 8; n++)
|
for (n = 0; n < 8; n++)
|
||||||
g_string_append_c (s, random_ascii ());
|
g_string_append_c (s, random_ascii ());
|
||||||
|
|
||||||
/* prefer abstract namespace if available for tmpdir: addresses
|
address = g_unix_socket_address_new (s->str);
|
||||||
* abstract namespace is disallowed for dir: addresses */
|
|
||||||
if (tmpdir != NULL && g_unix_socket_address_abstract_names_supported ())
|
|
||||||
address = g_unix_socket_address_new_with_type (s->str,
|
|
||||||
-1,
|
|
||||||
G_UNIX_SOCKET_ADDRESS_ABSTRACT);
|
|
||||||
else
|
|
||||||
address = g_unix_socket_address_new (s->str);
|
|
||||||
g_string_free (s, TRUE);
|
g_string_free (s, TRUE);
|
||||||
|
|
||||||
local_error = NULL;
|
local_error = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user