projects
/
mirror
/
userdir-ldap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
338ed57
)
update for python 2.1
author
rmurray
<>
Thu, 13 Mar 2003 03:26:43 +0000
(
03:26
+0000)
committer
rmurray
<>
Thu, 13 Mar 2003 03:26:43 +0000
(
03:26
+0000)
ud-generate
patch
|
blob
|
history
userdir_ldap.py
patch
|
blob
|
history
diff --git
a/ud-generate
b/ud-generate
index
7011dd0
..
a0c735d
100755
(executable)
--- 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 *;
import string, re, time, ldap, getopt, sys, os, pwd, posix, socket;
from userdir_ldap import *;
+global Allowed;
+global CurrentHost;
+
PasswdAttrs = None;
GroupIDMap = {};
Allowed = None;
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):
# See if this user is in the group list
def IsInGroup(DnRecord):
- global Allowed,CurrentHost;
if Allowed == None:
return 1;
if Allowed == None:
return 1;
@@
-561,7
+563,6
@@
while(1):
if GroupIDMap.has_key(I):
GroupList[str(GroupIDMap[I])] = None;
if GroupIDMap.has_key(I):
GroupList[str(GroupIDMap[I])] = None;
- global Allowed,CurrentHost;
Allowed = GroupList;
CurrentHost = Split[0];
Allowed = GroupList;
CurrentHost = Split[0];
diff --git
a/userdir_ldap.py
b/userdir_ldap.py
index
aee0e6f
..
80edc28
100644
(file)
--- a/
userdir_ldap.py
+++ b/
userdir_ldap.py
@@
-1,5
+1,5
@@
# Some routines and configuration that are used by the ldap progams
# 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:
import userdir_gpg
try:
@@
-70,16
+70,16
@@
def PrettyShow(DnRecord):
# Function to prompt for a password
def getpass(prompt = "Password: "):
# 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);
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:
try:
- termios.tcsetattr(fd,
TERMIOS
.TCSADRAIN, new);
+ termios.tcsetattr(fd,
termios
.TCSADRAIN, new);
passwd = raw_input(prompt);
finally:
passwd = raw_input(prompt);
finally:
- termios.tcsetattr(fd,
TERMIOS
.TCSADRAIN, old);
+ termios.tcsetattr(fd,
termios
.TCSADRAIN, old);
print;
return passwd;
print;
return passwd;