diff options
author | Damien Miller <djm@mindrot.org> | 2011-05-20 19:04:14 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2011-05-20 19:04:14 +1000 |
commit | f2e407e2dd83addc26b68b4218d8b6ceaceca54b (patch) | |
tree | b059a9e677f7bcb911da414f621a03f672dd1412 /monitor.c | |
parent | c2411909c7ff298744998e00c7a5f1f64fbb0349 (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.c')
-rw-r--r-- | monitor.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: monitor.c,v 1.111 2011/05/15 08:09:01 djm Exp $ */ | 1 | /* $OpenBSD: monitor.c,v 1.112 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> |
@@ -671,8 +671,15 @@ mm_answer_pwnamallow(int sock, Buffer *m) | |||
671 | 671 | ||
672 | out: | 672 | out: |
673 | buffer_put_string(m, &options, sizeof(options)); | 673 | buffer_put_string(m, &options, sizeof(options)); |
674 | if (options.banner != NULL) | 674 | |
675 | buffer_put_cstring(m, options.banner); | 675 | #define M_CP_STROPT(x) do { \ |
676 | if (options.x != NULL) \ | ||
677 | buffer_put_cstring(m, options.x); \ | ||
678 | } while (0) | ||
679 | /* See comment in servconf.h */ | ||
680 | COPY_MATCH_STRING_OPTS(); | ||
681 | #undef M_CP_STROPT | ||
682 | |||
676 | debug3("%s: sending MONITOR_ANS_PWNAM: %d", __func__, allowed); | 683 | debug3("%s: sending MONITOR_ANS_PWNAM: %d", __func__, allowed); |
677 | mm_request_send(sock, MONITOR_ANS_PWNAM, m); | 684 | mm_request_send(sock, MONITOR_ANS_PWNAM, m); |
678 | 685 | ||