diff options
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | platform.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 663870381..83548767e 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -898,6 +898,7 @@ mips-sony-bsd|mips-sony-newsos4) | |||
898 | else | 898 | else |
899 | AC_MSG_RESULT([no]) | 899 | AC_MSG_RESULT([no]) |
900 | fi | 900 | fi |
901 | AC_CHECK_FUNCS([setpflags]) | ||
901 | AC_CHECK_FUNCS([setppriv]) | 902 | AC_CHECK_FUNCS([setppriv]) |
902 | AC_CHECK_FUNCS([priv_basicset]) | 903 | AC_CHECK_FUNCS([priv_basicset]) |
903 | AC_CHECK_HEADERS([priv.h]) | 904 | AC_CHECK_HEADERS([priv.h]) |
diff --git a/platform.c b/platform.c index e3722e4ae..c68bb09c1 100644 --- a/platform.c +++ b/platform.c | |||
@@ -22,6 +22,9 @@ | |||
22 | #if defined(HAVE_SYS_PRCTL_H) | 22 | #if defined(HAVE_SYS_PRCTL_H) |
23 | #include <sys/prctl.h> /* For prctl() and PR_SET_DUMPABLE */ | 23 | #include <sys/prctl.h> /* For prctl() and PR_SET_DUMPABLE */ |
24 | #endif | 24 | #endif |
25 | #ifdef HAVE_PRIV_H | ||
26 | #include <priv.h> /* For setpflags() and __PROC_PROTECT */ | ||
27 | #endif | ||
25 | 28 | ||
26 | #include <stdarg.h> | 29 | #include <stdarg.h> |
27 | #include <unistd.h> | 30 | #include <unistd.h> |
@@ -229,4 +232,9 @@ platform_disable_tracing(int strict) | |||
229 | if (prctl(PR_SET_DUMPABLE, 0) != 0 && strict) | 232 | if (prctl(PR_SET_DUMPABLE, 0) != 0 && strict) |
230 | fatal("unable to make the process undumpable"); | 233 | fatal("unable to make the process undumpable"); |
231 | #endif | 234 | #endif |
235 | #if defined(HAVE_SETPFLAGS) && defined(__PROC_PROTECT) | ||
236 | /* On Solaris, we should make this process untraceable */ | ||
237 | if (setpflags(__PROC_PROTECT, 1) != 0 && strict) | ||
238 | fatal("unable to make the process untraceable"); | ||
239 | #endif | ||
232 | } | 240 | } |