Index: management/univention-management-console-module-udm/umc/python/udm/__init__.py =================================================================== --- management/univention-management-console-module-udm/umc/python/udm/__init__.py (Revision 73141) +++ management/univention-management-console-module-udm/umc/python/udm/__init__.py (Arbeitskopie) @@ -368,6 +368,8 @@ result.append({'$dn$': dn, 'success': True}) except UDM_Error as e: result.append({'$dn$': e.dn, 'success': False, 'details': str(e)}) + except udm_errors.valueError as e: + result.append({'$dn$': None, 'success': False, 'details': str(e)}) return result Index: management/univention-management-console-module-udm/umc/python/udm/udm_ldap.py =================================================================== --- management/univention-management-console-module-udm/umc/python/udm/udm_ldap.py (Revision 73141) +++ management/univention-management-console-module-udm/umc/python/udm/udm_ldap.py (Arbeitskopie) @@ -37,6 +37,7 @@ import threading import gc import functools +import pwd from univention.management.console import Translation from univention.management.console.protocol.definitions import BAD_REQUEST_UNAUTH @@ -334,6 +335,11 @@ @LDAP_Connection def create(self, ldap_object, container=None, superordinate=None, ldap_connection=None, ldap_position=None): """Creates a LDAP object""" + username = ldap_object['username'] + posix_users = [user.pw_name for user in pwd.getpwall()] + if username in posix_users: + raise udm_errors.valueError(_('The username "%s" is already assigned to an existing POSIX user.') % username) + if superordinate not in (None, 'None'): try: ldap_position.setDn(superordinate)