fix the error message when user tries to login with just domain name

This commit is contained in:
bagajjal 2021-05-12 14:09:30 -07:00
parent 1abee49b13
commit 4d2ea7f2f2
2 changed files with 3 additions and 3 deletions

View File

@ -1650,7 +1650,8 @@ lookup_sid(const wchar_t* name_utf16, PSID psid, DWORD * psid_len)
}
if (_wcsicmp(name_utf16, computer_name) != 0) {
error_f("For SidTypeDomain, username:%ls must be same as machine name:%ls", name_utf16, computer_name);
errno = ENOENT;
error_f("Invalid account type: %d for user:%S", n_use, name_utf16);
goto cleanup;
}

View File

@ -215,8 +215,7 @@ get_passwd(const wchar_t * user_utf16, PSID sid)
/* else attempt to lookup the account; this will verify the account is valid and
* is will return its sid and the realm that owns it */
else if (lookup_sid(user_utf16_modified, binary_sid, &sid_size) == NULL) {
errno = ENOENT;
debug("%s: lookup_sid() failed: %d.", __FUNCTION__, GetLastError());
debug("%s: lookup_sid() failed: %d.", __FUNCTION__, errno);
goto cleanup;
}