From: rmurray <> Date: Thu, 13 Mar 2003 03:26:43 +0000 (+0000) Subject: update for python 2.1 X-Git-Tag: debian_userdir-ldap_0-3-7~72 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=e27b51c7b4be6668546ef1cac2600ad542c36265 update for python 2.1 --- diff --git a/ud-generate b/ud-generate index 7011dd0..a0c735d 100755 --- a/ud-generate +++ b/ud-generate @@ -5,6 +5,9 @@ import string, re, time, ldap, getopt, sys, os, pwd, posix, socket; from userdir_ldap import *; +global Allowed; +global CurrentHost; + PasswdAttrs = None; GroupIDMap = {}; Allowed = None; @@ -24,7 +27,6 @@ def DoLink(From,To,File): # See if this user is in the group list def IsInGroup(DnRecord): - global Allowed,CurrentHost; if Allowed == None: return 1; @@ -561,7 +563,6 @@ while(1): if GroupIDMap.has_key(I): GroupList[str(GroupIDMap[I])] = None; - global Allowed,CurrentHost; Allowed = GroupList; CurrentHost = Split[0]; diff --git a/userdir_ldap.py b/userdir_ldap.py index aee0e6f..80edc28 100644 --- a/userdir_ldap.py +++ b/userdir_ldap.py @@ -1,5 +1,5 @@ # Some routines and configuration that are used by the ldap progams -import termios, TERMIOS, re, string, imp, ldap, sys, whrandom, crypt, rfc822; +import termios, re, string, imp, ldap, sys, whrandom, crypt, rfc822; import userdir_gpg try: @@ -70,16 +70,16 @@ def PrettyShow(DnRecord): # Function to prompt for a password def getpass(prompt = "Password: "): - import termios, TERMIOS, sys; + import termios, sys; fd = sys.stdin.fileno(); old = termios.tcgetattr(fd); new = termios.tcgetattr(fd); - new[3] = new[3] & ~TERMIOS.ECHO; # lflags + new[3] = new[3] & ~termios.ECHO; # lflags try: - termios.tcsetattr(fd, TERMIOS.TCSADRAIN, new); + termios.tcsetattr(fd, termios.TCSADRAIN, new); passwd = raw_input(prompt); finally: - termios.tcsetattr(fd, TERMIOS.TCSADRAIN, old); + termios.tcsetattr(fd, termios.TCSADRAIN, old); print; return passwd;