import string, re, time, ldap, getopt, sys, os, pwd, posix, socket;
from userdir_ldap import *;
+global Allowed;
+global CurrentHost;
+
PasswdAttrs = None;
GroupIDMap = {};
Allowed = None;
# See if this user is in the group list
def IsInGroup(DnRecord):
- global Allowed,CurrentHost;
if Allowed == None:
return 1;
if GroupIDMap.has_key(I):
GroupList[str(GroupIDMap[I])] = None;
- global Allowed,CurrentHost;
Allowed = GroupList;
CurrentHost = Split[0];
# 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:
# 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;