diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2016-05-03 15:57:40 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2016-05-03 15:57:40 +0000 |
commit | 7ac93f82c3a63e2bd368977aba80fbac2dab61fc (patch) | |
tree | 0e02303430819d64d35f0347cde9f9fa72bd491e /usr.bin/ssh/servconf.c | |
parent | 7243a618a3802bcd26007be53984a83620232a23 (diff) |
fix overriding of StreamLocalBindMask and StreamLocalBindUnlink in
Match blocks; found the hard way Rogan Dawes
Diffstat (limited to 'usr.bin/ssh/servconf.c')
-rw-r--r-- | usr.bin/ssh/servconf.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c index d61d96767ed..631dc538598 100644 --- a/usr.bin/ssh/servconf.c +++ b/usr.bin/ssh/servconf.c @@ -1,5 +1,5 @@ -/* $OpenBSD: servconf.c,v 1.288 2016/05/03 15:25:06 djm Exp $ */ +/* $OpenBSD: servconf.c,v 1.289 2016/05/03 15:57:39 djm Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * All rights reserved @@ -1942,6 +1942,7 @@ copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth) M_CP_INTOPT(allow_agent_forwarding); M_CP_INTOPT(permit_tun); M_CP_INTOPT(fwd_opts.gateway_ports); + M_CP_INTOPT(fwd_opts.streamlocal_bind_unlink); M_CP_INTOPT(x11_display_offset); M_CP_INTOPT(x11_forwarding); M_CP_INTOPT(x11_use_localhost); @@ -1954,6 +1955,16 @@ copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth) M_CP_INTOPT(rekey_limit); M_CP_INTOPT(rekey_interval); + /* + * The bind_mask is a mode_t that may be unsigned, so we can't use + * M_CP_INTOPT - it does a signed comparison that causes compiler + * warnings. + */ + if (src->fwd_opts.streamlocal_bind_mask == (mode_t)-1) { + dst->fwd_opts.streamlocal_bind_mask = + src->fwd_opts.streamlocal_bind_mask; + } + /* M_CP_STROPT and M_CP_STRARRAYOPT should not appear before here */ #define M_CP_STROPT(n) do {\ if (src->n != NULL && dst->n != src->n) { \ |