From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78681 invoked by alias); 23 Feb 2019 16:59:54 -0000 Mailing-List: contact cygwin-cvs-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-cvs-owner@cygwin.com Received: (qmail 78642 invoked by uid 9078); 23 Feb 2019 16:59:53 -0000 Date: Sat, 23 Feb 2019 16:59:00 -0000 Message-ID: <20190223165953.78641.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: seteuid32: don't use INVALID_HANDLE_VALUE X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 322ab51659dbac7ff6b5a6aa5bfb3099a7e11681 X-Git-Newrev: 13b1f9c0d1c6860be91523289c8a6ac6a87cb9db X-SW-Source: 2019-q1/txt/msg00182.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=13b1f9c0d1c6860be91523289c8a6ac6a87cb9db commit 13b1f9c0d1c6860be91523289c8a6ac6a87cb9db Author: Corinna Vinschen 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 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)