Univention Bugzilla – Attachment 8114 Details for
Bug 11800
Disallow users with username root
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to check for POSIX user names
file_11800.txt (text/plain), 1.74 KB, created by
Julius Hinrichs
on 2016-10-17 14:27 CEST
(
hide
)
Description:
Patch to check for POSIX user names
Filename:
MIME Type:
Creator:
Julius Hinrichs
Created:
2016-10-17 14:27 CEST
Size:
1.74 KB
patch
obsolete
>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)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 11800
:
8114
|
8129
|
9155