projects
/
mirror
/
userdir-ldap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge Steve's ud-replicate work
[mirror/userdir-ldap.git]
/
ud-passchk
diff --git
a/ud-passchk
b/ud-passchk
index
6929f4f
..
6a7865a
100755
(executable)
--- a/
ud-passchk
+++ b/
ud-passchk
@@
-2,7
+2,7
@@
# -*- mode: python -*-
# Checks the passwd file to make sure all entries are in the directory
# -*- mode: python -*-
# Checks the passwd file to make sure all entries are in the directory
-import
string,
ldap, getopt, sys, os;
+import ldap, getopt, sys, os;
from userdir_ldap import *;
def PassCheck(l,File,HomePrefix):
from userdir_ldap import *;
def PassCheck(l,File,HomePrefix):
@@
-10,7
+10,7
@@
def PassCheck(l,File,HomePrefix):
# Fetch all the users and generate a map out of them
Attrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"uid=*",\
# Fetch all the users and generate a map out of them
Attrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"uid=*",\
- ["uid","uid
number","gidnumber","logins
hell"]);
+ ["uid","uid
Number","gidNumber","loginS
hell"]);
UIDMap = {};
for x in Attrs:
if x[1].has_key("uid") == 0:
UIDMap = {};
for x in Attrs:
if x[1].has_key("uid") == 0:
@@
-23,18
+23,18
@@
def PassCheck(l,File,HomePrefix):
if Line == "":
break;
if Line == "":
break;
- Split =
string.split(Line,":");
+ Split =
Line.split(":")
if UIDMap.has_key(Split[0]) == 0:
print Line,
continue;
Ats = UIDMap[Split[0]];
Miss = [];
if UIDMap.has_key(Split[0]) == 0:
print Line,
continue;
Ats = UIDMap[Split[0]];
Miss = [];
- if Ats.has_key("uid
number") and Ats["uidn
umber"][0] != Split[2]:
+ if Ats.has_key("uid
Number") and Ats["uidN
umber"][0] != Split[2]:
Miss.append("UID");
Miss.append("UID");
- if Ats.has_key("uid
number") and Ats["gidn
umber"][0] != Split[3]:
+ if Ats.has_key("uid
Number") and Ats["gidN
umber"][0] != Split[3]:
Miss.append("GID");
Miss.append("GID");
- if Ats.has_key("home
d
irectory") and \
+ if Ats.has_key("home
D
irectory") and \
split[5] != HomePrefix + Split[0]:
Miss.append("Home");
if len(Miss) != 0:
split[5] != HomePrefix + Split[0]:
Miss.append("Home");
if len(Miss) != 0: