Quellcode durchsuchen

Rename ServerDNSAllowBrokenResolvConf to ServerDNSAllowBrokenConfig.
(Many users have no idea what a resolv.conf is, and shouldn't be forced to learn. The old option will keep working for now.)
Also, document it.

svn:r17661

Nick Mathewson vor 16 Jahren
Ursprung
Commit
2ad36f68c8
5 geänderte Dateien mit 16 neuen und 5 gelöschten Zeilen
  1. 2 0
      ChangeLog
  2. 9 1
      doc/tor.1.in
  3. 3 2
      src/or/config.c
  4. 1 1
      src/or/main.c
  5. 1 1
      src/or/or.h

+ 2 - 0
ChangeLog

@@ -78,6 +78,8 @@ Changes in version 0.2.1.9-alpha - 2008-12-2?
     - Move edge-only flags from connection_t to edge_connection_t: not
     - Move edge-only flags from connection_t to edge_connection_t: not
       only is this better coding, but on machines of plausible alignment,
       only is this better coding, but on machines of plausible alignment,
       it should save 4-8 bytes per connection_t. "Every little bit helps."
       it should save 4-8 bytes per connection_t. "Every little bit helps."
+    - Rename ServerDNSAllowBrokenResolvConf to ServerDNSAllowBrokenConfig
+      for consistency; keep old option working for backward compatibility.
 
 
 
 
 Changes in version 0.2.1.8-alpha - 2008-12-08
 Changes in version 0.2.1.8-alpha - 2008-12-08

+ 9 - 1
doc/tor.1.in

@@ -975,6 +975,14 @@ ServerDNS options, only affects name lookups that your server does on
 behalf of clients. (Defaults to use the system DNS configuration.)
 behalf of clients. (Defaults to use the system DNS configuration.)
 .LP
 .LP
 .TP
 .TP
+\fBServerDNSAllowBrokenConfig \fR\fB0\fR|\fB1\fR\fP
+If this option is false, Tor exits immediately if there are problems
+parsing the system DNS configuration or connecting to nameservers.
+Otherwise, Tor continues to periodically retry the system namesevers
+until it eventually succeeds.
+(Defaults to "1".)
+.LP
+.TP
 \fBServerDNSSearchDomains \fR\fB0\fR|\fB1\fR\fP
 \fBServerDNSSearchDomains \fR\fB0\fR|\fB1\fR\fP
 If set to \fB1\fP, then we will search for addresses in the local search
 If set to \fB1\fP, then we will search for addresses in the local search
 domain.  For example, if this system is configured to believe it is in
 domain.  For example, if this system is configured to believe it is in
@@ -1332,7 +1340,7 @@ non-default set of DirServers is set. Cannot be unset while Tor is running.
 
 
 .PD 0
 .PD 0
 .RS 12
 .RS 12
-.IP "ServerDNSAllowBrokenResolvConf 1"
+.IP "ServerDNSAllowBrokenConfig 1"
 .IP "DirAllowPrivateAddresses 1"
 .IP "DirAllowPrivateAddresses 1"
 .IP "EnforceDistinctSubnets 0"
 .IP "EnforceDistinctSubnets 0"
 .IP "AssumeReachable 1"
 .IP "AssumeReachable 1"

+ 3 - 2
src/or/config.c

@@ -85,6 +85,7 @@ static config_abbrev_t _option_abbrevs[] = {
   { "NumEntryNodes", "NumEntryGuards", 0, 0},
   { "NumEntryNodes", "NumEntryGuards", 0, 0},
   { "ResolvConf", "ServerDNSResolvConfFile", 0, 1},
   { "ResolvConf", "ServerDNSResolvConfFile", 0, 1},
   { "SearchDomains", "ServerDNSSearchDomains", 0, 1},
   { "SearchDomains", "ServerDNSSearchDomains", 0, 1},
+  { "ServerDNSAllowBrokenResolvConf", "SeverDNSAllowBrokenConfig", 0, 0 },
   { "PreferTunnelledDirConns", "PreferTunneledDirConns", 0, 0},
   { "PreferTunnelledDirConns", "PreferTunneledDirConns", 0, 0},
   { "BridgeAuthoritativeDirectory", "BridgeAuthoritativeDir", 0, 0},
   { "BridgeAuthoritativeDirectory", "BridgeAuthoritativeDir", 0, 0},
   { "HashedControlPassword", "__HashedControlSessionPassword", 1, 0},
   { "HashedControlPassword", "__HashedControlSessionPassword", 1, 0},
@@ -290,7 +291,7 @@ static config_var_t _option_vars[] = {
   V(RunTesting,                  BOOL,     "0"),
   V(RunTesting,                  BOOL,     "0"),
   V(SafeLogging,                 BOOL,     "1"),
   V(SafeLogging,                 BOOL,     "1"),
   V(SafeSocks,                   BOOL,     "0"),
   V(SafeSocks,                   BOOL,     "0"),
-  V(ServerDNSAllowBrokenResolvConf, BOOL,  "1"),
+  V(ServerDNSAllowBrokenConfig,  BOOL,     "1"),
   V(ServerDNSAllowNonRFC953Hostnames, BOOL,"0"),
   V(ServerDNSAllowNonRFC953Hostnames, BOOL,"0"),
   V(ServerDNSDetectHijacking,    BOOL,     "1"),
   V(ServerDNSDetectHijacking,    BOOL,     "1"),
   V(ServerDNSRandomizeCase,      BOOL,     "1"),
   V(ServerDNSRandomizeCase,      BOOL,     "1"),
@@ -345,7 +346,7 @@ static config_var_t _option_vars[] = {
 
 
 /* Keep defaults synchronous with man page and config value check. */
 /* Keep defaults synchronous with man page and config value check. */
 static config_var_t testing_tor_network_defaults[] = {
 static config_var_t testing_tor_network_defaults[] = {
-  V(ServerDNSAllowBrokenResolvConf, BOOL,  "1"),
+  V(ServerDNSAllowBrokenConfig,  BOOL,  "1"),
   V(DirAllowPrivateAddresses,    BOOL,     "1"),
   V(DirAllowPrivateAddresses,    BOOL,     "1"),
   V(EnforceDistinctSubnets,      BOOL,     "0"),
   V(EnforceDistinctSubnets,      BOOL,     "0"),
   V(AssumeReachable,             BOOL,     "1"),
   V(AssumeReachable,             BOOL,     "1"),

+ 1 - 1
src/or/main.c

@@ -1386,7 +1386,7 @@ do_main_loop(void)
 
 
   /* initialize dns resolve map, spawn workers if needed */
   /* initialize dns resolve map, spawn workers if needed */
   if (dns_init() < 0) {
   if (dns_init() < 0) {
-    if (get_options()->ServerDNSAllowBrokenResolvConf)
+    if (get_options()->ServerDNSAllowBrokenConfig)
       log_warn(LD_GENERAL, "Couldn't set up any working nameservers. "
       log_warn(LD_GENERAL, "Couldn't set up any working nameservers. "
                "Network not up yet?  Will try again soon.");
                "Network not up yet?  Will try again soon.");
     else {
     else {

+ 1 - 1
src/or/or.h

@@ -2462,7 +2462,7 @@ typedef struct {
                     will know this without any specialized knowledge. */
                     will know this without any specialized knowledge. */
   /** Boolean: if set, we start even if our resolv.conf file is missing
   /** Boolean: if set, we start even if our resolv.conf file is missing
    * or broken. */
    * or broken. */
-  int ServerDNSAllowBrokenResolvConf;
+  int ServerDNSAllowBrokenConfig;
 
 
   smartlist_t *ServerDNSTestAddresses; /**< A list of addresses that definitely
   smartlist_t *ServerDNSTestAddresses; /**< A list of addresses that definitely
                                         * should be resolveable. Used for
                                         * should be resolveable. Used for