summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-01-06 14:15:08 -0500
committerNick Mathewson <nickm@torproject.org>2015-01-06 14:15:08 -0500
commita034863b45455a2def6d957d54bec2530db4a1a6 (patch)
treefd3ac9af55713244202a1bcb06c5f5a73bc16e40
parentfcc78e5f8a3249eadfea31db1aca6884b31c1873 (diff)
parent8ef6cdc39f047a7579858a6e23629c1c2718fc0a (diff)
downloadtor-a034863b45455a2def6d957d54bec2530db4a1a6.tar.gz
tor-a034863b45455a2def6d957d54bec2530db4a1a6.zip
Merge remote-tracking branch 'public/bug12509_025'
-rw-r--r--changes/bug125094
-rw-r--r--src/or/addressmap.c2
-rw-r--r--src/or/config.c9
-rw-r--r--src/or/or.h5
4 files changed, 9 insertions, 11 deletions
diff --git a/changes/bug12509 b/changes/bug12509
new file mode 100644
index 0000000000..8d5c1dd484
--- /dev/null
+++ b/changes/bug12509
@@ -0,0 +1,4 @@
+
+ o Minor bugfixes (automapping):
+ - Prevent changes to other optoins from removing the wildcard value "."
+ from "AutomapHostsSuffixes".
diff --git a/src/or/addressmap.c b/src/or/addressmap.c
index 8753492b4b..8ad24323b5 100644
--- a/src/or/addressmap.c
+++ b/src/or/addressmap.c
@@ -230,6 +230,8 @@ addressmap_address_should_automap(const char *address,
return 0;
SMARTLIST_FOREACH_BEGIN(suffix_list, const char *, suffix) {
+ if (!strcmp(suffix, "."))
+ return 1;
if (!strcasecmpend(address, suffix))
return 1;
} SMARTLIST_FOREACH_END(suffix);
diff --git a/src/or/config.c b/src/or/config.c
index 38f4981359..be0bfc7687 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -3530,15 +3530,6 @@ options_validate(or_options_t *old_options, or_options_t *options,
AF_INET6, 1, msg)<0)
return -1;
- if (options->AutomapHostsSuffixes) {
- SMARTLIST_FOREACH(options->AutomapHostsSuffixes, char *, suf,
- {
- size_t len = strlen(suf);
- if (len && suf[len-1] == '.')
- suf[len-1] = '\0';
- });
- }
-
if (options->TestingTorNetwork &&
!(options->DirAuthorities ||
(options->AlternateDirAuthority &&
diff --git a/src/or/or.h b/src/or/or.h
index 3ecb380eec..c0ecadc0e2 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3675,8 +3675,9 @@ typedef struct {
* hostname ending with one of the suffixes in
* <b>AutomapHostsSuffixes</b>, map it to a
* virtual address. */
- smartlist_t *AutomapHostsSuffixes; /**< List of suffixes for
- * <b>AutomapHostsOnResolve</b>. */
+ /** List of suffixes for <b>AutomapHostsOnResolve</b>. The special value
+ * "." means "match everything." */
+ smartlist_t *AutomapHostsSuffixes;
int RendPostPeriod; /**< How often do we post each rendezvous service
* descriptor? Remember to publish them independently. */
int KeepalivePeriod; /**< How often do we send padding cells to keep