public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: authentication: Always initialize domain info
@ 2019-03-01 20:09 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2019-03-01 20:09 UTC (permalink / raw)
  To: cygwin-cvs

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

commit 166913fb23dd7ac0c63976a2f4e40a9e44ca41ca
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Fri Mar 1 21:08:09 2019 +0100

    Cygwin: authentication: Always initialize domain info
    
    ...before calling any of its method.  It's no safe bet that
    it's already initialized when calling s4uauth and adding it
    to load_user_profile certainly doesn't hurt.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/sec_auth.cc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/winsup/cygwin/sec_auth.cc b/winsup/cygwin/sec_auth.cc
index ee740fa..2f04801 100644
--- a/winsup/cygwin/sec_auth.cc
+++ b/winsup/cygwin/sec_auth.cc
@@ -234,6 +234,10 @@ load_user_profile (HANDLE token, struct passwd *pw, cygpsid &usersid)
   WCHAR userpath[MAX_PATH];
   PROFILEINFOW pi;
 
+  /* Initialize */
+  if (!cygheap->dom.init ())
+    return NULL;
+
   extract_nt_dom_user (pw, domain, username);
   usersid.string (sid);
   debug_printf ("user: <%W> <%W> <%W>", username, domain, sid);
@@ -1533,6 +1537,10 @@ s4uauth (bool logon, PCWSTR domain, PCWSTR user, NTSTATUS &ret_status)
   QUOTA_LIMITS quota;
   HANDLE token = NULL;
 
+  /* Initialize */
+  if (!cygheap->dom.init ())
+    return NULL;
+
   push_self_privilege (SE_TCB_PRIVILEGE, true);
 
   if (logon)


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

only message in thread, other threads:[~2019-03-01 20:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-01 20:09 [newlib-cygwin] Cygwin: authentication: Always initialize domain info 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).