summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2017-10-04 18:49:30 +0000
committerDamien Miller <djm@mindrot.org>2017-10-05 05:51:12 +1100
commit69bda0228861f3dacd4fb3d28b60ce9d103d254b (patch)
tree167fe7fafb4220f11e7f6548cfac9e01da8d4823
parent66bf74a92131b7effe49fb0eefe5225151869dc5 (diff)
upstream commit
fix (another) problem in PermitOpen introduced during the channels.c refactor: the third and subsequent arguments to PermitOpen were being silently ignored; ok markus@ Upstream-ID: 067c89f1f53cbc381628012ba776d6861e6782fd
-rw-r--r--servconf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/servconf.c b/servconf.c
index 2c321a4ad..956862959 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,5 +1,5 @@
1 1
2/* $OpenBSD: servconf.c,v 1.312 2017/10/02 19:33:20 djm Exp $ */ 2/* $OpenBSD: servconf.c,v 1.313 2017/10/04 18:49:30 djm Exp $ */
3/* 3/*
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 * All rights reserved 5 * All rights reserved
@@ -1663,9 +1663,9 @@ process_server_config_line(ServerOptions *options, char *line,
1663 if (!arg || *arg == '\0') 1663 if (!arg || *arg == '\0')
1664 fatal("%s line %d: missing PermitOpen specification", 1664 fatal("%s line %d: missing PermitOpen specification",
1665 filename, linenum); 1665 filename, linenum);
1666 i = options->num_permitted_opens; /* modified later */ 1666 value = options->num_permitted_opens; /* modified later */
1667 if (strcmp(arg, "any") == 0 || strcmp(arg, "none") == 0) { 1667 if (strcmp(arg, "any") == 0 || strcmp(arg, "none") == 0) {
1668 if (*activep && i == 0) { 1668 if (*activep && value == 0) {
1669 options->num_permitted_opens = 1; 1669 options->num_permitted_opens = 1;
1670 options->permitted_opens = xcalloc(1, 1670 options->permitted_opens = xcalloc(1,
1671 sizeof(*options->permitted_opens)); 1671 sizeof(*options->permitted_opens));
@@ -1683,7 +1683,7 @@ process_server_config_line(ServerOptions *options, char *line,
1683 if (arg == NULL || ((port = permitopen_port(arg)) < 0)) 1683 if (arg == NULL || ((port = permitopen_port(arg)) < 0))
1684 fatal("%s line %d: bad port number in " 1684 fatal("%s line %d: bad port number in "
1685 "PermitOpen", filename, linenum); 1685 "PermitOpen", filename, linenum);
1686 if (*activep && i == 0) { 1686 if (*activep && value == 0) {
1687 options->permitted_opens = xrecallocarray( 1687 options->permitted_opens = xrecallocarray(
1688 options->permitted_opens, 1688 options->permitted_opens,
1689 options->num_permitted_opens, 1689 options->num_permitted_opens,