diff options
author | Roger Dingledine <arma@torproject.org> | 2007-12-09 04:59:27 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-12-09 04:59:27 +0000 |
commit | 6dfd47467eb7628c1d87e0b9235880564b31d85c (patch) | |
tree | 658f3df9f080a3fd7048f82b8f74c3302b152d8e /src/or/config.c | |
parent | 9b162ef4302881de7c8da7712fedbdd6da9c95df (diff) | |
download | tor-6dfd47467eb7628c1d87e0b9235880564b31d85c.tar.gz tor-6dfd47467eb7628c1d87e0b9235880564b31d85c.zip |
Allow multiple HashedControlPassword config lines, to support
multiple controller passwords.
svn:r12732
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c index d37bb64f76..f6f7b78b6b 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -187,7 +187,7 @@ static config_var_t _option_vars[] = { V(FetchUselessDescriptors, BOOL, "0"), V(Group, STRING, NULL), V(HardwareAccel, BOOL, "0"), - V(HashedControlPassword, STRING, NULL), + V(HashedControlPassword, LINELIST, NULL), V(HidServDirectoryV2, BOOL, "0"), VAR("HiddenServiceDir", LINELIST_S, RendConfigLines, NULL), VAR("HiddenServiceExcludeNodes", LINELIST_S, RendConfigLines, NULL), @@ -2939,8 +2939,13 @@ options_validate(or_options_t *old_options, or_options_t *options, } if (options->HashedControlPassword) { - if (decode_hashed_password(NULL, options->HashedControlPassword)<0) + smartlist_t *sl = decode_hashed_passwords(options->HashedControlPassword); + if (!sl) { REJECT("Bad HashedControlPassword: wrong length or bad encoding"); + } else { + SMARTLIST_FOREACH(sl, char*, cp, tor_free(cp)); + smartlist_free(sl); + } } if (options->ControlListenAddress) { |