summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-05-25 20:06:09 +0000
committerRoger Dingledine <arma@torproject.org>2006-05-25 20:06:09 +0000
commita4cdb834b9896a1a0864506ee8a084135945dd53 (patch)
treedb2f66b3752c8aeee9352cba58836ad3aacdf1c1
parent3cd01ca9a1c25c65088fe819d07b04f2c2e0d140 (diff)
downloadtor-a4cdb834b9896a1a0864506ee8a084135945dd53.tar.gz
tor-a4cdb834b9896a1a0864506ee8a084135945dd53.zip
Stop being picky about what the arguments to mapaddress look like.
we were refusing names that had $ in them, which people who specify $key.exit will be sad about. There are likely other examples. If people can think of reasons why we should be picky, let me know. svn:r6496
-rw-r--r--src/common/util.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 433dd7d7fb..b507691521 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1697,8 +1697,9 @@ tor_dup_addr(uint32_t addr)
return tor_strdup(buf);
}
-/* Return true iff <b>name</b> looks like it might be a hostname or IP
- * address of some kind. */
+/* Return true iff <b>name</b> looks like it might be a hostname,
+ * nickname, key, or IP address of some kind, suitable for the
+ * controller's "mapaddress" command. */
int
is_plausible_address(const char *name)
{
@@ -1707,10 +1708,12 @@ is_plausible_address(const char *name)
/* We could check better here. */
if (!*name)
return 0;
+#if 0
for (cp=name; *cp; cp++) {
if (*cp != '.' && *cp != '-' && !TOR_ISALNUM(*cp))
return 0;
}
+#endif
return 1;
}