summaryrefslogtreecommitdiff
path: root/src/tools/tor-resolve.c
AgeCommit message (Collapse)Author
2017-03-15Run the copyright update script.Nick Mathewson
2017-01-25Do not truncate too long hostnamesjunglefowl
If a hostname is supplied to tor-resolve which is too long, it will be silently truncated, resulting in a different hostname lookup: $ tor-resolve $(python -c 'print("google.com" + "m" * 256)') If tor-resolve uses SOCKS5, the length is stored in an unsigned char, which overflows in this case and leads to the hostname "google.com". As this one is a valid hostname, it returns an address instead of giving an error due to the invalid supplied hostname.
2016-12-18Revert ticket 20982 changes.Nick Mathewson
They broke stem, and breaking application compatibility is usually a bad idea. This reverts commit 6e10130e18c80f4521e31b071455ae0b1bbea761, commit 78a13df15842e8ab262e17825160386fadb77056, and commit 62f52a888acc191bcb507d27d31d54e42e6effdd. We might re-apply this later, if all the downstream tools can handle it, and it turns out to be useful for some reason.
2016-12-16Remove the version prefix from version numberscypherpunks
2016-12-16Remove the trailing dot from version numberscypherpunks
2015-08-30Remove -F from tor-resolve(1) usage message.rl1987
2015-06-29Remove checks for visual C 6.Nick Mathewson
2015-03-14Remove relative paths to header files.cypherpunks
The paths are already in the directory search path of the compiler therefore no need to include them in the source code.
2015-01-28Tweak tor-resolve docs and logsNick Mathewson
Resolves 14325
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-10-22Merge remote-tracking branch 'public/ticket6938'Nick Mathewson
Conflicts: src/tools/tor-resolve.c
2014-09-29Don't use the getaddrinfo sandbox cache from tor-resolveNick Mathewson
Fixes bug 13295; bugfix on 0.2.5.3-alpha. The alternative here is to call crypto_global_init() from tor-resolve, but let's avoid linking openssl into tor-resolve for as long as we can.
2014-09-10Remember log messages that happen before logs are configuredNick Mathewson
(And replay them once we know our first real logs.) This is an implementation for issue 6938. It solves the problem of early log mesages not getting sent to log files, but not the issue of early log messages not getting sent to controllers.
2013-02-11Don't tor_close_socket(-1) in tor-resolve.Nick Mathewson
Bugfix on 96b1bd4fb8e64. Not in any released Tor.
2013-02-11Fix a very short-lived socket leak in tor-resolveNick Mathewson
This shouldn't actually matter, since tor-resolve will return soon after this function exits, but it's nice to be warning-free Found by coverity, fixes CID 718633
2013-01-16Update the copyright date to 201.Nick Mathewson
2012-11-14Let tor-resolve generate PTR requests for IPv6 addressesNick Mathewson
2012-11-14Add IPv6 support to tor-resolve so it can hear about IPv6 answersNick Mathewson
2012-06-04Update copyright dates to 2012; add a few missing copyright statementsNick Mathewson
2012-01-31Use the standard _WIN32, not the Torism MS_WINDOWS or deprecated WIN32Nick Mathewson
This commit is completely mechanical; I used this perl script to make it: #!/usr/bin/perl -w -i.bak -p if (/^\s*\#/) { s/MS_WINDOWS/_WIN32/g; s/\bWIN32\b/_WIN32/g; }
2011-10-11Fix names of functions that convert strings to addrsNick Mathewson
Now let's have "lookup" indicate that there can be a hostname resolution, and "parse" indicate that there wasn't. Previously, we had one "lookup" function that did resolution; four "parse" functions, half of which did resolution; and a "from_str()" function that didn't do resolution. That's confusing and error-prone! The code changes in this commit are exactly the result of this perl script, run under "perl -p -i.bak" : s/tor_addr_port_parse/tor_addr_port_lookup/g; s/parse_addr_port(?=[^_])/addr_port_lookup/g; s/tor_addr_from_str/tor_addr_parse/g; This patch leaves aton and pton alone: their naming convention and behavior is is determined by the sockets API. More renaming may be needed.
2011-05-23Remove the -F option from tor-resolve.Nick Mathewson
It used to mean "Force": it would tell tor-resolve to ask tor to resolve an address even if it ended with .onion. But when AutomapHostsOnResolve was added, automatically refusing to resolve .onion hosts stopped making sense. So in 0.2.1.16-rc (commit 298dc95dfd8), we made tor-resolve happy to resolve anything. The -F option stayed in, though, even though it didn't do anything. Oddly, it never got documented. Found while fixing GCC 4.6 "set, unused variable" warnings.
2011-01-03Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson
Conflicts: src/common/test.h src/or/test.c
2011-01-03Bump copyright statements to 2011Nick Mathewson
2010-07-09Rename log.h to torlog.hNick Mathewson
This should make us conflict less with system files named "log.h". Yes, we shouldn't have been conflicting with those anyway, but some people's compilers act very oddly. The actual change was done with one "git mv", by editing Makefile.am, and running find . -name '*.[ch]' | xargs perl -i -pe 'if (/^#include.*\Wlog.h/) {s/log.h/torlog.h/; }'
2010-05-20clean up whitespace in src/toolsNick Mathewson
2010-02-27Merge remote branch 'origin/maint-0.2.1'Nick Mathewson
Conflicts: src/common/test.h src/or/test.c
2010-02-27Update Tor Project copyright yearsNick Mathewson
2009-09-29Include util.h and log.h as relative paths.Nathan Freitas
This shouldn't be necessary, but apparently the Android cross-compiler doesn't respect -I as well as it should. (-I is supposed to add to the *front* of the search path. Android's gcc wrapper apparently likes to add to the end. This is broken, but we need to work around it.)
2009-09-01Fix compile warnings on Snow LeopardSebastian Hahn
Big thanks to nickm and arma for helping me with this!
2009-06-18tor-resolve: Don't automatically refuse .onion addresses.Nick Mathewson
If the Tor is running with AutomapHostsOnResolve set, it _is_ reasonable to do a DNS lookup on a .onion address. So instead we make tor-resolve willing to try to resolve anything. Only if Tor refuses to resolve it do we suggest to the user that resolving a .onion address may not work. Fix for bug 1005.
2009-05-04Update copyright to 2009.Karsten Loesing
2009-03-10In tor-resolve, when the Tor client to use is specified by ↵Steven Murdoch
<hostname>:<port>, actually use the specified port rather than defaulting to 9050 svn:r18833
2009-01-04Remove svn $Id$s from our source, and remove tor --version --version.Nick Mathewson
The subversion $Id$ fields made every commit force a rebuild of whatever file got committed. They were not actually useful for telling the version of Tor files in the wild. svn:r17867
2008-12-02Change logging code to use fds instead of stdio. Fixes bug 861, and ↵Nick Mathewson
probably makes logging slightly faster. Not a backport candidate: bug 861 is too obscure and harmless. svn:r17456
2008-09-29Make tor-resolve take a -p port option in addition to the current host:port ↵Nick Mathewson
syntax. svn:r17002
2008-08-26and then make the indentation rightRoger Dingledine
svn:r16663
2008-08-26fix typos from jake's patch earlier (one pointed out by fabian, thanks!)Roger Dingledine
svn:r16662
2008-08-25and make it compile with warnings onRoger Dingledine
svn:r16658
2008-08-25commit jake's patch to include strings with socks5 error numbersRoger Dingledine
svn:r16657
2008-07-25 r17358@pc-10-8-1-079: nickm | 2008-07-25 16:41:03 +0200Nick Mathewson
Split out the address manipulation functions from compat and util: they were about 21% of the total of those, and spread out too much. svn:r16208
2008-03-13 r18804@catbus: nickm | 2008-03-13 18:18:31 -0400Nick Mathewson
Refactor log domain mask code so that nobody outside of log.c has to use SEVERITY_MASK_IDX. It is error-prone. svn:r14016
2008-03-05 r18630@catbus: nickm | 2008-03-05 17:31:33 -0500Nick Mathewson
Implement domain-selection for logging. Source is documented; needs documentation in manpage (maybe). For now, see doxygen comment on parse_log_severity_config in log.c svn:r13875
2008-02-07Update some copyright notices: it is now 2008.Nick Mathewson
svn:r13412
2008-01-16 r17639@catbus: nickm | 2008-01-15 19:09:21 -0500Nick Mathewson
Fix some hard to trigger but nonetheless real memory leaks spotted by an anonymous contributor. Needs review. Partial backport candidate. svn:r13147
2008-01-03 r17459@catbus: nickm | 2008-01-03 17:44:25 -0500Nick Mathewson
add init_logging calls to tor_gencert and tor_resolve svn:r13028
2007-12-12clean up copyrights, and assign 2007 copyrights to The Tor Project, IncRoger Dingledine
svn:r12786
2007-09-04 r14323@kushana: nickm | 2007-09-04 14:27:33 -0400Nick Mathewson
Patch from sjmurdoch to fix dnsleak warning when reverse-resolving via socks5. svn:r11373
2007-08-08 r14093@catbus: nickm | 2007-08-08 01:49:54 -0400Nick Mathewson
Include fewer redundant headers; use the compiler search paths better. svn:r11060