comparison cli-main.c @ 542:c9128994a2d6

Wrap proxycmd function in ENABLE_CLI_PROXYCMD #ifdef (commit the right file this time)
author Matt Johnston <matt@ucc.asn.au>
date Mon, 08 Jun 2009 14:53:29 +0000
parents effb4a25b1ae
children 9e51707cd6f2
comparison
equal deleted inserted replaced
541:b151e6df683e 542:c9128994a2d6
30 #include "session.h" 30 #include "session.h"
31 31
32 static void cli_dropbear_exit(int exitcode, const char* format, va_list param); 32 static void cli_dropbear_exit(int exitcode, const char* format, va_list param);
33 static void cli_dropbear_log(int priority, const char* format, va_list param); 33 static void cli_dropbear_log(int priority, const char* format, va_list param);
34 34
35 #ifdef ENABLE_CLI_PROXYCMD
35 static void cli_proxy_cmd(int *sock_in, int *sock_out); 36 static void cli_proxy_cmd(int *sock_in, int *sock_out);
37 #endif
36 38
37 #if defined(DBMULTI_dbclient) || !defined(DROPBEAR_MULTI) 39 #if defined(DBMULTI_dbclient) || !defined(DROPBEAR_MULTI)
38 #if defined(DBMULTI_dbclient) && defined(DROPBEAR_MULTI) 40 #if defined(DBMULTI_dbclient) && defined(DROPBEAR_MULTI)
39 int cli_main(int argc, char ** argv) { 41 int cli_main(int argc, char ** argv) {
40 #else 42 #else
130 usershell = m_strdup(get_user_shell()); 132 usershell = m_strdup(get_user_shell());
131 run_shell_command(cmd, ses.maxfd, usershell); 133 run_shell_command(cmd, ses.maxfd, usershell);
132 dropbear_exit("Failed to run '%s'\n", cmd); 134 dropbear_exit("Failed to run '%s'\n", cmd);
133 } 135 }
134 136
137 #ifdef ENABLE_CLI_PROXYCMD
135 static void cli_proxy_cmd(int *sock_in, int *sock_out) { 138 static void cli_proxy_cmd(int *sock_in, int *sock_out) {
136 int ret; 139 int ret;
137 140
138 fill_passwd(cli_opts.own_user); 141 fill_passwd(cli_opts.own_user);
139 142
142 if (ret == DROPBEAR_FAILURE) { 145 if (ret == DROPBEAR_FAILURE) {
143 dropbear_exit("Failed running proxy command"); 146 dropbear_exit("Failed running proxy command");
144 *sock_in = *sock_out = -1; 147 *sock_in = *sock_out = -1;
145 } 148 }
146 } 149 }
150 #endif // ENABLE_CLI_PROXYCMD