Bug 40153 - It is possible to create a user with space as lastname
It is possible to create a user with space as lastname
Status: CLOSED WORKSFORME
Product: UCS
Classification: Unclassified
Component: UMC - Users
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.x
Assigned To: UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-01 17:09 CET by Florian Best
Modified: 2022-04-05 16:57 CEST (History)
0 users

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2015-12-01 17:09:16 CET
It is possible to create a user having the lastname = " ". We should disallow this?

It's also possible via UMC to get a "LDAP object class violation" when creating a user without firstname and ' ' as lastname.

Error message:
Failed to create LDAP object: ldapError: Object class violation: object class 'posixAccount' requires attribute 'cn'

Our handlers shouldn't create invalid LDAP-Addlists plus the syntax class for lastname should not allow ' ' as value.

The HTTP-Request-Payload:
[{u'object': {u'CtxCfgClientPrinters': False, u'primaryGroup': u'cn=Domain Users,cn=groups,dc=test,dc=intranet', u'disabled': u'none', u'CtxShadow': u'00000000', u'CtxRASDialin': u'E', u'CtxStartprogramClient': False, u'homeSharePath': u'asdf', u'unixhome': u'/home/asdf', u'username': u'asdf', u'shell': u'/bin/bash', u'lastname': u' ', u'overridePWLength': True, u'overridePWHistory': False, u'password': u'asdf', u'CtxBrokenSession': u'0000', u'CtxReconnectSession': u'0000', u'CtxCfgClientDrivers': False, u'locked': u'none', u'$options$': {u'samba': True, u'kerberos': True, u'person': True, u'posix': True, u'mail': True, u'pki': False, u'ldap_pwd': False}, u'CtxCfgTSLogon': False, u'pwdChangeNextLogin': False, u'CtxCfgDefaultClientPrinters': False}, u'options': {u'container': u'cn=users,dc=test,dc=intranet', u'objectType': u'users/user'}}]

The LDAP-addlist looks like:
Adding 'uid=asdf,cn=users,dc=test,dc=intranet' with [('objectClass', ['top', 'person', 'univentionPWHistory', 'posixAccount', 'shadowAccount', 'univentionMail', 'sambaSamAccount', 'organizationalPerson', 'inetOrgPerson', 'krb5Principal', 'krb5KDCEntry']), ('uid', ['asdf']), ('uidNumber', ['2276']), ('gidNumber', ['5001']), ('sambaSID', ['S-1-5-21-881882737-451698983-2019128337-5554']), ('krb5PrincipalName', ['asdf@TEST.INTRANET']), ('krb5MaxLife', '86400'), ('krb5MaxRenew', '604800'), ('uidNumber', '', ''), ('mail', '', ''), ('homeDirectory', '', '/home/asdf'), ('uid', '', 'asdf'), ('loginShell', '', '/bin/bash'), ('mailPrimaryAddress', '', ''), ('cn', '', ''), ('sn', '', ' '), ('givenName', '', None), ('displayName', None, ''), ('krb5PrincipalName', [], ['asdf@TEST.INTRANET']), ('pwhistory', '', '$6$KOmF4QkqjRoSbTdt$ueqFyLl2Ph0iOqMVmj0UCMiiMv6hcSUhRP35A2wxpgpwVNIUKPdjTJKAL9Mv9peZWLGb8uVeNrecEcPaDgPeB/'), ('shadowMax', '', ''), ('userPassword', '', '{crypt}$6$Q6NaAQT4E2qxHLjg$xMuTTBmblvHQjxb/.WjHZpxSfhEe1qTvHEzwGDYTxZqnwYzNDpxNiPUTjSIr9WdwwUdx9lDXMrJ65/VWVob7D1'), ('sambaAcctFlags', '', '[U          ]'), ('sambaNTPassword', '', 'E5810F3C99AE2ABB2232ED8458A61309'), ('sambaLMPassword', '', ''), ('sambaPasswordHistory', '', 'A3A6FD1166D3772FECFAE7AF3A10124B17E3C37DF268E84080CC60B71E4D1C5C'), ('krb5Key', [], ['0K\xa1+0)\xa0\x03\x02\x01\x12\xa1"\x04 b\xc1\xe1?\x90\xf2\x1fD\xe7\xbe-\x8b\xcf\xe9#\x18\xc0\xdf\x863M\x0e\x1bn\x05jM\xceMs\xd8\xed\xa2\x1c0\x1a\xa0\x03\x02\x01\x03\xa1\x13\x04\x11TEST.INTRANETasdf', '0;\xa1\x1b0\x19\xa0\x03\x02\x01\x11\xa1\x12\x04\x10\xb1\xa0\x04\x8a(\xa9\x83\x03\x01un\xe0\x8b\x0b\xb4\x04\xa2\x1c0\x1a\xa0\x03\x02\x01\x03\xa1\x13\x04\x11TEST.INTRANETasdf', '0C\xa1#0!\xa0\x03\x02\x01\x10\xa1\x1a\x04\x18\xd5\xc8\x19\x1c\xd6z\xf7\x01\xe3\x83u\x1c\xf4*)\xfb&s[\xda\x91,\xc4\x10\xa2\x1c0\x1a\xa0\x03\x02\x01\x03\xa1\x13\x04\x11TEST.INTRANETasdf', '0;\xa1\x1b0\x19\xa0\x03\x02\x01\x17\xa1\x12\x04\x10\xe5\x81\x0f<\x99\xae*\xbb"2\xed\x84X\xa6\x13\t\xa2\x1c0\x1a\xa0\x03\x02\x01\x03\xa1\x13\x04\x11TEST.INTRANETasdf', '03\xa1\x130\x11\xa0\x03\x02\x01\x03\xa1\n\x04\x08\xae\xe6d\xc7R &\xfe\xa2\x1c0\x1a\xa0\x03\x02\x01\x03\xa1\x13\x04\x11TEST.INTRANETasdf', '03\xa1\x130\x11\xa0\x03\x02\x01\x02\xa1\n\x04\x08\xae\xe6d\xc7R &\xfe\xa2\x1c0\x1a\xa0\x03\x02\x01\x03\xa1\x13\x04\x11TEST.INTRANETasdf', '03\xa1\x130\x11\xa0\x03\x02\x01\x01\xa1\n\x04\x08\xae\xe6d\xc7R &\xfe\xa2\x1c0\x1a\xa0\x03\x02\x01\x03\xa1\x13\x04\x11TEST.INTRANETasdf']), ('krb5KDCFlags', [], '126'), ('krb5KeyVersionNumber', [], '1'), ('sambaMungedDial', [''], ['bQAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIABkAAEAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAUAAFABoACAABAEMAdAB4AEMAZgBnAFAAcgBlAHMAZQBuAHQANTUxZTBiYjAYAAgAAQBDAHQAeABDAGYAZwBGAGwAYQBnAHMAMQAwMDAwMDEwMA==']), ('sambaPwdLastSet', '', '1448985213'), ('shadowLastChange', '', '16770'), ('objectClass', ['univentionObject']), ('univentionObjectType', ['users/user'])]
Comment 1 Florian Best univentionstaff 2015-12-01 17:18:43 CET
--- a/management/univention-directory-manager-modules/modules/univention/admin/handlers/users/user.py
+++ b/management/univention-directory-manager-modules/modules/univention/admin/handlers/users/user.py
@@ -2026 +2026 @@ def _ldap_modlist(self):
-               cn = cn.strip()
+               cn = cn.strip() or cn
Comment 2 Stefan Gohmann univentionstaff 2019-01-03 07:17:48 CET
This issue has been filled against UCS 4.0. The maintenance with bug and security fixes for UCS 4.0 has ended on 31st of May 2016.

Customers still on UCS 4.0 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.
Comment 3 Florian Best univentionstaff 2022-04-05 16:57:13 CEST
Fixed during Bug #45842 / git:845be671b38c3985f2d772a749662ad22821d8d6