From cabb16caa9afb95ce0bfbda0d7784f71e4c153a1 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 17 Jun 2011 16:45:23 -0400 Subject: [PATCH 1/4] Revert "Update man page for new UseBridges tristate behaviour." This reverts commit 40cfad1b5ae90b06eb74861a4fdc1310f8611111. --- doc/tor.1.txt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/doc/tor.1.txt b/doc/tor.1.txt index 8aa32e82a0..1815a8d963 100644 --- a/doc/tor.1.txt +++ b/doc/tor.1.txt @@ -708,14 +708,10 @@ The following options are useful only for clients (that is, if from the configured bridge authorities when feasible. It will fall back to a direct request if the authority responds with a 404. (Default: 0) -**UseBridges** **0**|**1**|**auto**:: - Make Tor fetch descriptors for each bridge listed in the "Bridge" +**UseBridges** **0**|**1**:: + When set, Tor will fetch descriptors for each bridge listed in the "Bridge" config lines, and use these relays as both entry guards and directory - guards. If the option is 1, bridges must be used and if no bridges are - configured Tor will not make any connections until a bridge is configured; - if it's "auto", Tor will use bridges if any are configured, otherwise it - will connect directly to the Tor network; if it's 0, bridges are not used - at all. (Defaults to auto) + guards. (Default: 0) **UseEntryGuards** **0**|**1**:: If this option is set to 1, we pick a few long-term entry servers, and try From 3b41551b61a604b555891ecc7cb6f8bbde65d128 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 17 Jun 2011 16:45:53 -0400 Subject: [PATCH 2/4] Revert "Add an "auto" option to UseBridges" This reverts commit 507c1257a4d9c629fefc2adbad8db73607749734. --- src/or/config.c | 19 ++++--------------- src/or/or.h | 12 +----------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/or/config.c b/src/or/config.c index 8ab23a3b80..e0ecab2d41 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -376,7 +376,7 @@ static config_var_t _option_vars[] = { V(TransPort, PORT, "0"), V(TunnelDirConns, BOOL, "1"), V(UpdateBridgesFromAuthority, BOOL, "0"), - VAR("UseBridges", STRING, UseBridges_, "auto"), + V(UseBridges, BOOL, "0"), V(UseEntryGuards, BOOL, "1"), V(User, STRING, NULL), VAR("V1AuthoritativeDirectory",BOOL, V1AuthoritativeDir, "0"), @@ -3234,19 +3234,6 @@ options_validate(or_options_t *old_options, or_options_t *options, "of the Internet, so they must not set Reachable*Addresses " "or FascistFirewall."); - /* XXX023 use autobool instead. */ - if (!strcmp(options->UseBridges_, "auto")) { - options->UseBridges = (options->Bridges && - !server_mode(options) && - !options->EntryNodes); - } else if (!strcmp(options->UseBridges_, "0")) { - options->UseBridges = 0; - } else if (!strcmp(options->UseBridges_, "1")) { - options->UseBridges = 1; - } else { - REJECT("UseBridges must be 0, 1, or auto"); - } - if (options->UseBridges && server_mode(options)) REJECT("Servers must be able to freely connect to the rest " @@ -3581,8 +3568,10 @@ options_validate(or_options_t *old_options, or_options_t *options, if (validate_dir_authorities(options, old_options) < 0) REJECT("Directory authority line did not parse. See logs for details."); + if (options->UseBridges && !options->Bridges) + REJECT("If you set UseBridges, you must specify at least one bridge."); if (options->UseBridges && !options->TunnelDirConns) - REJECT("TunnelDirConns set to 0 only works with UseBridges set to 0"); + REJECT("If you set UseBridges, you must set TunnelDirConns."); if (options->Bridges) { for (cl = options->Bridges; cl; cl = cl->next) { if (parse_bridge_line(cl->value, 1)<0) diff --git a/src/or/or.h b/src/or/or.h index 456dce2be4..97fecd1500 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2480,17 +2480,7 @@ typedef struct { * when doing so. */ char *BridgePassword; - /** Whether we should start all circuits with a bridge. "1" means strictly - * yes, "0" means strictly no, and "auto" means that we do iff any bridges - * are configured, we are not running a server and have not specified a list - * of entry nodes. */ - char *UseBridges_; - /** Effective value of UseBridges. Will be set equally for UseBridges set to - * 1 or 0, but for 'auto' it will be set to 1 iff any bridges are - * configured, we are not running a server and have not specified a list of - * entry nodes. */ - int UseBridges; - + int UseBridges; /**< Boolean: should we start all circuits with a bridge? */ config_line_t *Bridges; /**< List of bootstrap bridge addresses. */ int BridgeRelay; /**< Boolean: are we acting as a bridge relay? We make From 1811bef666680222fe9421bbe282b49b00df6683 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 17 Jun 2011 16:54:31 -0400 Subject: [PATCH 3/4] Add changes file for bug2355 revert --- changes/bug2355_revert | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changes/bug2355_revert diff --git a/changes/bug2355_revert b/changes/bug2355_revert new file mode 100644 index 0000000000..0d2822a462 --- /dev/null +++ b/changes/bug2355_revert @@ -0,0 +1,6 @@ + o Minor bugfixes: + - Revert the UseBridges option to its behavior before 0.2.2.28-beta. + When we changed the default behavior to "use bridges if any are + listed in the torrc", we broke a number of Vidalia users. + Partial resolution for bug 3354. + From 8e5dfe42a0230722bff07ba6ededcc0d2dbd53e7 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 19 Jun 2011 20:58:46 -0400 Subject: [PATCH 4/4] Tweak bug2355_revert at suggestion from Roger --- changes/bug2355_revert | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changes/bug2355_revert b/changes/bug2355_revert index 0d2822a462..2ded40ad8e 100644 --- a/changes/bug2355_revert +++ b/changes/bug2355_revert @@ -1,6 +1,7 @@ o Minor bugfixes: - Revert the UseBridges option to its behavior before 0.2.2.28-beta. When we changed the default behavior to "use bridges if any are - listed in the torrc", we broke a number of Vidalia users. + listed in the torrc", we broke a number of users who had bridges + in their torrc files but who didn't actually want to use them. Partial resolution for bug 3354.