diff svr-chansession.c @ 349:dba106bf6b34

Add (disabled by default) LOG_COMMANDS option to log the commands executed by clients.
author Matt Johnston <matt@ucc.asn.au>
date Mon, 07 Aug 2006 13:41:16 +0000
parents 1f5ec029dfe8
children 01e4180895ba
line wrap: on
line diff
--- a/svr-chansession.c	Sat Mar 11 14:59:34 2006 +0000
+++ b/svr-chansession.c	Mon Aug 07 13:41:16 2006 +0000
@@ -588,6 +588,16 @@
 		}
 	}
 
+#ifdef LOG_COMMANDS
+	if (chansess->cmd) {
+		dropbear_log(LOG_INFO, "user %s executing '%s'", 
+						ses.authstate.printableuser, chansess->cmd);
+	} else {
+		dropbear_log(LOG_INFO, "user %s executing login shell", 
+						ses.authstate.printableuser);
+	}
+#endif
+
 	if (chansess->term == NULL) {
 		/* no pty */
 		ret = noptycommand(channel, chansess);