From 58cc7a6498ce0da7f4acb79d837eadcf29c8a381 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 28 Mar 2014 20:34:04 +0000 Subject: [PATCH] * sec_auth.cc (create_token): Initialize lsa handle to NULL, rather than to INVALID_HANDLE_VALUE. (lsaauth): Ditto. (lsaprivkeyauth): Ditto. * setlsapwd.cc (setlsapwd): Don't initialize lsa handle. --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/sec_auth.cc | 6 +++--- winsup/cygwin/setlsapwd.cc | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ec59df527..5bad8b00e 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2014-03-28 Corinna Vinschen + + * sec_auth.cc (create_token): Initialize lsa handle to NULL, rather than + to INVALID_HANDLE_VALUE. + (lsaauth): Ditto. + (lsaprivkeyauth): Ditto. + * setlsapwd.cc (setlsapwd): Don't initialize lsa handle. + 2014-03-28 Corinna Vinschen * exceptions.cc (_cygtls::signal_debugger): Move memcpy to copy context diff --git a/winsup/cygwin/sec_auth.cc b/winsup/cygwin/sec_auth.cc index 30bebfedf..b175fbbeb 100644 --- a/winsup/cygwin/sec_auth.cc +++ b/winsup/cygwin/sec_auth.cc @@ -768,7 +768,7 @@ HANDLE create_token (cygsid &usersid, user_groups &new_groups, struct passwd *pw) { NTSTATUS status; - LSA_HANDLE lsa = INVALID_HANDLE_VALUE; + LSA_HANDLE lsa = NULL; cygsidlist tmp_gsids (cygsidlist_auto, 12); @@ -932,7 +932,7 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw) cygsidlist tmp_gsids (cygsidlist_auto, 12); cygpsid pgrpsid; LSA_STRING name; - HANDLE lsa_hdl = NULL, lsa = INVALID_HANDLE_VALUE; + HANDLE lsa_hdl = NULL, lsa = NULL; LSA_OPERATIONAL_MODE sec_mode; NTSTATUS status, sub_status; ULONG package_id, size; @@ -1173,7 +1173,7 @@ HANDLE lsaprivkeyauth (struct passwd *pw) { NTSTATUS status; - HANDLE lsa = INVALID_HANDLE_VALUE; + HANDLE lsa = NULL; HANDLE token = NULL; WCHAR sid[256]; WCHAR domain[MAX_DOMAIN_NAME_LEN + 1]; diff --git a/winsup/cygwin/setlsapwd.cc b/winsup/cygwin/setlsapwd.cc index 14eb12eeb..eb3b9e6bf 100644 --- a/winsup/cygwin/setlsapwd.cc +++ b/winsup/cygwin/setlsapwd.cc @@ -40,7 +40,7 @@ unsigned long setlsapwd (const char *passwd, const char *username) { unsigned long ret = (unsigned long) -1; - HANDLE lsa = INVALID_HANDLE_VALUE; + HANDLE lsa; WCHAR sid[128]; WCHAR key_name[128 + wcslen (CYGWIN_LSA_KEY_PREFIX)]; PWCHAR data_buf = NULL;