[epiphany] Revert "Try to make flatpak-spawn subsandbox not break D-Bus server"
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Revert "Try to make flatpak-spawn subsandbox not break D-Bus server"
- Date: Mon, 1 Jul 2019 19:01:56 +0000 (UTC)
commit 325de076360da7073703cdba5f2f0a7ce830329e
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Mon Jul 1 14:00:50 2019 -0500
Revert "Try to make flatpak-spawn subsandbox not break D-Bus server"
This reverts commit efaca6d864e8be97e267e93008c937ee6249ce88.
embed/ephy-embed-shell.c | 20 ++++++--------------
meson.build | 2 +-
2 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 9ae768f56..ad0b7a274 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -48,7 +48,6 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include <stdint.h>
#include <stdlib.h>
#define PAGE_SETUP_FILENAME "page-setup-gtk.ini"
@@ -1025,24 +1024,19 @@ authorize_authenticated_peer_cb (GDBusAuthObserver *observer,
return ephy_dbus_peer_is_authorized (credentials);
}
-static char *
+static void
ephy_embed_shell_setup_web_process_extensions_server (EphyEmbedShell *shell)
{
EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
g_autoptr(GDBusAuthObserver) observer = NULL;
- g_autofree char *socket_basename = NULL;
- g_autofree char *socket_path = NULL;
g_autofree char *address = NULL;
g_autoptr(GError) error = NULL;
/* Due to the bubblewrap sandbox, we cannot use any abstract sockets here.
* This means that unix:tmpdir= or unix:abstract= addresses will not work.
- * Additionally, we cannot put the socket under /tmp because that won't work
- * under a flatpak-spawn subsandbox.
+ * Using unix:dir= guarantees that abstract sockets won't be used.
*/
- socket_basename = g_strdup_printf ("ephy-embed-server-%jd", (intmax_t)getpid ());
- socket_path = g_build_filename ("/var/tmp", socket_basename, NULL);
- address = g_strdup_printf ("unix:path=%s", socket_path);
+ address = g_strdup_printf ("unix:dir=%s", ephy_file_tmp_dir ());
observer = g_dbus_auth_observer_new ();
@@ -1063,13 +1057,12 @@ ephy_embed_shell_setup_web_process_extensions_server (EphyEmbedShell *shell)
if (error) {
g_warning ("Failed to start embed shell D-Bus server on %s: %s", address, error->message);
- return NULL;
+ return;
}
g_signal_connect_object (priv->dbus_server, "new-connection",
G_CALLBACK (new_connection_cb), shell, 0);
g_dbus_server_start (priv->dbus_server);
- return g_steal_pointer (&socket_path);
}
static void
@@ -1141,13 +1134,12 @@ ephy_embed_shell_startup (GApplication *application)
g_autofree char *filename = NULL;
g_autofree char *cookie_policy = NULL;
g_autofree char *filters_dir = NULL;
- g_autofree char *dbus_socket_path = NULL;
G_APPLICATION_CLASS (ephy_embed_shell_parent_class)->startup (application);
ephy_embed_shell_create_web_context (shell);
- dbus_socket_path = ephy_embed_shell_setup_web_process_extensions_server (shell);
+ ephy_embed_shell_setup_web_process_extensions_server (shell);
/* User content manager */
if (priv->mode != EPHY_EMBED_SHELL_MODE_TEST)
@@ -1216,7 +1208,7 @@ ephy_embed_shell_startup (GApplication *application)
webkit_web_context_set_process_model (priv->web_context,
WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
webkit_web_context_set_sandbox_enabled (priv->web_context, TRUE);
- webkit_web_context_add_path_to_sandbox (priv->web_context, dbus_socket_path, TRUE);
+ webkit_web_context_add_path_to_sandbox (priv->web_context, ephy_file_tmp_dir (), TRUE);
webkit_web_context_add_path_to_sandbox (priv->web_context, ephy_profile_dir (), TRUE);
webkit_web_context_add_path_to_sandbox (priv->web_context, ephy_cache_dir (), TRUE);
webkit_web_context_add_path_to_sandbox (priv->web_context, ephy_config_dir (), TRUE);
diff --git a/meson.build b/meson.build
index 2a54c6c7a..27fa538d2 100644
--- a/meson.build
+++ b/meson.build
@@ -73,7 +73,7 @@ config_h = declare_dependency(
)
)
-glib_requirement = '>= 2.56.0'
+glib_requirement = '>= 2.61.2'
gtk_requirement = '>= 3.24.0'
nettle_requirement = '>= 3.4'
webkitgtk_requirement = '>= 2.25.1'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]