diff --git a/contrib/win32/win32compat/misc.c b/contrib/win32/win32compat/misc.c index 23ed9a735..ec6baff0f 100644 --- a/contrib/win32/win32compat/misc.c +++ b/contrib/win32/win32compat/misc.c @@ -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; } diff --git a/contrib/win32/win32compat/pwd.c b/contrib/win32/win32compat/pwd.c index 10a39c5be..89dcef0b2 100644 --- a/contrib/win32/win32compat/pwd.c +++ b/contrib/win32/win32compat/pwd.c @@ -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; }