summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2016-05-03 15:57:39 +0000
committerDamien Miller <djm@mindrot.org>2016-05-04 01:58:46 +1000
commitcfefbcea1057c2623e76c579174a4107a0b6e6cd (patch)
tree8835a5213d781c0ea372b7d57bdc0afdf70de47b
parent771c2f51ffc0c9a2877b7892fada0c77bd1f6549 (diff)
upstream commit
fix overriding of StreamLocalBindMask and StreamLocalBindUnlink in Match blocks; found the hard way Rogan Dawes Upstream-ID: 940bc69ec0249ab428d24ccd0722ce35cb932ee2
-rw-r--r--servconf.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/servconf.c b/servconf.c
index 01750a6c8..c064d0b59 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,5 +1,5 @@
1 1
2/* $OpenBSD: servconf.c,v 1.288 2016/05/03 15:25:06 djm Exp $ */ 2/* $OpenBSD: servconf.c,v 1.289 2016/05/03 15:57:39 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
@@ -1994,6 +1994,7 @@ copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth)
1994 M_CP_INTOPT(allow_agent_forwarding); 1994 M_CP_INTOPT(allow_agent_forwarding);
1995 M_CP_INTOPT(permit_tun); 1995 M_CP_INTOPT(permit_tun);
1996 M_CP_INTOPT(fwd_opts.gateway_ports); 1996 M_CP_INTOPT(fwd_opts.gateway_ports);
1997 M_CP_INTOPT(fwd_opts.streamlocal_bind_unlink);
1997 M_CP_INTOPT(x11_display_offset); 1998 M_CP_INTOPT(x11_display_offset);
1998 M_CP_INTOPT(x11_forwarding); 1999 M_CP_INTOPT(x11_forwarding);
1999 M_CP_INTOPT(x11_use_localhost); 2000 M_CP_INTOPT(x11_use_localhost);
@@ -2006,6 +2007,16 @@ copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth)
2006 M_CP_INTOPT(rekey_limit); 2007 M_CP_INTOPT(rekey_limit);
2007 M_CP_INTOPT(rekey_interval); 2008 M_CP_INTOPT(rekey_interval);
2008 2009
2010 /*
2011 * The bind_mask is a mode_t that may be unsigned, so we can't use
2012 * M_CP_INTOPT - it does a signed comparison that causes compiler
2013 * warnings.
2014 */
2015 if (src->fwd_opts.streamlocal_bind_mask == (mode_t)-1) {
2016 dst->fwd_opts.streamlocal_bind_mask =
2017 src->fwd_opts.streamlocal_bind_mask;
2018 }
2019
2009 /* M_CP_STROPT and M_CP_STRARRAYOPT should not appear before here */ 2020 /* M_CP_STROPT and M_CP_STRARRAYOPT should not appear before here */
2010#define M_CP_STROPT(n) do {\ 2021#define M_CP_STROPT(n) do {\
2011 if (src->n != NULL && dst->n != src->n) { \ 2022 if (src->n != NULL && dst->n != src->n) { \