mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-21 00:07:36 +08:00
* security.cc (open_local_policy): Initialize lsa handle to NULL.
Request only needed access rights in call to LsaOpenPolicy(). (create_token): Check for NULL lsa pointer.
This commit is contained in:
parent
971ec8d310
commit
e37f6c57cd
@ -1,3 +1,9 @@
|
||||
2001-12-29 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* security.cc (open_local_policy): Initialize lsa handle to NULL.
|
||||
Request only needed access rights in call to LsaOpenPolicy().
|
||||
(create_token): Check for NULL lsa pointer.
|
||||
|
||||
2001-12-28 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* cygwin.din: Add symbols for endutent(), getutent(), getutid(),
|
||||
|
@ -181,9 +181,10 @@ static LSA_HANDLE
|
||||
open_local_policy ()
|
||||
{
|
||||
LSA_OBJECT_ATTRIBUTES oa = { 0, 0, 0, 0, 0, 0 };
|
||||
LSA_HANDLE lsa = INVALID_HANDLE_VALUE;
|
||||
LSA_HANDLE lsa = NULL;
|
||||
|
||||
NTSTATUS ret = LsaOpenPolicy(NULL, &oa, POLICY_ALL_ACCESS, &lsa);
|
||||
NTSTATUS ret = LsaOpenPolicy(NULL, &oa, POLICY_VIEW_LOCAL_INFORMATION
|
||||
| POLICY_LOOKUP_NAMES, &lsa);
|
||||
if (ret != STATUS_SUCCESS)
|
||||
set_errno (LsaNtStatusToWinError (ret));
|
||||
return lsa;
|
||||
@ -739,7 +740,7 @@ create_token (cygsid &usersid, cygsid &pgrpsid)
|
||||
goto out;
|
||||
|
||||
/* Open policy object. */
|
||||
if ((lsa = open_local_policy ()) == INVALID_HANDLE_VALUE)
|
||||
if (!(lsa = open_local_policy ()))
|
||||
goto out;
|
||||
|
||||
/* Get logon server. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user