aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2011-10-11 02:40:06 +0200
committerSebastian Hahn <sebastian@torproject.org>2011-10-11 02:42:12 +0200
commitb4bd836f46549b6263c8c55eb3bc127884b72340 (patch)
tree0051d31eb033b5db70c600f5f70ef243bd9e5ae1
parent6a673ad31387928e4309b72204292000a3cd3b83 (diff)
downloadtor-b4bd836f46549b6263c8c55eb3bc127884b72340.tar
tor-b4bd836f46549b6263c8c55eb3bc127884b72340.tar.gz
Consider hibernation before dropping privs
Without this patch, Tor wasn't sure whether it would be hibernating or not, so it postponed opening listeners until after the privs had been dropped. This doesn't work so well for low ports. Bug was introduced in the fix for bug 2003. Fixes bug 4217, reported by Zax and katmagic. Thanks!
-rw-r--r--src/or/config.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 2705ba5a1..1304c469f 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1080,6 +1080,9 @@ options_act_reversible(const or_options_t *old_options, char **msg)
if (parse_client_ports(options, 0, msg, &n_client_ports))
return -1;
+ /* Set the hibernation state appropriately.*/
+ consider_hibernation(time(NULL));
+
/* Launch the listeners. (We do this before we setuid, so we can bind to
* ports under 1024.) We don't want to rebind if we're hibernating. */
if (!we_are_hibernating()) {