[openssh-commits] [openssh] 01/01: Include error reason if trace disabling fails.

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Oct 15 12:44:53 AEDT 2021


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit fff13aaa262b7b3ec83ed21e29674cbf331780a7
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Fri Oct 15 12:43:36 2021 +1100

    Include error reason if trace disabling fails.
---
 platform-tracing.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/platform-tracing.c b/platform-tracing.c
index 0daf2a86..b67e64f2 100644
--- a/platform-tracing.c
+++ b/platform-tracing.c
@@ -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
 }

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list