summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-09-08 12:04:34 -0400
committerNick Mathewson <nickm@torproject.org>2011-11-30 14:08:11 -0500
commitff3eb8e023f79edf7b04bf12f770bb3df558c033 (patch)
tree7f1cff3f28733d00b2277ad601120d5ae4d54c03
parent69d16900aaf1d54b44d2b28514a09873154c63d3 (diff)
downloadtor-ff3eb8e023f79edf7b04bf12f770bb3df558c033.tar.gz
tor-ff3eb8e023f79edf7b04bf12f770bb3df558c033.zip
Forbid remapping of *
It might be nice to support this someday, but for now it would fail with an infinite remap cycle. (If I say "remap * *.foo.exit", then example.com -> example.com.foo.exit -> example.com.foo.exit.foo.exit -> example.com.foo.exit.foo.exit.foo.exit -> ...)
-rw-r--r--src/or/config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index ef54dcbff2..f841f932c5 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -4477,6 +4477,11 @@ config_register_addressmaps(const or_options_t *options)
goto cleanup;
}
+ if (!strcmp(to, "*") || !strcmp(from, "*")) {
+ log_warn(LD_CONFIG,"MapAddress '%s' is unsupported - can't remap from "
+ "or to *. Ignoring.",opt->value);
+ goto cleanup;
+ }
/* Detect asterisks in expressions of type: '*.example.com' */
if (!strncmp(from,"*.",2)) {
from += 2;