summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2006-12-13 08:34:40 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2006-12-13 08:34:40 +0000
commit5fc0a3f218b71d69f1913cb2243b9d1474231103 (patch)
tree83def0c844c3860d1f58c65fa8c83ae350ed454c /usr.bin
parenta47cbe32d5a8bf07aca6d6d9c94c040d1658f15b (diff)
Make PermitOpen work with multiple values like the man pages says. bz #1267
with details from peter at dmtz.com, with & ok djm@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/servconf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c
index 5cc3ea43dd3..7fbfe5f254b 100644
--- a/usr.bin/ssh/servconf.c
+++ b/usr.bin/ssh/servconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: servconf.c,v 1.165 2006/08/14 12:40:25 dtucker Exp $ */
+/* $OpenBSD: servconf.c,v 1.166 2006/12/13 08:34:39 dtucker Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -1184,6 +1184,9 @@ parse_flag:
}
break;
}
+ n = options->num_permitted_opens; /* modified later */
+ if (*activep && n == -1)
+ channel_clear_adm_permitted_opens();
for (; arg != NULL && *arg != '\0'; arg = strdelim(&cp)) {
p = hpdelim(&arg);
if (p == NULL)
@@ -1193,11 +1196,9 @@ parse_flag:
if (arg == NULL || (port = a2port(arg)) == 0)
fatal("%s line %d: bad port number in "
"PermitOpen", filename, linenum);
- if (*activep && options->num_permitted_opens == -1) {
- channel_clear_adm_permitted_opens();
+ if (*activep && n == -1)
options->num_permitted_opens =
channel_add_adm_permitted_opens(p, port);
- }
}
break;