summaryrefslogtreecommitdiff
path: root/servconf.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2017-10-04 18:49:30 +0000
committerColin Watson <cjwatson@debian.org>2017-10-07 13:41:59 +0100
commite293f21da513a7db59fe1997c9e90e2e9cdbceda (patch)
treefd3abca80474e480adeb28d905400dc3bfd5f6fd /servconf.c
parent801a62eedaaf47b20dbf4b426dc3e084bf0c8d49 (diff)
Fix PermitOpen argument handling
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 Origin: https://anongit.mindrot.org/openssh.git/commit/?id=7c9613fac3371cf65fb07739212cdd1ebf6575da Last-Update: 2017-10-07 Patch-Name: permitopen-argument-handling.patch
Diffstat (limited to 'servconf.c')
-rw-r--r--servconf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/servconf.c b/servconf.c
index 5e996cf8f..9daa182c0 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
@@ -1690,9 +1690,9 @@ process_server_config_line(ServerOptions *options, char *line,
1690 if (!arg || *arg == '\0') 1690 if (!arg || *arg == '\0')
1691 fatal("%s line %d: missing PermitOpen specification", 1691 fatal("%s line %d: missing PermitOpen specification",
1692 filename, linenum); 1692 filename, linenum);
1693 i = options->num_permitted_opens; /* modified later */ 1693 value = options->num_permitted_opens; /* modified later */
1694 if (strcmp(arg, "any") == 0 || strcmp(arg, "none") == 0) { 1694 if (strcmp(arg, "any") == 0 || strcmp(arg, "none") == 0) {
1695 if (*activep && i == 0) { 1695 if (*activep && value == 0) {
1696 options->num_permitted_opens = 1; 1696 options->num_permitted_opens = 1;
1697 options->permitted_opens = xcalloc(1, 1697 options->permitted_opens = xcalloc(1,
1698 sizeof(*options->permitted_opens)); 1698 sizeof(*options->permitted_opens));
@@ -1710,7 +1710,7 @@ process_server_config_line(ServerOptions *options, char *line,
1710 if (arg == NULL || ((port = permitopen_port(arg)) < 0)) 1710 if (arg == NULL || ((port = permitopen_port(arg)) < 0))
1711 fatal("%s line %d: bad port number in " 1711 fatal("%s line %d: bad port number in "
1712 "PermitOpen", filename, linenum); 1712 "PermitOpen", filename, linenum);
1713 if (*activep && i == 0) { 1713 if (*activep && value == 0) {
1714 options->permitted_opens = xrecallocarray( 1714 options->permitted_opens = xrecallocarray(
1715 options->permitted_opens, 1715 options->permitted_opens,
1716 options->num_permitted_opens, 1716 options->num_permitted_opens,