public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: seteuid32: don't use INVALID_HANDLE_VALUE
@ 2019-02-23 16:59 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2019-02-23 16:59 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=13b1f9c0d1c6860be91523289c8a6ac6a87cb9db

commit 13b1f9c0d1c6860be91523289c8a6ac6a87cb9db
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Sat Feb 23 17:24:05 2019 +0100

    Cygwin: seteuid32: don't use INVALID_HANDLE_VALUE
    
    NULL is the natural state of an unused handle
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/syscalls.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index f4e8bcf..172b7c4 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -3479,7 +3479,7 @@ seteuid32 (uid_t uid)
 
   cygsid usersid;
   user_groups &groups = cygheap->user.groups;
-  HANDLE new_token = INVALID_HANDLE_VALUE;
+  HANDLE new_token = NULL;
   struct passwd * pw_new;
   bool token_is_internal, issamesid = false;
 
@@ -3550,7 +3550,7 @@ seteuid32 (uid_t uid)
   /* If no impersonation token is available, try to authenticate using
      LSA private data stored password, LSA authentication using our own
      LSA module, or, as last chance, NtCreateToken. */
-  if (new_token == INVALID_HANDLE_VALUE)
+  if (new_token == NULL)
     {
       new_token = lsaprivkeyauth (pw_new);
       if (new_token)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-23 16:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-23 16:59 [newlib-cygwin] Cygwin: seteuid32: don't use INVALID_HANDLE_VALUE Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).