summaryrefslogtreecommitdiff
path: root/monitor_wrap.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2011-05-20 19:04:14 +1000
committerDamien Miller <djm@mindrot.org>2011-05-20 19:04:14 +1000
commitf2e407e2dd83addc26b68b4218d8b6ceaceca54b (patch)
treeb059a9e677f7bcb911da414f621a03f672dd1412 /monitor_wrap.c
parentc2411909c7ff298744998e00c7a5f1f64fbb0349 (diff)
- djm@cvs.openbsd.org 2011/05/20 03:25:45
[monitor.c monitor_wrap.c servconf.c servconf.h] use a macro to define which string options to copy between configs for Match. This avoids problems caused by forgetting to keep three code locations in perfect sync and ordering "this is at once beautiful and horrible" + ok dtucker@
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r--monitor_wrap.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c
index 1a5dda561..d3f274021 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_wrap.c,v 1.70 2010/08/31 11:54:45 djm Exp $ */ 1/* $OpenBSD: monitor_wrap.c,v 1.71 2011/05/20 03:25:45 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>
@@ -245,8 +245,15 @@ out:
245 newopts = buffer_get_string(&m, &len); 245 newopts = buffer_get_string(&m, &len);
246 if (len != sizeof(*newopts)) 246 if (len != sizeof(*newopts))
247 fatal("%s: option block size mismatch", __func__); 247 fatal("%s: option block size mismatch", __func__);
248 if (newopts->banner != NULL) 248
249 newopts->banner = buffer_get_string(&m, NULL); 249#define M_CP_STROPT(x) do { \
250 if (newopts->x != NULL) \
251 newopts->x = buffer_get_string(&m, NULL); \
252 } while (0)
253 /* See comment in servconf.h */
254 COPY_MATCH_STRING_OPTS();
255#undef M_CP_STROPT
256
250 copy_set_server_options(&options, newopts, 1); 257 copy_set_server_options(&options, newopts, 1);
251 xfree(newopts); 258 xfree(newopts);
252 259