Skip to content
Snippets Groups Projects
Commit e89b40e9 authored by Matt Johnston's avatar Matt Johnston
Browse files

Add (disabled by default) LOG_COMMANDS option to log the commands executed

by clients.

--HG--
extra : convert_revision : bea3887a5875cf3ab8a1331e15e698b37b61fe37
parent 3f49fc5f
Branches
Tags
No related merge requests found
......@@ -199,8 +199,10 @@ etc) slower (perhaps by 50%). Recommended for most small systems. */
* not using the Dropbear client, you'll need to change it */
#define _PATH_SSH_PROGRAM "/usr/bin/dbclient"
/* Multi-purpose binary configuration has now moved. Look at the top
* of the Makefile for instructions, or INSTALL */
/* Whether to log commands executed by a client. This only logs the
* (single) command sent to the server, not what a user did in a
* shell/sftp session etc. */
/* #define LOG_COMMANDS */
/*******************************************************************
* You shouldn't edit below here unless you know you need to.
......
......@@ -588,6 +588,16 @@ static int sessioncommand(struct Channel *channel, struct ChanSess *chansess,
}
}
#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);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment