*/
_PUBLIC_ char *cli_credentials_get_principal_and_obtained(struct cli_credentials *cred, TALLOC_CTX *mem_ctx, enum credentials_obtained *obtained)
{
+ const char *username = cli_credentials_get_username(cred);
+ const char *p;
+
if (cred->machine_account_pending) {
cli_credentials_set_machine_account(cred,
cred->machine_account_pending_lp_ctx);
}
}
+ p = strchr_m(username, '@');
+ if (p != NULL) {
+ *obtained = cred->username_obtained;
+ return talloc_strdup(mem_ctx, username);
+ }
+
if (cred->principal_obtained < cred->username_obtained
|| cred->principal_obtained < MAX(cred->domain_obtained, cred->realm_obtained)) {
const char *effective_username = NULL;