projects
/
mirror
/
userdir-ldap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added proper copyright notice according to the CVS log
[mirror/userdir-ldap.git]
/
ud-gpgimport
diff --git
a/ud-gpgimport
b/ud-gpgimport
index
4b43bc7
..
1229e57
100755
(executable)
--- a/
ud-gpgimport
+++ b/
ud-gpgimport
@@
-46,7
+46,7
@@
for (switch, val) in options:
NoAct = 0;
if len(arguments) == 0:
print "Give some keyrings to probe";
NoAct = 0;
if len(arguments) == 0:
print "Give some keyrings to probe";
-
o
s.exit(0);
+
sy
s.exit(0);
# Main program starts here
# Main program starts here
@@
-63,22
+63,22
@@
else:
# Download the existing key list and put it into a map
print "Fetching key list..",
sys.stdout.flush();
# Download the existing key list and put it into a map
print "Fetching key list..",
sys.stdout.flush();
-Attrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"key
fingerprint=*",["keyfingerp
rint","uid"]);
+Attrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"key
FingerPrint=*",["keyFingerP
rint","uid"]);
KeyMap = {};
KeyCount = {};
for x in Attrs:
try:
# Sense a bad fingerprint.. Slapd has problems, it will store a null
# value that ldapsearch doesn't show up.. detect and remove
KeyMap = {};
KeyCount = {};
for x in Attrs:
try:
# Sense a bad fingerprint.. Slapd has problems, it will store a null
# value that ldapsearch doesn't show up.. detect and remove
- if len(x[1]["key
fingerprint"]) == 0 or x[1]["keyfingerp
rint"][0] == "":
+ if len(x[1]["key
FingerPrint"]) == 0 or x[1]["keyFingerP
rint"][0] == "":
print;
print "Fixing bad fingerprint for",x[1]["uid"][0],
sys.stdout.flush();
if NoAct == 0:
l.modify_s("uid="+x[1]["uid"][0]+","+BaseDn,\
print;
print "Fixing bad fingerprint for",x[1]["uid"][0],
sys.stdout.flush();
if NoAct == 0:
l.modify_s("uid="+x[1]["uid"][0]+","+BaseDn,\
- [(ldap.MOD_DELETE,"key
fingerp
rint",None)]);
+ [(ldap.MOD_DELETE,"key
FingerP
rint",None)]);
else:
else:
- for I in x[1]["key
fingerp
rint"]:
+ for I in x[1]["key
FingerP
rint"]:
KeyMap[I] = [x[1]["uid"][0],0];
if KeyCount.has_key(x[1]["uid"][0]):
KeyCount[x[1]["uid"][0]] = KeyCount[x[1]["uid"][0]] + 1;
KeyMap[I] = [x[1]["uid"][0],0];
if KeyCount.has_key(x[1]["uid"][0]):
KeyCount[x[1]["uid"][0]] = KeyCount[x[1]["uid"][0]] + 1;
@@
-144,7
+144,7
@@
while(1):
continue;
UID = UID[0]
continue;
UID = UID[0]
- Rec = [(ldap.MOD_ADD,"key
fingerp
rint",Split2[9])];
+ Rec = [(ldap.MOD_ADD,"key
FingerP
rint",Split2[9])];
Dn = "uid=" + UID + "," + BaseDn;
print "Adding key 0x"+Split2[9],"to",UID;
if KeyCount.has_key(UID):
Dn = "uid=" + UID + "," + BaseDn;
print "Adding key 0x"+Split2[9],"to",UID;
if KeyCount.has_key(UID):
@@
-179,5
+179,5
@@
for x in KeyMap.keys():
print "**",KeyMap[x][0],"no longer has any keys";
if NoAct == 0:
l.modify_s("uid="+KeyMap[x][0]+","+BaseDn,\
print "**",KeyMap[x][0],"no longer has any keys";
if NoAct == 0:
l.modify_s("uid="+KeyMap[x][0]+","+BaseDn,\
- [(ldap.MOD_DELETE,"key
fingerp
rint",x)]);
+ [(ldap.MOD_DELETE,"key
FingerP
rint",x)]);