Don't log authorized_keys command= every time

This commit is contained in:
Matt Johnston 2020-03-14 23:26:37 +08:00
parent 002b79e2f9
commit cc6fa57a41

View File

@ -92,6 +92,7 @@ int svr_pubkey_allows_pty() {
* by any 'command' public key option. */ * by any 'command' public key option. */
void svr_pubkey_set_forced_command(struct ChanSess *chansess) { void svr_pubkey_set_forced_command(struct ChanSess *chansess) {
if (ses.authstate.pubkey_options && ses.authstate.pubkey_options->forced_command) { if (ses.authstate.pubkey_options && ses.authstate.pubkey_options->forced_command) {
TRACE(("Forced command '%s'", ses.authstate.pubkey_options->forced_command))
if (chansess->cmd) { if (chansess->cmd) {
/* original_command takes ownership */ /* original_command takes ownership */
chansess->original_command = chansess->cmd; chansess->original_command = chansess->cmd;
@ -182,8 +183,6 @@ int svr_add_pubkey_options(buffer *options_buf, int line_num, const char* filena
memcpy(ses.authstate.pubkey_options->forced_command, memcpy(ses.authstate.pubkey_options->forced_command,
command_start, command_len-1); command_start, command_len-1);
ses.authstate.pubkey_options->forced_command[command_len-1] = '\0'; ses.authstate.pubkey_options->forced_command[command_len-1] = '\0';
dropbear_log(LOG_WARNING, "Forced command '%s'",
ses.authstate.pubkey_options->forced_command);
goto next_option; goto next_option;
} }
escaped = (!escaped && c == '\\'); escaped = (!escaped && c == '\\');