]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Include error reason if trace disabling fails.
authorDarren Tucker <dtucker@dtucker.net>
Fri, 15 Oct 2021 01:43:36 +0000 (12:43 +1100)
committerDarren Tucker <dtucker@dtucker.net>
Fri, 15 Oct 2021 01:43:36 +0000 (12:43 +1100)
platform-tracing.c

index 0daf2a86f333455cb0844c169bc0d46eb26b1991..b67e64f25fb4a344966ef70d29d226ae3348fba5 100644 (file)
@@ -41,21 +41,24 @@ platform_disable_tracing(int strict)
        int disable_trace = PROC_TRACE_CTL_DISABLE;
 
        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
 #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
        /* Disable ptrace on Linux without sgid bit */
        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
 #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");
+               fatal("unable to make the process untraceable: %s",
+                   strerror(errno));
 #endif
 #ifdef PT_DENY_ATTACH
        /* Mac OS X */
        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
 }