diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2002-05-24 18:44:05 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2002-05-24 18:44:05 +0400 |
commit | 908f9b653b602b5161152d97a7213c6024b1ffb7 (patch) | |
tree | 45adc708f4ff158ccd4c78c4ca876bbdae2e1e2a /winsup/cygwin/security.cc | |
parent | f1b53fa94ce9cd5be49f620e6416b211b0b9421a (diff) |
* 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.
Diffstat (limited to 'winsup/cygwin/security.cc')
-rw-r--r-- | winsup/cygwin/security.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 4d6309073..a5d5fa766 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -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, |