From 8f4395cd1608d535aa18fa6d47731ee13812c2dc Mon Sep 17 00:00:00 2001 From: Kevin Steves Date: Sat, 19 May 2001 19:43:58 +0000 Subject: sshd command-line arguments and configuration file options that specify time may be expressed using a sequence of the form: time[qualifier], where time is a positive integer value and qualifier is one of the following: ,s,m,h,d,w Examples: 600 600 seconds (10 minutes) 10m 10 minutes 1h30m 1 hour 30 minutes (90 minutes) ok markus@ --- usr.bin/ssh/servconf.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'usr.bin/ssh/servconf.c') diff --git a/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c index 40c2e1035df..36c7f601d30 100644 --- a/usr.bin/ssh/servconf.c +++ b/usr.bin/ssh/servconf.c @@ -10,7 +10,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: servconf.c,v 1.80 2001/05/18 14:13:29 markus Exp $"); +RCSID("$OpenBSD: servconf.c,v 1.81 2001/05/19 19:43:57 stevesk Exp $"); #ifdef KRB4 #include @@ -425,11 +425,21 @@ parse_int: case sLoginGraceTime: intptr = &options->login_grace_time; - goto parse_int; +parse_time: + arg = strdelim(&cp); + if (!arg || *arg == '\0') + fatal("%s line %d: missing time value.", + filename, linenum); + if ((value = convtime(arg)) == -1) + fatal("%s line %d: invalid time value.", + filename, linenum); + if (*intptr == -1) + *intptr = value; + break; case sKeyRegenerationTime: intptr = &options->key_regeneration_time; - goto parse_int; + goto parse_time; case sListenAddress: arg = strdelim(&cp); @@ -788,12 +798,15 @@ parse_flag: case sBanner: charptr = &options->banner; goto parse_filename; + case sClientAliveInterval: intptr = &options->client_alive_interval; - goto parse_int; + goto parse_time; + case sClientAliveCountMax: intptr = &options->client_alive_count_max; goto parse_int; + default: fatal("%s line %d: Missing handler for opcode %s (%d)", filename, linenum, arg, opcode); -- cgit v1.2.3