diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-04-13 23:28:01 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-04-13 23:28:01 +0000 |
commit | 5744dc421d035c701b6660a58bed0d038c211375 (patch) | |
tree | a7c8df98b56a37c9be2fb3e33893e90424a85379 /servconf.c | |
parent | 402b3319456c1f0da0822319c3813c68e155726d (diff) |
- beck@cvs.openbsd.org 2001/04/13 22:46:54
[channels.c channels.h servconf.c servconf.h serverloop.c sshd.8]
Add options ClientAliveInterval and ClientAliveCountMax to sshd.
This gives the ability to do a "keepalive" via the encrypted channel
which can't be spoofed (unlike TCP keepalives). Useful for when you want
to use ssh connections to authenticate people for something, and know
relatively quickly when they are no longer authenticated. Disabled
by default (of course). ok markus@
Diffstat (limited to 'servconf.c')
-rw-r--r-- | servconf.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/servconf.c b/servconf.c index f3d5068c0..f978c632b 100644 --- a/servconf.c +++ b/servconf.c | |||
@@ -10,7 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include "includes.h" | 12 | #include "includes.h" |
13 | RCSID("$OpenBSD: servconf.c,v 1.76 2001/04/12 20:09:37 stevesk Exp $"); | 13 | RCSID("$OpenBSD: servconf.c,v 1.77 2001/04/13 22:46:53 beck Exp $"); |
14 | 14 | ||
15 | #ifdef KRB4 | 15 | #ifdef KRB4 |
16 | #include <krb.h> | 16 | #include <krb.h> |
@@ -99,6 +99,8 @@ initialize_server_options(ServerOptions *options) | |||
99 | options->max_startups = -1; | 99 | options->max_startups = -1; |
100 | options->banner = NULL; | 100 | options->banner = NULL; |
101 | options->reverse_mapping_check = -1; | 101 | options->reverse_mapping_check = -1; |
102 | options->client_alive_interval = -1; | ||
103 | options->client_alive_count_max = -1; | ||
102 | } | 104 | } |
103 | 105 | ||
104 | void | 106 | void |
@@ -201,6 +203,10 @@ fill_default_server_options(ServerOptions *options) | |||
201 | options->max_startups_begin = options->max_startups; | 203 | options->max_startups_begin = options->max_startups; |
202 | if (options->reverse_mapping_check == -1) | 204 | if (options->reverse_mapping_check == -1) |
203 | options->reverse_mapping_check = 0; | 205 | options->reverse_mapping_check = 0; |
206 | if (options->client_alive_interval == -1) | ||
207 | options->client_alive_interval = 0; | ||
208 | if (options->client_alive_count_max == -1) | ||
209 | options->client_alive_count_max = 3; | ||
204 | } | 210 | } |
205 | 211 | ||
206 | /* Keyword tokens. */ | 212 | /* Keyword tokens. */ |
@@ -225,7 +231,8 @@ typedef enum { | |||
225 | sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile, | 231 | sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile, |
226 | sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem, sMaxStartups, | 232 | sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem, sMaxStartups, |
227 | sBanner, sReverseMappingCheck, sHostbasedAuthentication, | 233 | sBanner, sReverseMappingCheck, sHostbasedAuthentication, |
228 | sHostbasedUsesNameFromPacketOnly | 234 | sHostbasedUsesNameFromPacketOnly, sClientAliveInterval, |
235 | sClientAliveCountMax | ||
229 | } ServerOpCodes; | 236 | } ServerOpCodes; |
230 | 237 | ||
231 | /* Textual representation of the tokens. */ | 238 | /* Textual representation of the tokens. */ |
@@ -289,6 +296,8 @@ static struct { | |||
289 | { "maxstartups", sMaxStartups }, | 296 | { "maxstartups", sMaxStartups }, |
290 | { "banner", sBanner }, | 297 | { "banner", sBanner }, |
291 | { "reversemappingcheck", sReverseMappingCheck }, | 298 | { "reversemappingcheck", sReverseMappingCheck }, |
299 | { "clientaliveinterval", sClientAliveInterval }, | ||
300 | { "clientalivecountmax", sClientAliveCountMax }, | ||
292 | { NULL, 0 } | 301 | { NULL, 0 } |
293 | }; | 302 | }; |
294 | 303 | ||
@@ -792,7 +801,12 @@ parse_flag: | |||
792 | case sBanner: | 801 | case sBanner: |
793 | charptr = &options->banner; | 802 | charptr = &options->banner; |
794 | goto parse_filename; | 803 | goto parse_filename; |
795 | 804 | case sClientAliveInterval: | |
805 | intptr = &options->client_alive_interval; | ||
806 | goto parse_int; | ||
807 | case sClientAliveCountMax: | ||
808 | intptr = &options->client_alive_count_max; | ||
809 | goto parse_int; | ||
796 | default: | 810 | default: |
797 | fprintf(stderr, "%s line %d: Missing handler for opcode %s (%d)\n", | 811 | fprintf(stderr, "%s line %d: Missing handler for opcode %s (%d)\n", |
798 | filename, linenum, arg, opcode); | 812 | filename, linenum, arg, opcode); |