[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [arm/master] fix: mixing up the relay and client shutdown opts



commit 2a1daaa179f0c25c15e0d71cb43d7ecbc92e129d
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Mon Jul 11 13:27:05 2011 -0700

    fix: mixing up the relay and client shutdown opts
    
    There's a separate shutdown option for clients vs relays (RSHUTDOWN vs
    CSHUTDOWN), the reason being that they have a different default and
    descriptions. The template was mistakenly taking the logical or of the
    two options rather than picking the one for our relay type.
---
 src/cli/wizard.py               |    7 +++++++
 src/resources/torrcTemplate.txt |    2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/cli/wizard.py b/src/cli/wizard.py
index b50105e..6caf490 100644
--- a/src/cli/wizard.py
+++ b/src/cli/wizard.py
@@ -600,6 +600,13 @@ def getTorrc(relayType, config, disabledOpt):
     if config[Options.IM].getValue(): policyCategories.append("im")
     if config[Options.MISC].getValue(): policyCategories.append("misc")
   
+  # uses the CSHUTDOWN or RSHUTDOWN option based on if we're running as a
+  # client or not
+  if relayType == RelayType.CLIENT:
+    templateOptions["SHUTDOWN"] = templateOptions[Options.CSHUTDOWN.upper()]
+  else:
+    templateOptions["SHUTDOWN"] = templateOptions[Options.RSHUTDOWN.upper()]
+  
   if policyCategories:
     isEncryptedOnly = not config[Options.PLAINTEXT].getValue()
     
diff --git a/src/resources/torrcTemplate.txt b/src/resources/torrcTemplate.txt
index c31b209..d23ed0b 100644
--- a/src/resources/torrcTemplate.txt
+++ b/src/resources/torrcTemplate.txt
@@ -7,7 +7,7 @@
 # Descriptions of all of these configuraiton attibutes (and many more) are
 # available in the tor man page.
 
-[IF RSHUTDOWN | CSHUTDOWN]
+[IF SHUTDOWN]
   [NEWLINE]
   # The following flag tells arm to shut down tor when it quits.
   # ARM_SHUTDOWN



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits