diff options
Diffstat (limited to 'agent')
-rw-r--r-- | agent/gpg-agent.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 793fc44eb..29098ba71 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -48,6 +48,9 @@ # include <signal.h> #endif #include <npth.h> +#ifdef HAVE_PRCTL +# include <sys/prctl.h> +#endif #define GNUPG_COMMON_NEED_AFLOCAL #include "agent.h" @@ -1013,6 +1016,11 @@ main (int argc, char **argv ) early_system_init (); +#if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE) + /* Disable ptrace on Linux without sgid bit */ + prctl(PR_SET_DUMPABLE, 0); +#endif + /* Before we do anything else we save the list of currently open file descriptors and the signal mask. This info is required to do the exec call properly. We don't need it on Windows. */ |