Mercurial > dropbear
comparison cli-runopts.c @ 568:005530560594
Rearrange getaddrstring() etc
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 01 Sep 2009 16:38:26 +0000 |
parents | c3f2ec71e3d4 |
children | b6665c1eac43 |
comparison
equal
deleted
inserted
replaced
567:893a9dd0b9dd | 568:005530560594 |
---|---|
376 if (opts.recv_window == 0 || opts.recv_window > MAX_RECV_WINDOW) { | 376 if (opts.recv_window == 0 || opts.recv_window > MAX_RECV_WINDOW) { |
377 dropbear_exit("Bad recv window '%s'", recv_window_arg); | 377 dropbear_exit("Bad recv window '%s'", recv_window_arg); |
378 } | 378 } |
379 } | 379 } |
380 if (keepalive_arg) { | 380 if (keepalive_arg) { |
381 if (m_str_to_uint(keepalive_arg, &opts.keepalive_secs) == DROPBEAR_FAILURE) { | 381 unsigned int val; |
382 if (m_str_to_uint(keepalive_arg, &val) == DROPBEAR_FAILURE) { | |
382 dropbear_exit("Bad keepalive '%s'", keepalive_arg); | 383 dropbear_exit("Bad keepalive '%s'", keepalive_arg); |
383 } | 384 } |
385 opts.keepalive_secs = val; | |
384 } | 386 } |
385 | 387 |
386 if (idle_timeout_arg) { | 388 if (idle_timeout_arg) { |
387 if (m_str_to_uint(idle_timeout_arg, &opts.idle_timeout_secs) == DROPBEAR_FAILURE) { | 389 unsigned int val; |
390 if (m_str_to_uint(idle_timeout_arg, &val) == DROPBEAR_FAILURE) { | |
388 dropbear_exit("Bad idle_timeout '%s'", idle_timeout_arg); | 391 dropbear_exit("Bad idle_timeout '%s'", idle_timeout_arg); |
389 } | 392 } |
393 opts.idle_timeout_secs = val; | |
390 } | 394 } |
391 | 395 |
392 #ifdef ENABLE_CLI_NETCAT | 396 #ifdef ENABLE_CLI_NETCAT |
393 if (cli_opts.cmd && cli_opts.netcat_host) { | 397 if (cli_opts.cmd && cli_opts.netcat_host) { |
394 dropbear_log(LOG_INFO, "Ignoring command '%s' in netcat mode", cli_opts.cmd); | 398 dropbear_log(LOG_INFO, "Ignoring command '%s' in netcat mode", cli_opts.cmd); |
452 for (iter = cli_opts.privkeys->first; iter; iter = iter->next) | 456 for (iter = cli_opts.privkeys->first; iter; iter = iter->next) |
453 { | 457 { |
454 sign_key * key = (sign_key*)iter->item; | 458 sign_key * key = (sign_key*)iter->item; |
455 const size_t size = len - total; | 459 const size_t size = len - total; |
456 int written = snprintf(ret+total, size, "-i %s", key->filename); | 460 int written = snprintf(ret+total, size, "-i %s", key->filename); |
457 dropbear_assert(written < size); | 461 dropbear_assert((unsigned int)written < size); |
458 total += written; | 462 total += written; |
459 } | 463 } |
460 | 464 |
461 return ret; | 465 return ret; |
462 } | 466 } |