diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2002-05-21 14:50:26 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2002-05-21 14:50:26 +0000 |
commit | 2d6ce5c228fcc3a6522cfd448ef09db1aa7d060e (patch) | |
tree | 97939ef5b1f38dec191084ba699fe87275e6910d /winsup | |
parent | 130e7349a5224c3ca207d3770ca9b5e95fe1d2fb (diff) | |
download | newlib-2d6ce5c228fcc3a6522cfd448ef09db1aa7d060e.zip newlib-2d6ce5c228fcc3a6522cfd448ef09db1aa7d060e.tar.gz newlib-2d6ce5c228fcc3a6522cfd448ef09db1aa7d060e.tar.bz2 |
* security.cc (open_local_policy): Initialize lsa to
INVALID_HANDLE_VALUE instead of NULL.
(get_logon_server_and_user_domain): Test for INVALID_HANDLE_VALUE
instead of NULL.
(create_token): Both of the above.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 8 | ||||
-rw-r--r-- | winsup/cygwin/security.cc | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 31559a0..e47287d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2002-05-19 Pierre Humblet <pierre.humblet@ieee.org> + + * security.cc (open_local_policy): Initialize lsa to + INVALID_HANDLE_VALUE instead of NULL. + (get_logon_server_and_user_domain): Test for INVALID_HANDLE_VALUE + instead of NULL. + (create_token): Both of the above. + 2002-05-18 Christopher Faylor <cgf@redhat.com> * fhandler_disk_file.cc (fhandler_disk_file::fstat): Make handling of diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 20a6c2f..4d63090 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -180,7 +180,7 @@ static LSA_HANDLE open_local_policy () { LSA_OBJECT_ATTRIBUTES oa = { 0, 0, 0, 0, 0, 0 }; - LSA_HANDLE lsa = NULL; + LSA_HANDLE lsa = INVALID_HANDLE_VALUE; NTSTATUS ret = LsaOpenPolicy(NULL, &oa, POLICY_EXECUTE, &lsa); if (ret != STATUS_SUCCESS) @@ -258,7 +258,7 @@ get_logon_server_and_user_domain (char *logonserver, char *userdomain) { BOOL ret = FALSE; LSA_HANDLE lsa = open_local_policy (); - if (lsa) + if (lsa != INVALID_HANDLE_VALUE) { ret = get_lsa_srv_inf (lsa, logonserver, userdomain); close_local_policy (lsa); @@ -723,7 +723,7 @@ HANDLE create_token (cygsid &usersid, cygsid &pgrpsid) { NTSTATUS ret; - LSA_HANDLE lsa = NULL; + LSA_HANDLE lsa = INVALID_HANDLE_VALUE; char logonserver[INTERNET_MAX_HOST_NAME_LENGTH + 1]; int old_priv_state; @@ -764,7 +764,7 @@ create_token (cygsid &usersid, cygsid &pgrpsid) goto out; /* Open policy object. */ - if (!(lsa = open_local_policy ())) + if ((lsa = open_local_policy ()) == INVALID_HANDLE_VALUE) goto out; /* Get logon server. */ |