From 0a82453525e2d887e4f855f7933227581da37e6e Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 6 Sep 2018 09:54:00 +0300 Subject: [PATCH] Bug 1466593 - When sandboxing the content process on OpenBSD, fake a DBUS session if none is running r=gcp --- dom/ipc/ContentChild.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index f6d044d4b93d..03a5918eb5aa 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -1785,6 +1785,12 @@ ContentChild::RecvSetProcessSandbox(const MaybeFileDesc& aBroker) sandboxEnabled = StartMacOSContentSandbox(); #elif defined(__OpenBSD__) sandboxEnabled = StartOpenBSDSandbox(GeckoProcessType_Content); + /* dont overwrite an existing session dbus address, but ensure it is set */ + if (!PR_GetEnv("DBUS_SESSION_BUS_ADDRESS")) { + static LazyLogModule sPledgeLog("SandboxPledge"); + MOZ_LOG(sPledgeLog, LogLevel::Debug, ("no session dbus found, faking one\n")); + PR_SetEnv("DBUS_SESSION_BUS_ADDRESS="); + } #endif CrashReporter::AnnotateCrashReport(