- CheckNumber(Split[2]);
- CheckNumber(Split[3]);
- Rec = [(ldap.MOD_REPLACE,"uid",Split[0]),
- (ldap.MOD_REPLACE,"uidNumber",Split[2]),
- (ldap.MOD_REPLACE,"gidNumber",Split[3]),
- (ldap.MOD_REPLACE,"gecos",Split[4]),
- (ldap.MOD_REPLACE,"homeDirectory",Split[5]),
- (ldap.MOD_REPLACE,"loginShell",Split[6]),
- (ldap.MOD_REPLACE,"cn",cn),
- (ldap.MOD_REPLACE,"mn",mn),
- (ldap.MOD_REPLACE,"sn",sn)];
+ # This just tests whether these are integers and throws an
+ # exception if not
+ int(Split[2])
+ int(Split[3])
+ Rec = [("uid",Split[0]),
+ ("uidNumber",Split[2]),
+ ("gidNumber",Split[3]),
+ ("gecos",Split[4]),
+ ("homeDirectory",Split[5]),
+ ("loginShell",Split[6]),
+ ("cn",cn),
+ ("sn",sn)];
+
+ # Avoid schema check complaints when mn is empty
+ if (mn):
+ Rec.append(("mn",mn))