From 534829a9e2ab034514a9a089de11ffc53e2cd26c Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Wed, 27 Jul 2016 10:24:42 +0900 Subject: [PATCH] Bug 1289500 - Don't load GTK IM module on content process. r=masayuki Now content sandbox process is enabled. Since uim-mozc uses vfork, it causes sandbox violation. It is unnecessary to load IM module on content process becasue we don't use GTK IM APIs on content process. MozReview-Commit-ID: GrPlmazzEMd --HG-- extra : rebase_source : e12ec563807627a7fb84b2ca56eaa552aac22643 --- ipc/glue/GeckoChildProcessHost.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index 1d60de2faf09..630bda216439 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -730,6 +730,14 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector& aExt if (privs == base::PRIVILEGES_DEFAULT) { privs = DefaultChildPrivileges(); } + +#if defined(MOZ_WIDGET_GTK) + if (mProcessType == GeckoProcessType_Content) { + // disable IM module to avoid sandbox violation + newEnvVars["GTK_IM_MODULE"] = "gtk-im-context-simple"; + } +#endif + // XPCOM may not be initialized in some subprocesses. We don't want // to initialize XPCOM just for the directory service, especially // since LD_LIBRARY_PATH is already set correctly in subprocesses