Nick Mathewson [Wed, 11 Feb 2009 17:22:34 +0000 (17:22 +0000)]
I worry that the CLEAR() macro in eventdns.c is hiding bugs. That is sad, because it was meant to make them more detectable. Change it to change stuff to garbage rather than to 0. If no bugs turn up, we can remove it in 0.2.2.x
Nick Mathewson [Mon, 9 Feb 2009 16:55:48 +0000 (16:55 +0000)]
Retry circuits if the exit node is optional and nonexistant.
Previously, when we had the chosen_exit set but marked optional, and
we failed because we couldn't find an onion key for it, we'd just give
up on the circuit. But what we really want to do is try again, without
the forced exit node.
Spotted by rovv. Another case of bug 752. I think this might be
unreachable in our current code, but proposal 158 could change that.
Peter Palfrader [Wed, 4 Feb 2009 23:42:39 +0000 (23:42 +0000)]
patches/06_add_compile_time_defaults: Only set the User option in the config if
we run as root. Do not set it when run as debian-tor as Tor then always
insists on changing users which will fail. (If we run as any other user we
don't set our debian defaults anyway.)
If we're using bridges and our network goes away, be more willing
to forgive our bridges and try again when we get an application
request. Bugfix on 0.2.0.x.
make a note about a clause in connection_edge.c that is probably
redundant, and is definitely confusing. we should take it out
in 0.2.2.x and see who squeaks.
Nick Mathewson [Sat, 31 Jan 2009 07:51:02 +0000 (07:51 +0000)]
When building with GCC, use -fno-strict-aliasing
GCC's interpretation of the C99 aliasing rules, to be charitable,
creates a dialect of C intended for a better programmers than I am
certain of my ability to be in all times. I just spent 2 hours
tracking down a platform-hyperspecific libevent bug that turned out to
be because of this, and darned if I ever want to do *that* again.
One of Linus's recent rants will give you a picture of why GCC's
behavior here can lead to fun surprises in your binaries:
http://lwn.net/Articles/316126/
Roger Dingledine [Fri, 30 Jan 2009 19:37:59 +0000 (19:37 +0000)]
give torrc.sample its yearly overhaul. the main change is to
merge the 'bridge relay' section into the 'main relay'
section, so people stop getting confused about whether they
should fill out both sections (they shouldn't).
Nick Mathewson [Wed, 28 Jan 2009 18:26:20 +0000 (18:26 +0000)]
Fix a race condition on nameserver reconfiguration.
This resolves bug 526, wherein we would crash if the following
events occurred in this order:
A: We're an OR, and one of our nameservers goes down.
B: We launch a probe to it to see if it's up again. (We do this hourly
in steady-state.)
C: Before the probe finishes, we reconfigure our nameservers,
usually because we got a SIGHUP and the resolve.conf file changed.
D: The probe reply comes back, or times out. (There is a five-second
window for this, after B has happens).
IOW, if one of our nameservers is down and our nameserver
configuration has changed, there were 5 seconds per hour where HUPing
the server was unsafe.
Nick Mathewson [Wed, 28 Jan 2009 17:36:41 +0000 (17:36 +0000)]
Don't obsolete a very-new connection for having no circuits yet.
This fixes the last known case of bug 891, which could happen if two
hosts, A and B, disagree about how long a circuit has been open,
because of clock drift of some kind. Host A would then mark the
connection as is_bad_for_new_circs when it got too old and open a new
connection. In between when B receives a NETINFO cell on the new
conn, and when B receives a conn cell on the new circuit, the new
circuit will seem worse to B than the old one, and so B will mark it
as is_bad_for_new_circs in the second or third loop of
connection_or_group_set_badness().
Bugfix on 0.1.1.13-alpha. Bug found by rovv.
Not a backport candidate: the bug is too obscure and the fix too tricky.
Nick Mathewson [Wed, 28 Jan 2009 16:06:46 +0000 (16:06 +0000)]
Actually send the extra_headers content in write_http_response_header_impl. This make X-Descriptor-Now-New get sent. Bugfix on 0.2.0.10-alpha. Spotted by "multiplication".
Nick Mathewson [Wed, 21 Jan 2009 15:38:39 +0000 (15:38 +0000)]
Make sure that even in the weird fiddly paths that lead to init_keys,
crypto_global_init gets called. Also have it be crypto_global_init
that calls crypto_seed_rng, so we are not dependent on OpenSSL's
RAND_poll in these fiddly cases.
Should fix bug 907. Bugfix on 0.0.9pre6. Backport candidate.
Peter Palfrader [Sun, 18 Jan 2009 13:22:47 +0000 (13:22 +0000)]
make it work with base64
base64 from coreutils is really picky about the number of equation
marks (=) that end a base64 encoded string. Unfortunately Tor doesn't
believe they are important at all so it cuts them all off all the time.
For perl purposes we just added a good measure of = and were happy about
it. For base64 we now need to add the proper number of equation marks.
It turns out that number is 1 for the length of strings we process.
Nick Mathewson [Thu, 15 Jan 2009 23:07:11 +0000 (23:07 +0000)]
This patch changes the default location where config and data files
are stored when the --enable-local-appdata option is configured. This
changes the Windows path from %APPDATA% to a host local
%USERPROFILE%\Local Settings\Application Data\ path (aka,
LOCAL_APPDATA).