summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Ball <chris@printf.net>2010-07-31 18:06:40 -0400
committerNick Mathewson <nickm@torproject.org>2010-08-02 12:02:06 -0400
commit600ba86f4a1d15ae6037246a1715f995e4b0f5b0 (patch)
treea86d9c47f5c9d14393371296afbd60173f69964d /src
parentfbfaa7bbc417d7adc19dc55154a8648fe6412ec6 (diff)
downloadtor-600ba86f4a1d15ae6037246a1715f995e4b0f5b0.tar.gz
tor-600ba86f4a1d15ae6037246a1715f995e4b0f5b0.zip
Bug #1107: Complain if PublishServerDescriptor receives 0 or 1 in a list
0 or 1 should only be passed as the sole argument. Warn for now, reject in 0.2.3.x.
Diffstat (limited to 'src')
-rw-r--r--src/or/config.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index a4e4f89c1a..fc8455656b 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -3578,6 +3578,18 @@ options_validate(or_options_t *old_options, or_options_t *options,
if (options->AccelDir && !options->AccelName)
REJECT("Can't use hardware crypto accelerator dir without engine name.");
+ if (options->PublishServerDescriptor)
+ SMARTLIST_FOREACH(options->PublishServerDescriptor, const char *, pubdes, {
+ if (!strcmp(pubdes, "1") || !strcmp(pubdes, "0"))
+ if (smartlist_len(options->PublishServerDescriptor) > 1) {
+ COMPLAIN("You have passed a list of multiple arguments to the "
+ "PublishServerDescriptor option that includes 0 or 1. "
+ "0 or 1 should only be used as the sole argument. "
+ "This configuration will be rejected in a future release.");
+ break;
+ }
+ });
+
return 0;
#undef REJECT
#undef COMPLAIN