summaryrefslogtreecommitdiffhomepage
path: root/cli-runopts.c
diff options
context:
space:
mode:
authorKonstantin Tokarev <ktokarev@smartlabs.tv>2015-11-30 20:30:58 +0300
committerKonstantin Tokarev <ktokarev@smartlabs.tv>2015-11-30 21:05:36 +0300
commit4dc1388ac76eee5af402eb751bcae4e38465a9ed (patch)
tree9440599f8f15f686256cfbf39df543fa8c476db4 /cli-runopts.c
parent1b69d6d6582c75a6a667d7b2513c5dce3f5504f4 (diff)
Implemented ExitOnForwardFailure option for local and remote forwarding.
Diffstat (limited to 'cli-runopts.c')
-rw-r--r--cli-runopts.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/cli-runopts.c b/cli-runopts.c
index ea178c7..0522221 100644
--- a/cli-runopts.c
+++ b/cli-runopts.c
@@ -148,6 +148,9 @@ void cli_getopts(int argc, char ** argv) {
#ifdef ENABLE_CLI_PUBKEY_AUTH
cli_opts.privkeys = list_new();
#endif
+#ifdef ENABLE_CLI_ANYTCPFWD
+ cli_opts.exit_on_fwd_failure = 0;
+#endif
#ifdef ENABLE_CLI_LOCALTCPFWD
cli_opts.localfwds = list_new();
opts.listen_fwd_all = 0;
@@ -854,9 +857,20 @@ static void add_extendedopt(const char* origstr) {
const char *optstr = origstr;
if (strcmp(origstr, "help") == 0) {
- dropbear_log(LOG_INFO, "No options available\n");
+ dropbear_log(LOG_INFO, "Available options:\n"
+#ifdef ENABLE_CLI_ANYTCPFWD
+ "\tExitOnForwardFailure\n"
+#endif
+ );
exit(EXIT_SUCCESS);
}
+#ifdef ENABLE_CLI_ANYTCPFWD
+ if (match_extendedopt(&optstr, "ExitOnForwardFailure") == DROPBEAR_SUCCESS) {
+ cli_opts.exit_on_fwd_failure = parse_flag_value(optstr);
+ return;
+ }
+#endif
+
dropbear_exit("Bad configuration option '%s'", origstr);
}