summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--monitor.c4
-rw-r--r--monitor_wrap.c8
-rw-r--r--servconf.c10
-rw-r--r--servconf.h4
4 files changed, 21 insertions, 5 deletions
diff --git a/monitor.c b/monitor.c
index bdb4e8552..f517da482 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor.c,v 1.173 2017/09/12 06:32:07 djm Exp $ */ 1/* $OpenBSD: monitor.c,v 1.174 2017/10/02 19:33:20 djm Exp $ */
2/* 2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * Copyright 2002 Markus Friedl <markus@openbsd.org> 4 * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -760,10 +760,12 @@ mm_answer_pwnamallow(int sock, Buffer *m)
760 for (i = 0; i < options.nx; i++) \ 760 for (i = 0; i < options.nx; i++) \
761 buffer_put_cstring(m, options.x[i]); \ 761 buffer_put_cstring(m, options.x[i]); \
762 } while (0) 762 } while (0)
763#define M_CP_STRARRAYOPT_ALLOC(x, nx) M_CP_STRARRAYOPT(x, nx)
763 /* See comment in servconf.h */ 764 /* See comment in servconf.h */
764 COPY_MATCH_STRING_OPTS(); 765 COPY_MATCH_STRING_OPTS();
765#undef M_CP_STROPT 766#undef M_CP_STROPT
766#undef M_CP_STRARRAYOPT 767#undef M_CP_STRARRAYOPT
768#undef M_CP_STRARRAYOPT_ALLOC
767 769
768 /* Create valid auth method lists */ 770 /* Create valid auth method lists */
769 if (auth2_setup_methods_lists(authctxt) != 0) { 771 if (auth2_setup_methods_lists(authctxt) != 0) {
diff --git a/monitor_wrap.c b/monitor_wrap.c
index 287af0667..69212aaf3 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_wrap.c,v 1.93 2017/09/12 06:32:07 djm Exp $ */ 1/* $OpenBSD: monitor_wrap.c,v 1.94 2017/10/02 19:33:20 djm Exp $ */
2/* 2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * Copyright 2002 Markus Friedl <markus@openbsd.org> 4 * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -290,10 +290,16 @@ out:
290 for (i = 0; i < newopts->nx; i++) \ 290 for (i = 0; i < newopts->nx; i++) \
291 newopts->x[i] = buffer_get_string(&m, NULL); \ 291 newopts->x[i] = buffer_get_string(&m, NULL); \
292 } while (0) 292 } while (0)
293#define M_CP_STRARRAYOPT_ALLOC(x, nx) do { \
294 newopts->x = newopts->nx == 0 ? \
295 NULL : xcalloc(newopts->nx, sizeof(*newopts->x)); \
296 M_CP_STRARRAYOPT(x, nx); \
297 } while (0)
293 /* See comment in servconf.h */ 298 /* See comment in servconf.h */
294 COPY_MATCH_STRING_OPTS(); 299 COPY_MATCH_STRING_OPTS();
295#undef M_CP_STROPT 300#undef M_CP_STROPT
296#undef M_CP_STRARRAYOPT 301#undef M_CP_STRARRAYOPT
302#undef M_CP_STRARRAYOPT_ALLOC
297 303
298 copy_set_server_options(&options, newopts, 1); 304 copy_set_server_options(&options, newopts, 1);
299 log_change_level(options.log_level); 305 log_change_level(options.log_level);
diff --git a/servconf.c b/servconf.c
index 16436512e..2c321a4ad 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,5 +1,5 @@
1 1
2/* $OpenBSD: servconf.c,v 1.311 2017/09/18 09:41:52 dtucker Exp $ */ 2/* $OpenBSD: servconf.c,v 1.312 2017/10/02 19:33:20 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
@@ -2063,6 +2063,13 @@ copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth)
2063 dst->n[dst->num_n] = xstrdup(src->n[dst->num_n]); \ 2063 dst->n[dst->num_n] = xstrdup(src->n[dst->num_n]); \
2064 } \ 2064 } \
2065} while(0) 2065} while(0)
2066#define M_CP_STRARRAYOPT_ALLOC(n, num_n) do { \
2067 if (src->num_n != 0) { \
2068 dst->n = xcalloc(src->num_n, sizeof(*dst->n)); \
2069 M_CP_STRARRAYOPT(n, num_n); \
2070 dst->num_n = src->num_n; \
2071 } \
2072} while(0)
2066 2073
2067 /* See comment in servconf.h */ 2074 /* See comment in servconf.h */
2068 COPY_MATCH_STRING_OPTS(); 2075 COPY_MATCH_STRING_OPTS();
@@ -2093,6 +2100,7 @@ copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth)
2093#undef M_CP_INTOPT 2100#undef M_CP_INTOPT
2094#undef M_CP_STROPT 2101#undef M_CP_STROPT
2095#undef M_CP_STRARRAYOPT 2102#undef M_CP_STRARRAYOPT
2103#undef M_CP_STRARRAYOPT_ALLOC
2096 2104
2097void 2105void
2098parse_server_config(ServerOptions *options, const char *filename, Buffer *conf, 2106parse_server_config(ServerOptions *options, const char *filename, Buffer *conf,
diff --git a/servconf.h b/servconf.h
index ffcbc3319..1dca702e6 100644
--- a/servconf.h
+++ b/servconf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: servconf.h,v 1.125 2017/09/12 06:32:07 djm Exp $ */ 1/* $OpenBSD: servconf.h,v 1.126 2017/10/02 19:33:20 djm Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -237,7 +237,7 @@ struct connection_info {
237 M_CP_STRARRAYOPT(deny_groups, num_deny_groups); \ 237 M_CP_STRARRAYOPT(deny_groups, num_deny_groups); \
238 M_CP_STRARRAYOPT(accept_env, num_accept_env); \ 238 M_CP_STRARRAYOPT(accept_env, num_accept_env); \
239 M_CP_STRARRAYOPT(auth_methods, num_auth_methods); \ 239 M_CP_STRARRAYOPT(auth_methods, num_auth_methods); \
240 M_CP_STRARRAYOPT(permitted_opens, num_permitted_opens); \ 240 M_CP_STRARRAYOPT_ALLOC(permitted_opens, num_permitted_opens); \
241 } while (0) 241 } while (0)
242 242
243struct connection_info *get_connection_info(int, int); 243struct connection_info *get_connection_info(int, int);