OSDN Git Service

* security.cc (create_token): Call __sec_user() instead of
authorcorinna <corinna>
Fri, 24 May 2002 14:44:04 +0000 (14:44 +0000)
committercorinna <corinna>
Fri, 24 May 2002 14:44:04 +0000 (14:44 +0000)
sec_user() to remove dependence on allow_ntsec. Verify that
the returned sd is non-null.

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

index e54c5b2..4afbb38 100644 (file)
@@ -1,3 +1,9 @@
+2002-05-22  Pierre Humblet <pierre.humblet@ieee.org>
+
+       * security.cc (create_token): Call __sec_user() instead of
+       sec_user() to remove dependence on allow_ntsec. Verify that
+       the returned sd is non-null.
+
 2002-05-25  Robert Collins   <rbtcollins@hotmail.com>
 
        * gmon.c (fake_sbrk): Correctly return -1 on failed malloc's.
index 4d63090..a5d5fa7 100644 (file)
@@ -854,10 +854,11 @@ create_token (cygsid &usersid, cygsid &pgrpsid)
   else
     {
       /* Set security descriptor and primary group */
-      psa = sec_user (sa_buf, usersid);
-      if (!SetSecurityDescriptorGroup (
-                   (PSECURITY_DESCRIPTOR) psa->lpSecurityDescriptor,
-                   special_pgrp?pgrpsid:well_known_null_sid, FALSE))
+      psa = __sec_user (sa_buf, usersid, TRUE);
+      if (psa->lpSecurityDescriptor && 
+         !SetSecurityDescriptorGroup (
+             (PSECURITY_DESCRIPTOR) psa->lpSecurityDescriptor,
+             special_pgrp?pgrpsid:well_known_null_sid, FALSE))
           debug_printf ("SetSecurityDescriptorGroup %E");
       /* Convert to primary token. */
       if (!DuplicateTokenEx (token, MAXIMUM_ALLOWED, psa,