Mercurial > dropbear
comparison cli-runopts.c @ 1206:2907c658fa76
Implemented ExitOnForwardFailure option for local and remote forwarding.
author | Konstantin Tokarev <ktokarev@smartlabs.tv> |
---|---|
date | Mon, 30 Nov 2015 20:30:58 +0300 |
parents | 978887222d29 |
children | 64a50eac1030 |
comparison
equal
deleted
inserted
replaced
1205:978887222d29 | 1206:2907c658fa76 |
---|---|
146 cli_opts.no_hostkey_check = 0; | 146 cli_opts.no_hostkey_check = 0; |
147 cli_opts.is_subsystem = 0; | 147 cli_opts.is_subsystem = 0; |
148 #ifdef ENABLE_CLI_PUBKEY_AUTH | 148 #ifdef ENABLE_CLI_PUBKEY_AUTH |
149 cli_opts.privkeys = list_new(); | 149 cli_opts.privkeys = list_new(); |
150 #endif | 150 #endif |
151 #ifdef ENABLE_CLI_ANYTCPFWD | |
152 cli_opts.exit_on_fwd_failure = 0; | |
153 #endif | |
151 #ifdef ENABLE_CLI_LOCALTCPFWD | 154 #ifdef ENABLE_CLI_LOCALTCPFWD |
152 cli_opts.localfwds = list_new(); | 155 cli_opts.localfwds = list_new(); |
153 opts.listen_fwd_all = 0; | 156 opts.listen_fwd_all = 0; |
154 #endif | 157 #endif |
155 #ifdef ENABLE_CLI_REMOTETCPFWD | 158 #ifdef ENABLE_CLI_REMOTETCPFWD |
852 | 855 |
853 static void add_extendedopt(const char* origstr) { | 856 static void add_extendedopt(const char* origstr) { |
854 const char *optstr = origstr; | 857 const char *optstr = origstr; |
855 | 858 |
856 if (strcmp(origstr, "help") == 0) { | 859 if (strcmp(origstr, "help") == 0) { |
857 dropbear_log(LOG_INFO, "No options available\n"); | 860 dropbear_log(LOG_INFO, "Available options:\n" |
861 #ifdef ENABLE_CLI_ANYTCPFWD | |
862 "\tExitOnForwardFailure\n" | |
863 #endif | |
864 ); | |
858 exit(EXIT_SUCCESS); | 865 exit(EXIT_SUCCESS); |
859 } | 866 } |
860 | 867 |
868 #ifdef ENABLE_CLI_ANYTCPFWD | |
869 if (match_extendedopt(&optstr, "ExitOnForwardFailure") == DROPBEAR_SUCCESS) { | |
870 cli_opts.exit_on_fwd_failure = parse_flag_value(optstr); | |
871 return; | |
872 } | |
873 #endif | |
874 | |
861 dropbear_exit("Bad configuration option '%s'", origstr); | 875 dropbear_exit("Bad configuration option '%s'", origstr); |
862 } | 876 } |