# HG changeset patch # User Matt Johnston # Date 1584199698 -28800 # Node ID 8a7d26e86a5601742b99c837c14ddac448cfb631 # Parent 6a6a0bac52f412c8875fdd5678464891e85ef5aa Set SSH_ORIGINAL_COMMAND for "dropbear -c" too, fix build without DROPBEAR_SVR_PUBKEY_OPTIONS diff -r 6a6a0bac52f4 -r 8a7d26e86a56 chansession.h --- a/chansession.h Sat Mar 14 23:26:37 2020 +0800 +++ b/chansession.h Sat Mar 14 23:28:18 2020 +0800 @@ -41,6 +41,9 @@ char * cmd; /* command to exec */ pid_t pid; /* child process pid */ + /* command that was sent by the client, if authorized_keys command= or + dropbear -c was used */ + char *original_command; /* pty details */ int master; /* the master terminal fd*/ @@ -72,10 +75,6 @@ char * agentfile; char * agentdir; #endif - -#if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT - char *original_command; -#endif }; struct ChildPid { diff -r 6a6a0bac52f4 -r 8a7d26e86a56 svr-chansession.c --- a/svr-chansession.c Sat Mar 14 23:26:37 2020 +0800 +++ b/svr-chansession.c Sat Mar 14 23:28:18 2020 +0800 @@ -322,10 +322,7 @@ m_free(chansess->cmd); m_free(chansess->term); - -#if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT m_free(chansess->original_command); -#endif if (chansess->tty) { /* write the utmp/wtmp login record */ @@ -833,7 +830,7 @@ (dup2(chansess->slave, STDOUT_FILENO) < 0)) { TRACE(("leave ptycommand: error redirecting filedesc")) return DROPBEAR_FAILURE; - } + } close(chansess->slave); @@ -997,11 +994,9 @@ addnewvar("SSH_CLIENT", chansess->client_string); } -#if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT if (chansess->original_command) { addnewvar("SSH_ORIGINAL_COMMAND", chansess->original_command); } -#endif /* change directory */ if (chdir(ses.authstate.pw_dir) < 0) {