PATCH: Log the PID of executed commands

Bruce Guenter bruce at untroubled.org
Thu Aug 30 08:10:31 EST 2012


sshd logs the PID of the network child and the user child sshd
processes. This patch adds logging the PID of invoked commands for
completeness.

diff --git a/session.c b/session.c
index f3baea2..dd1d0e8 100644
--- a/session.c
+++ b/session.c
@@ -579,6 +579,7 @@ do_exec_no_pty(Session *s, const char *command)
 		do_child(s, command);
 		/* NOTREACHED */
 	default:
+		verbose("command is on pid %ld", (long)pid);
 		break;
 	}
 
@@ -729,6 +730,7 @@ do_exec_pty(Session *s, const char *command)
 		do_child(s, command);
 		/* NOTREACHED */
 	default:
+		verbose("command is on pid %ld", (long)pid);
 		break;
 	}
 

-- 
Bruce Guenter <bruce at untroubled.org>                http://untroubled.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20120829/e08b0765/attachment.bin>


More information about the openssh-unix-dev mailing list