summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
Diffstat (limited to 'auth')
-rw-r--r--auth/credentials/credentials.c5
-rw-r--r--auth/credentials/tests/test_creds.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c
index 53bba78176b..21c170c7ad9 100644
--- a/auth/credentials/credentials.c
+++ b/auth/credentials/credentials.c
@@ -860,10 +860,11 @@ _PUBLIC_ void cli_credentials_parse_name(struct cli_credentials *credentials, co
* in order to undo the effect of
* cli_credentials_guess().
*/
- cli_credentials_set_principal(credentials, uname, obtained);
- *p = 0;
cli_credentials_set_username(credentials, uname, obtained);
cli_credentials_set_domain(credentials, "", obtained);
+
+ cli_credentials_set_principal(credentials, uname, obtained);
+ *p = 0;
cli_credentials_set_realm(credentials, p+1, obtained);
return;
} else if ((p = strchr_m(uname,'\\'))
diff --git a/auth/credentials/tests/test_creds.c b/auth/credentials/tests/test_creds.c
index 38550d6ecf9..ac5bc6d9e04 100644
--- a/auth/credentials/tests/test_creds.c
+++ b/auth/credentials/tests/test_creds.c
@@ -187,7 +187,7 @@ static void torture_creds_parse_string(void **state)
assert_string_equal(creds->domain, "");
assert_int_equal(creds->domain_obtained, CRED_SPECIFIED);
- assert_string_equal(creds->username, "wurst");
+ assert_string_equal(creds->username, "wurst@brot.realm");
assert_int_equal(creds->username_obtained, CRED_SPECIFIED);
assert_string_equal(creds->principal, "wurst@brot.realm");