X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=blobdiff_plain;f=ud-passchk;h=6a7865a85a74afb5eab3712943060b65caaf04f0;hp=6929f4fd386216ebbc7e9d831a34ae17bd831d52;hb=a6fb69805c3999a85c064a96c93417bb1c284c5c;hpb=c50d88536a4feb3087d1aa802e110250cb2861fc diff --git a/ud-passchk b/ud-passchk index 6929f4f..6a7865a 100755 --- 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 -import string, ldap, getopt, sys, os; +import ldap, getopt, sys, os; 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=*",\ - ["uid","uidnumber","gidnumber","loginshell"]); + ["uid","uidNumber","gidNumber","loginShell"]); UIDMap = {}; for x in Attrs: if x[1].has_key("uid") == 0: @@ -23,18 +23,18 @@ def PassCheck(l,File,HomePrefix): 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 Ats.has_key("uidnumber") and Ats["uidnumber"][0] != Split[2]: + if Ats.has_key("uidNumber") and Ats["uidNumber"][0] != Split[2]: Miss.append("UID"); - if Ats.has_key("uidnumber") and Ats["gidnumber"][0] != Split[3]: + if Ats.has_key("uidNumber") and Ats["gidNumber"][0] != Split[3]: Miss.append("GID"); - if Ats.has_key("homedirectory") and \ + if Ats.has_key("homeDirectory") and \ split[5] != HomePrefix + Split[0]: Miss.append("Home"); if len(Miss) != 0: