diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-11-30 03:12:37 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-11-30 03:12:37 +0000 |
commit | fd68834b17fd5a83101f47c12102aec4517b7b27 (patch) | |
tree | 5b3d310f1e63e6006493c0c3a84d72aded4794f5 /src/tools | |
parent | ad7db5e43ada3f3e192b537279b26f7c979cbaa2 (diff) | |
download | tor-fd68834b17fd5a83101f47c12102aec4517b7b27.tar tor-fd68834b17fd5a83101f47c12102aec4517b7b27.tar.gz |
Give an early error if you pass a .onion or a .exit hostname to tor-resolve
svn:r3027
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/tor-resolve.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c index a082f829a..10600fb06 100644 --- a/src/tools/tor-resolve.c +++ b/src/tools/tor-resolve.c @@ -204,6 +204,15 @@ main(int argc, char **argv) usage(); } + if (!strcasecmpend(arg[0], ".onion") || !strcasecmpend(arg[0], ".exit")) { + const char *name_type = (!strcasecmpend(arg[0], ".exit")) ? + "an exit-local hostname" : "a hidden service"; + fprintf(stderr, "%s is %s; those don't have IP addresses.\n\n" + "To connect to %s, you need to send the hostname to Tor;\n" + "we suggest SOCKS 4a.\n", arg[0], name_type, name_type); + return 1; + } + if (do_resolve(arg[0], sockshost, socksport, &result)) return 1; |