diff svr-chansession.c @ 1791:685b47d8faf7

fuzz: wrap kill()
author Matt Johnston <matt@ucc.asn.au>
date Fri, 29 Jan 2021 21:47:56 +0800
parents 4f13df974cf4
children 837cc354b388
line wrap: on
line diff
--- a/svr-chansession.c	Wed Feb 15 13:53:04 2017 +0100
+++ b/svr-chansession.c	Fri Jan 29 21:47:56 2021 +0800
@@ -423,12 +423,14 @@
 
 /* Send a signal to a session's process as requested by the client*/
 static int sessionsignal(const struct ChanSess *chansess) {
+	TRACE(("sessionsignal"))
 
 	int sig = 0;
 	char* signame = NULL;
 	int i;
 
 	if (chansess->pid == 0) {
+		TRACE(("sessionsignal: done no pid"))
 		/* haven't got a process pid yet */
 		return DROPBEAR_FAILURE;
 	}
@@ -446,12 +448,14 @@
 
 	m_free(signame);
 
+	TRACE(("sessionsignal: pid %d signal %d", (int)chansess->pid, sig))
 	if (sig == 0) {
 		/* failed */
 		return DROPBEAR_FAILURE;
 	}
 			
 	if (kill(chansess->pid, sig) < 0) {
+		TRACE(("sessionsignal: kill() errored"))
 		return DROPBEAR_FAILURE;
 	}