From c77d02bb11015fa9d3e5d717ade0ee93a6f6fd9b Mon Sep 17 00:00:00 2001 From: MaxMougg <98486753+MaxMougg@users.noreply.github.com> Date: Mon, 30 May 2022 11:01:16 -0400 Subject: [PATCH 1/2] Update svr-chansession for build issue Following issue "Compilation error when disabling pubkey authentication (DROPBEAR_SVR_PUBKEY_AUTH)" from davidbernard04, code is modified to take in account that requesting information from method "ses.authstate.pubkey_info" isn't possible since the method is disabled when DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT value is 0. --- svr-chansession.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/svr-chansession.c b/svr-chansession.c index 9ae2e60..23c5a64 100644 --- a/svr-chansession.c +++ b/svr-chansession.c @@ -1040,9 +1040,11 @@ static void execchild(const void *user_data) { if (chansess->original_command) { addnewvar("SSH_ORIGINAL_COMMAND", chansess->original_command); } +#if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT if (ses.authstate.pubkey_info != NULL) { - addnewvar("SSH_PUBKEYINFO", ses.authstate.pubkey_info); + addnewvar("SSH_PUBKEYINFO", ses.authstate.pubkey_info); } +#endif /* change directory */ if (chdir(ses.authstate.pw_dir) < 0) { From 1622c80be4cc7e10fde8a7a8abca4e82b7253109 Mon Sep 17 00:00:00 2001 From: MaxMougg <98486753+MaxMougg@users.noreply.github.com> Date: Mon, 30 May 2022 11:28:17 -0400 Subject: [PATCH 2/2] Fix indentations --- svr-chansession.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/svr-chansession.c b/svr-chansession.c index 23c5a64..656a968 100644 --- a/svr-chansession.c +++ b/svr-chansession.c @@ -1041,9 +1041,9 @@ static void execchild(const void *user_data) { addnewvar("SSH_ORIGINAL_COMMAND", chansess->original_command); } #if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT - if (ses.authstate.pubkey_info != NULL) { - addnewvar("SSH_PUBKEYINFO", ses.authstate.pubkey_info); - } + if (ses.authstate.pubkey_info != NULL) { + addnewvar("SSH_PUBKEYINFO", ses.authstate.pubkey_info); + } #endif /* change directory */