CVS: tmda/TMDA Auth.py,1.13,1.14 Util.py,1.92,1.93

Gre7g Luterman <[email protected]>
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda/TMDA
In directory sc8-pr-cvs1:/tmp/cvs-serv22699

Modified Files:
	Auth.py Util.py 
Log Message:
Removed some Python 2.2 specific code.


Index: Auth.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Auth.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- Auth.py	27 Apr 2003 07:58:17 -0000	1.13
+++ Auth.py	14 May 2003 06:00:22 -0000	1.14
@@ -26,12 +26,12 @@
 import sys
 import socket
 import base64
-import hmac
 import md5
 import popen2
 import time
 
 # TMDA imports
+import HMAC
 import Version
 import Util
 import Errors
@@ -130,12 +130,6 @@
         elif configdir is not None:
             self.setup_configdir( configdir )
 
-        # check whether we are running a recent enough Python
-        if not Version.PYTHON >= '2.2':
-            msg = 'Python 2.2 or greater is required to run ' + program + \
-                  ' -- Visit http://python.org/download/ to upgrade.'
-            self.warning(msg)
-
     def warning(self, msg='', exit=1):
         delimiter = '*' * 70
         if msg:
@@ -166,7 +160,7 @@
             self.debug( "Attribute Error: %s" % err )
             raise ValueError, \
                 "Authentication type '%s' not recognised.\n " % type + \
-                "Must be one of %s" % self.allowed_authtypes.__repr__()
+                "Must be one of %s" % repr(self.allowed_authtypes)
         except ValueError, err:
             raise err
 
@@ -240,7 +234,7 @@
             authproto, arg = URI, None
         if authproto not in self.allowed_protocols:
             raise ValueError, "Protocol '%s' not supported.\n" % authproto + \
-                    "Must be one of %s" % self.allowed_protocols.__repr__()
+                    "Must be one of %s" % repr(self.allowed_protocols)
         self.__authremote['proto'] = authproto
         self.__authremote['port'] = self.__defaultauthports[authproto]
         if arg:
@@ -331,7 +325,7 @@
             raise Errors.AuthError, \
                  ( "Unknown authentication type '%s'." % self.__authtype, \
                    "Available choices for authentication type are %s" % \
-                    self.allowed_authtypes.__repr__() )
+                    repr(self.allowed_authtypes) )
         except Errors.AuthError, err:
             raise err
         self.debug( "Authentication returned: %d" % retval )
@@ -364,7 +358,7 @@
         password = self.__authdict.get(username.lower(), 0)
         if password == 0:
             return 0
-        newhexdigest = hmac.HMAC(password, ticket, digestmod).hexdigest()
+        newhexdigest = HMAC.HMAC(password, ticket, digestmod).hexdigest()
         return newhexdigest == hexdigest
 
     def supports_cram_md5(self):

Index: Util.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Util.py,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- Util.py	27 Apr 2003 07:58:17 -0000	1.92
+++ Util.py	14 May 2003 06:00:23 -0000	1.93
@@ -897,9 +897,9 @@
         uid = os.geteuid()
     if gid is None:
         gid = os.getegid()
-    needuid = fstat.st_uid
-    needgid = fstat.st_gid
-    filemod = fstat.st_mode & 0777
+    needuid = fstat[4]
+    needgid = fstat[5]
+    filemod = fstat[0] & 0777
     if uid == 0:
         # Root always wins.
         return 1

_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.