summaryrefslogtreecommitdiff
path: root/platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'platform.c')
-rw-r--r--platform.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/platform.c b/platform.c
index e3722e4a..c68bb09c 100644
--- a/platform.c
+++ b/platform.c
@@ -22,6 +22,9 @@
#if defined(HAVE_SYS_PRCTL_H)
#include <sys/prctl.h> /* For prctl() and PR_SET_DUMPABLE */
#endif
+#ifdef HAVE_PRIV_H
+#include <priv.h> /* For setpflags() and __PROC_PROTECT */
+#endif
#include <stdarg.h>
#include <unistd.h>
@@ -229,4 +232,9 @@ platform_disable_tracing(int strict)
if (prctl(PR_SET_DUMPABLE, 0) != 0 && strict)
fatal("unable to make the process undumpable");
#endif
+#if defined(HAVE_SETPFLAGS) && defined(__PROC_PROTECT)
+ /* On Solaris, we should make this process untraceable */
+ if (setpflags(__PROC_PROTECT, 1) != 0 && strict)
+ fatal("unable to make the process untraceable");
+#endif
}