summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/servconf.c
diff options
context:
space:
mode:
authorKevin Steves <stevesk@cvs.openbsd.org>2001-05-19 19:43:58 +0000
committerKevin Steves <stevesk@cvs.openbsd.org>2001-05-19 19:43:58 +0000
commit8f4395cd1608d535aa18fa6d47731ee13812c2dc (patch)
treeeafa426471bf4669296b2271515f2e068eab227b /usr.bin/ssh/servconf.c
parenta83d8a05387fb52221c99da8fdf6cbacf1e87aa4 (diff)
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: <none>,s,m,h,d,w Examples: 600 600 seconds (10 minutes) 10m 10 minutes 1h30m 1 hour 30 minutes (90 minutes) ok markus@
Diffstat (limited to 'usr.bin/ssh/servconf.c')
-rw-r--r--usr.bin/ssh/servconf.c21
1 files changed, 17 insertions, 4 deletions
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 <krb.h>
@@ -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);