mirror of
git://anongit.mindrot.org/openssh.git
synced 2025-02-14 21:07:04 +00:00
Include error reason if trace disabling fails.
This commit is contained in:
parent
d4b38144c0
commit
fff13aaa26
@ -41,21 +41,24 @@ platform_disable_tracing(int strict)
|
|||||||
int disable_trace = PROC_TRACE_CTL_DISABLE;
|
int disable_trace = PROC_TRACE_CTL_DISABLE;
|
||||||
|
|
||||||
if (procctl(P_PID, 0, PROC_TRACE_CTL, &disable_trace) && strict)
|
if (procctl(P_PID, 0, PROC_TRACE_CTL, &disable_trace) && strict)
|
||||||
fatal("unable to make the process untraceable");
|
fatal("unable to make the process untraceable: %s",
|
||||||
|
strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
|
#if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
|
||||||
/* Disable ptrace on Linux without sgid bit */
|
/* Disable ptrace on Linux without sgid bit */
|
||||||
if (prctl(PR_SET_DUMPABLE, 0) != 0 && strict)
|
if (prctl(PR_SET_DUMPABLE, 0) != 0 && strict)
|
||||||
fatal("unable to make the process undumpable");
|
fatal("unable to make the process undumpable: %s",
|
||||||
|
strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_SETPFLAGS) && defined(__PROC_PROTECT)
|
#if defined(HAVE_SETPFLAGS) && defined(__PROC_PROTECT)
|
||||||
/* On Solaris, we should make this process untraceable */
|
/* On Solaris, we should make this process untraceable */
|
||||||
if (setpflags(__PROC_PROTECT, 1) != 0 && strict)
|
if (setpflags(__PROC_PROTECT, 1) != 0 && strict)
|
||||||
fatal("unable to make the process untraceable");
|
fatal("unable to make the process untraceable: %s",
|
||||||
|
strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
#ifdef PT_DENY_ATTACH
|
#ifdef PT_DENY_ATTACH
|
||||||
/* Mac OS X */
|
/* Mac OS X */
|
||||||
if (ptrace(PT_DENY_ATTACH, 0, 0, 0) == -1 && strict)
|
if (ptrace(PT_DENY_ATTACH, 0, 0, 0) == -1 && strict)
|
||||||
fatal("unable to set PT_DENY_ATTACH");
|
fatal("unable to set PT_DENY_ATTACH: %s", strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user