Commit 9d605ae2 authored by Benjamin Fischer's avatar Benjamin Fischer

LDAP-Export: some fixes

- dont modify attributes which are part of the dn
- fixed trailing / on home
parent 5831c1c0
......@@ -115,7 +115,7 @@ class LDAPExport(object):
'loginShell': '/bin/bash',
'uidNumber': uid + self.uid_offset,
'gidNumber': uid + self.uid_offset,
'homeDirectory': '/home/%s/' % username
'homeDirectory': '/home/%s' % username
}
logger.info("Add user: %s, %s, %s", dn, classes, attributes)
try:
......@@ -124,11 +124,10 @@ class LDAPExport(object):
logger.info(" -> updated")
changes = {
'uid': _r(username),
'cn': _r(username),
'userPassword': _r('{CRYPT}' + password),
'uidNumber': _r(uid + self.uid_offset),
'gidNumber': _r(uid + self.uid_offset),
'homeDirectory': _r('/home/%s/' % username)
'homeDirectory': _r('/home/%s' % username)
}
self.connection.modify(dn, changes)
......@@ -150,7 +149,6 @@ class LDAPExport(object):
except LDAPEntryAlreadyExistsResult:
logger.info(" -> updated")
changes = {
'cn': _r(name),
'gidNumber': _r(gid),
}
self.connection.modify(dn, changes)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment