]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Forbid remapping of *
authorNick Mathewson <nickm@torproject.org>
Thu, 8 Sep 2011 16:04:34 +0000 (12:04 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 30 Nov 2011 19:08:11 +0000 (14:08 -0500)
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 -> ...)

src/or/config.c

index ef54dcbff2ac85b6f8b4958e6651afc5e29c5835..f841f932c5f497255c65790bbafc544e864c19c4 100644 (file)
@@ -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;