Mercurial > dropbear
comparison svr-runopts.c @ 1834:94dc11094e26
Increase max window size to 10MB, fallback rather than
exiting if an invalid value is given.
author | Matt Johnston <matt@codeconstruct.com.au> |
---|---|
date | Tue, 12 Oct 2021 23:32:10 +0800 |
parents | 5120e22882de |
children | 35d504d59c05 |
comparison
equal
deleted
inserted
replaced
1833:870f6e386a0b | 1834:94dc11094e26 |
---|---|
98 "-P PidFile Create pid file PidFile\n" | 98 "-P PidFile Create pid file PidFile\n" |
99 " (default %s)\n" | 99 " (default %s)\n" |
100 #if INETD_MODE | 100 #if INETD_MODE |
101 "-i Start for inetd\n" | 101 "-i Start for inetd\n" |
102 #endif | 102 #endif |
103 "-W <receive_window_buffer> (default %d, larger may be faster, max 1MB)\n" | 103 "-W <receive_window_buffer> (default %d, larger may be faster, max 10MB)\n" |
104 "-K <keepalive> (0 is never, default %d, in seconds)\n" | 104 "-K <keepalive> (0 is never, default %d, in seconds)\n" |
105 "-I <idle_timeout> (0 is never, default %d, in seconds)\n" | 105 "-I <idle_timeout> (0 is never, default %d, in seconds)\n" |
106 #if DROPBEAR_PLUGIN | 106 #if DROPBEAR_PLUGIN |
107 "-A <authplugin>[,<options>]\n" | 107 "-A <authplugin>[,<options>]\n" |
108 " Enable external public key auth through <authplugin>\n" | 108 " Enable external public key auth through <authplugin>\n" |
383 } else { | 383 } else { |
384 dropbear_exit("Cannot restrict logins to group '%s' as the group does not exist", svr_opts.restrict_group); | 384 dropbear_exit("Cannot restrict logins to group '%s' as the group does not exist", svr_opts.restrict_group); |
385 } | 385 } |
386 } | 386 } |
387 #endif | 387 #endif |
388 | 388 |
389 if (recv_window_arg) { | 389 if (recv_window_arg) { |
390 opts.recv_window = atol(recv_window_arg); | 390 parse_recv_window(recv_window_arg); |
391 if (opts.recv_window == 0 || opts.recv_window > MAX_RECV_WINDOW) { | |
392 dropbear_exit("Bad recv window '%s'", recv_window_arg); | |
393 } | |
394 } | 391 } |
395 | 392 |
396 if (maxauthtries_arg) { | 393 if (maxauthtries_arg) { |
397 unsigned int val = 0; | 394 unsigned int val = 0; |
398 if (m_str_to_uint(maxauthtries_arg, &val) == DROPBEAR_FAILURE | 395 if (m_str_to_uint(maxauthtries_arg, &val) == DROPBEAR_FAILURE |
400 dropbear_exit("Bad maxauthtries '%s'", maxauthtries_arg); | 397 dropbear_exit("Bad maxauthtries '%s'", maxauthtries_arg); |
401 } | 398 } |
402 svr_opts.maxauthtries = val; | 399 svr_opts.maxauthtries = val; |
403 } | 400 } |
404 | 401 |
405 | 402 |
406 if (keepalive_arg) { | 403 if (keepalive_arg) { |
407 unsigned int val; | 404 unsigned int val; |
408 if (m_str_to_uint(keepalive_arg, &val) == DROPBEAR_FAILURE) { | 405 if (m_str_to_uint(keepalive_arg, &val) == DROPBEAR_FAILURE) { |
409 dropbear_exit("Bad keepalive '%s'", keepalive_arg); | 406 dropbear_exit("Bad keepalive '%s'", keepalive_arg); |
410 } | 407 } |