]> sourceware.org Git - newlib-cygwin.git/commitdiff
* security.cc (open_local_policy): Initialize lsa to
authorCorinna Vinschen <corinna@vinschen.de>
Tue, 21 May 2002 14:50:26 +0000 (14:50 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 21 May 2002 14:50:26 +0000 (14:50 +0000)
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.

winsup/cygwin/ChangeLog
winsup/cygwin/security.cc

index 31559a0d9e2484f4012058cf4d1b09d971e9c6b2..e47287d64e4d7ec0048b231cf8436aed8b1f8062 100644 (file)
@@ -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
index 20a6c2f74b10dc1a78f28696cb49fdfed257ca7f..4d6309073cc0c7d8d2a66c2564db446c33370411 100644 (file)
@@ -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. */
This page took 0.036509 seconds and 5 git commands to generate.