diff options
author | Damien Miller <djm@mindrot.org> | 2007-01-05 16:28:36 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2007-01-05 16:28:36 +1100 |
commit | a29b95ec3a0294e62edd7ed26c515bb1a9dc6d6a (patch) | |
tree | 2fbe090b8682544abbf6ca14cfe6a665bdbd4cce /servconf.c | |
parent | 1ec462658edd8bfea2b5cab461bb9d513e29a151 (diff) |
- dtucker@cvs.openbsd.org 2006/12/13 08:34:39
[servconf.c]
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 'servconf.c')
-rw-r--r-- | servconf.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/servconf.c b/servconf.c index 1f80de22d..83b634976 100644 --- a/servconf.c +++ b/servconf.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: servconf.c,v 1.165 2006/08/14 12:40:25 dtucker Exp $ */ | 1 | /* $OpenBSD: servconf.c,v 1.166 2006/12/13 08:34:39 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 3 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
4 | * All rights reserved | 4 | * All rights reserved |
@@ -1227,6 +1227,9 @@ parse_flag: | |||
1227 | } | 1227 | } |
1228 | break; | 1228 | break; |
1229 | } | 1229 | } |
1230 | n = options->num_permitted_opens; /* modified later */ | ||
1231 | if (*activep && n == -1) | ||
1232 | channel_clear_adm_permitted_opens(); | ||
1230 | for (; arg != NULL && *arg != '\0'; arg = strdelim(&cp)) { | 1233 | for (; arg != NULL && *arg != '\0'; arg = strdelim(&cp)) { |
1231 | p = hpdelim(&arg); | 1234 | p = hpdelim(&arg); |
1232 | if (p == NULL) | 1235 | if (p == NULL) |
@@ -1236,11 +1239,9 @@ parse_flag: | |||
1236 | if (arg == NULL || (port = a2port(arg)) == 0) | 1239 | if (arg == NULL || (port = a2port(arg)) == 0) |
1237 | fatal("%s line %d: bad port number in " | 1240 | fatal("%s line %d: bad port number in " |
1238 | "PermitOpen", filename, linenum); | 1241 | "PermitOpen", filename, linenum); |
1239 | if (*activep && options->num_permitted_opens == -1) { | 1242 | if (*activep && n == -1) |
1240 | channel_clear_adm_permitted_opens(); | ||
1241 | options->num_permitted_opens = | 1243 | options->num_permitted_opens = |
1242 | channel_add_adm_permitted_opens(p, port); | 1244 | channel_add_adm_permitted_opens(p, port); |
1243 | } | ||
1244 | } | 1245 | } |
1245 | break; | 1246 | break; |
1246 | 1247 | ||