* sec_auth.cc (open_local_policy): Set lsa handle to

INVALID_HANDLE_VALUE when LsaOpenPolicy fails.  Explain why.
This commit is contained in:
Corinna Vinschen 2008-12-15 20:25:44 +00:00
parent 63a89e8464
commit 658fe9ec36
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-12-15 Corinna Vinschen <corinna@vinschen.de>
* sec_auth.cc (open_local_policy): Set lsa handle to
INVALID_HANDLE_VALUE when LsaOpenPolicy fails. Explain why.
2008-12-15 Corinna Vinschen <corinna@vinschen.de>
* setlsapwd.cc (setlsapwd): Simplify code. Only try to call cygserver

View File

@ -159,7 +159,12 @@ open_local_policy (ACCESS_MASK access)
NTSTATUS ret = LsaOpenPolicy (NULL, &oa, access, &lsa);
if (ret != STATUS_SUCCESS)
__seterrno_from_win_error (LsaNtStatusToWinError (ret));
{
__seterrno_from_win_error (LsaNtStatusToWinError (ret));
/* Some versions of Windows set the lsa handle to NULL when
LsaOpenPolicy fails. */
lsa = INVALID_HANDLE_VALUE;
}
return lsa;
}