Update of /cvsroot/tmda/tmda/TMDA
In directory sc8-pr-cvs1:/tmp/cvs-serv28182

Modified Files:
        Defaults.py 
Log Message:
Cleaned up comments on some CGI_* variables.

If crypt_key cannot be found or read, TMDA_MODE_CGI is checked for "no-su" 
before raising an exeception.

Reverted:

Wrong file permissions on crypt_key will always fault now.


Index: Defaults.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Defaults.py,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -r1.164 -r1.165
--- Defaults.py 3 Dec 2002 03:48:55 -0000       1.164
+++ Defaults.py 5 Dec 2002 18:15:09 -0000       1.165
@@ -171,6 +171,7 @@
 
 # ALLOW_MODE_640
 # Set this variable to 1 if you want to allow a mode 640 CRYPT_KEY_FILE.
+#
 # Default is 0 (turned off)
 if not vars().has_key('ALLOW_MODE_640'):
     ALLOW_MODE_640 = 0
@@ -414,6 +415,8 @@
 # configuration of TMDA accounts.  To use tmda-cgi, you must define
 # CGI_ACTIVE to enable default values for the CGI_* variables.
 #
+# Set this in /etc/tmdarc if you set up tmda-cgi in system-wide mode.
+#
 # Example:
 # CGI_ACTIVE = 1
 #
@@ -427,6 +430,8 @@
 # each page fetch.  Larger values will tidy up the temporary files
 # more often.
 #
+# You probably won't need to adjust this parameter.
+#
 # Example:
 # CGI_CLEANUP_ODDS = 0.1
 #
@@ -484,7 +489,7 @@
 # CGI_USER
 # Defines the user name to use at non-critical times (such as reading
 # and writing session files.  CGI_USER is only signifigant when running
-# in system-wide mode.  See contrib/cgi/INSTALL for more about modes.
+# in system-wide mode.  See tmda-cgi.html for more about modes.
 #
 # Example:
 # CGI_USER = "apache"
@@ -1372,11 +1377,12 @@
         if ALLOW_MODE_640 and crypt_key_filemode == 640:
             pass
         else:
-            if not CGI_ACTIVE:
-                raise Errors.ConfigError, \
-                      CRYPT_KEY_FILE + " must be chmod 400 or 600!"
+            raise Errors.ConfigError, \
+                  CRYPT_KEY_FILE + " must be chmod 400 or 600!"
 else:
-    if not CGI_ACTIVE:
+    if not os.environ.has_key("TMDA_CGI_MODE"):
+        raise Errors.ConfigError, "Can't find key file: " + CRYPT_KEY_FILE
+    if os.environ["TMDA_CGI_MODE"] != "no-su":
         raise Errors.ConfigError, "Can't find key file: " + CRYPT_KEY_FILE
 
 # Read key from CRYPT_KEY_FILE, and then convert it from hex back into
@@ -1384,7 +1390,8 @@
 try:
     CRYPT_KEY = binascii.unhexlify(open(CRYPT_KEY_FILE).read().strip())
 except IOError:
-    if not CGI_ACTIVE: raise
+    if not os.environ.has_key("TMDA_CGI_MODE"): raise
+    if os.environ["TMDA_CGI_MODE"] != "no-su": raise
 
 ###################################
 # END of user configurable settings

_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs

Reply via email to