[mutter] main: Make process PR_SET_DUMPABLE
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] main: Make process PR_SET_DUMPABLE
- Date: Fri, 27 Sep 2019 14:39:04 +0000 (UTC)
commit dbe9daeb763bffdf2ba4a5fa7c2a3ac8587c0d37
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Fri Sep 27 10:15:48 2019 +0200
main: Make process PR_SET_DUMPABLE
Otherwise we won't get core dumps if the launching binary has
capabilities set.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/811
config.h.meson | 3 +++
meson.build | 4 ++++
src/core/main.c | 8 ++++++++
3 files changed, 15 insertions(+)
---
diff --git a/config.h.meson b/config.h.meson
index 77045319c..0bab71848 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -61,6 +61,9 @@
/* XKB base prefix */
#mesondefine XKB_BASE
+/* Whether <sys/prctl.h> exists and it defines prctl() */
+#mesondefine HAVE_SYS_PRCTL
+
/* Either <sys/random.h> or <linux/random.h> */
#mesondefine HAVE_SYS_RANDOM
#mesondefine HAVE_LINUX_RANDOM
diff --git a/meson.build b/meson.build
index ae0bbfcc2..55ab3eb14 100644
--- a/meson.build
+++ b/meson.build
@@ -366,6 +366,10 @@ cdata.set('HAVE_PROFILER', have_profiler)
xkb_base = xkeyboard_config_dep.get_pkgconfig_variable('xkb_base')
cdata.set_quoted('XKB_BASE', xkb_base)
+if cc.has_header_symbol('sys/prctl.h', 'prctl')
+ cdata.set('HAVE_SYS_PRCTL', 1)
+endif
+
if have_wayland
xwayland_path = get_option('xwayland_path')
if xwayland_path == ''
diff --git a/src/core/main.c b/src/core/main.c
index 2724cf076..7f4f666d2 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -70,6 +70,10 @@
#include <systemd/sd-login.h>
#endif /* HAVE_WAYLAND && HAVE_NATIVE_BACKEND */
+#ifdef HAVE_SYS_PRCTL
+#include <sys/prctl.h>
+#endif
+
#include "backends/meta-backend-private.h"
#include "backends/x11/cm/meta-backend-x11-cm.h"
#include "backends/x11/meta-backend-x11.h"
@@ -532,6 +536,10 @@ meta_init (void)
MetaCompositorType compositor_type;
GType backend_gtype;
+#ifdef HAVE_SYS_PRCTL
+ prctl (PR_SET_DUMPABLE, 1);
+#endif
+
sigemptyset (&empty_mask);
act.sa_handler = SIG_IGN;
act.sa_mask = empty_mask;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]