Explorar o código

Prevent bridges from publishing router descriptors.

Bridges are not supposed to publish router descriptors to the directory
authorities. It defeats the point of bridges when they are included in the
public relay directory.

This patch puts out a warning and exits when the node is configured as
a bridge and to publish v1, v2, or v3 descriptors at the same time.

Also fixes part of bug 932.
Karsten Loesing %!s(int64=16) %!d(string=hai) anos
pai
achega
9e97067b2f
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      src/or/config.c

+ 9 - 0
src/or/config.c

@@ -3238,6 +3238,15 @@ options_validate(or_options_t *old_options, or_options_t *options,
     return -1;
     return -1;
   }
   }
 
 
+  if ((options->BridgeRelay
+        || options->_PublishServerDescriptor & BRIDGE_AUTHORITY)
+      && options->_PublishServerDescriptor
+        & (V1_AUTHORITY + V2_AUTHORITY + V3_AUTHORITY)) {
+    REJECT("Bridges are not supposed to publish router descriptors to the "
+           "directory authorities. Please correct your "
+           "PublishServerDescriptor line.");
+  }
+
   if (options->MinUptimeHidServDirectoryV2 < 0) {
   if (options->MinUptimeHidServDirectoryV2 < 0) {
     log_warn(LD_CONFIG, "MinUptimeHidServDirectoryV2 option must be at "
     log_warn(LD_CONFIG, "MinUptimeHidServDirectoryV2 option must be at "
                         "least 0 seconds. Changing to 0.");
                         "least 0 seconds. Changing to 0.");