diff --git a/management/univention-directory-manager-modules/modules/univention/admin/uldap.py b/management/univention-directory-manager-modules/modules/univention/admin/uldap.py index e736bee..d264d63 100644 --- a/management/univention-directory-manager-modules/modules/univention/admin/uldap.py +++ b/management/univention-directory-manager-modules/modules/univention/admin/uldap.py @@ -363,6 +363,8 @@ def search(self, filter='(objectClass=*)', base='', scope='sub', attr=[], unique raise univention.admin.uexceptions.ldapSizelimitExceeded(_err2str(msg)) except ldap.FILTER_ERROR as msg: raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), filter)) + except ldap.INVALID_DN_SYNTAX as msg: + raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), base), original_exception=msg) except ldap.LDAPError as msg: raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg) @@ -379,6 +381,8 @@ def searchDn(self, filter='(objectClass=*)', base='', scope='sub', unique=0, req raise univention.admin.uexceptions.ldapSizelimitExceeded(_err2str(msg)) except ldap.FILTER_ERROR as msg: raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), filter)) + except ldap.INVALID_DN_SYNTAX as msg: + raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), base), original_exception=msg) except ldap.LDAPError as msg: raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg) @@ -403,6 +407,8 @@ def add(self, dn, al, exceptions=False): except ldap.INSUFFICIENT_ACCESS as msg: univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'add dn=%s err=%s' % (dn, msg)) raise univention.admin.uexceptions.permissionDenied + except ldap.INVALID_DN_SYNTAX as msg: + raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), dn), original_exception=msg) except ldap.LDAPError as msg: univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'add dn=%s err=%s' % (dn, msg)) raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg) @@ -424,6 +430,8 @@ def modify(self, dn, changes, exceptions=False, ignore_license=0): except ldap.INSUFFICIENT_ACCESS as msg: univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'mod dn=%s err=%s' % (dn, msg)) raise univention.admin.uexceptions.permissionDenied + except ldap.INVALID_DN_SYNTAX as msg: + raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), dn), original_exception=msg) except ldap.LDAPError as msg: univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'mod dn=%s err=%s' % (dn, msg)) raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg) @@ -445,6 +453,8 @@ def rename(self, dn, newdn, move_childs=0, ignore_license=False): except ldap.INSUFFICIENT_ACCESS as msg: univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'ren dn=%s err=%s' % (dn, msg)) raise univention.admin.uexceptions.permissionDenied + except ldap.INVALID_DN_SYNTAX as msg: + raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), dn), original_exception=msg) except ldap.LDAPError as msg: univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'ren dn=%s err=%s' % (dn, msg)) raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg) @@ -465,6 +475,8 @@ def delete(self, dn, exceptions=False): except ldap.INSUFFICIENT_ACCESS as msg: univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'del dn=%s err=%s' % (dn, msg)) raise univention.admin.uexceptions.permissionDenied + except ldap.INVALID_DN_SYNTAX as msg: + raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), dn), original_exception=msg) except ldap.LDAPError as msg: univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'del dn=%s err=%s' % (dn, msg)) raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)