summaryrefslogtreecommitdiff
path: root/platform.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2016-06-15 11:22:38 +1000
committerDarren Tucker <dtucker@zip.com.au>2016-06-15 11:29:24 +1000
commit57b4ee04cad0d3e0fec1194753b0c4d31e39a1cd (patch)
treec16b86f69bb8273ebaedf7bef263fe5f7c184f11 /platform.c
parent78dc8e3724e30ee3e1983ce013e80277dc6ca070 (diff)
Move platform_disable_tracing into its own file.
Prevents link errors resolving the extern "options" when platform.o gets linked into ssh-agent when building --with-pam.
Diffstat (limited to 'platform.c')
-rw-r--r--platform.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/platform.c b/platform.c
index c68bb09c1..acf8554cd 100644
--- a/platform.c
+++ b/platform.c
@@ -18,14 +18,6 @@
18 18
19#include "includes.h" 19#include "includes.h"
20 20
21#include <sys/types.h>
22#if defined(HAVE_SYS_PRCTL_H)
23#include <sys/prctl.h> /* For prctl() and PR_SET_DUMPABLE */
24#endif
25#ifdef HAVE_PRIV_H
26#include <priv.h> /* For setpflags() and __PROC_PROTECT */
27#endif
28
29#include <stdarg.h> 21#include <stdarg.h>
30#include <unistd.h> 22#include <unistd.h>
31 23
@@ -223,18 +215,3 @@ platform_sys_dir_uid(uid_t uid)
223#endif 215#endif
224 return 0; 216 return 0;
225} 217}
226
227void
228platform_disable_tracing(int strict)
229{
230#if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
231 /* Disable ptrace on Linux without sgid bit */
232 if (prctl(PR_SET_DUMPABLE, 0) != 0 && strict)
233 fatal("unable to make the process undumpable");
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
240}