1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
samba-mirror/auth/credentials/tests
Alexander Bokovoy eb0474d27b cli_credentials_parse_string: fix parsing of principals
When parsing a principal-like name, user name was left with full
principal instead of taking only the left part before '@' sign.

>>> from samba import credentials
>>> t = credentials.Credentials()
>>> t.parse_string('admin@realm.test', credentials.SPECIFIED)
>>> t.get_username()
'admin@realm.test'

The issue is that cli_credentials_set_username() does a talloc_strdup()
of the argument, so we need to change order of assignment to allow
talloc_strdup() to copy the right part of the string.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-11-04 14:59:34 +00:00
..
bind.py auth/credentials: Test connecting to LDAP with a "virtual user" style account 2020-02-14 15:47:41 +00:00
simple.c auth:creds: Rename CRED_USE_KERBEROS values 2020-11-03 15:25:37 +00:00
test_creds.c cli_credentials_parse_string: fix parsing of principals 2020-11-04 14:59:34 +00:00