diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2002-01-23 18:35:03 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2002-01-23 18:35:03 +0000 |
commit | f6fc31e1a97d75ab2b37626621ceb0c277120018 (patch) | |
tree | 6a737f322cebd0841aee15b0ca572d24ffe16be4 | |
parent | adbd01afe4fb1e0154aaedde1a7de7f5f1a8f46b (diff) | |
download | newlib-f6fc31e1a97d75ab2b37626621ceb0c277120018.zip newlib-f6fc31e1a97d75ab2b37626621ceb0c277120018.tar.gz newlib-f6fc31e1a97d75ab2b37626621ceb0c277120018.tar.bz2 |
* security.cc (create_token): Use sec_user() to create
SECURITY_ATTRIBUTES structure for primary token.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/security.cc | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7f4358b..303cb1c 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2002-01-23 Corinna Vinschen <corinna@vinschen.de> + * security.cc (create_token): Use sec_user() to create + SECURITY_ATTRIBUTES structure for primary token. + +2002-01-23 Corinna Vinschen <corinna@vinschen.de> + * path.cc (symlink): Fix check for already existing file. 2002-01-21 Christopher Faylor <cgf@redhat.com> diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 6bacfde..82daa13 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -710,7 +710,7 @@ create_token (cygsid &usersid, cygsid &pgrpsid) { sizeof sqos, SecurityImpersonation, SECURITY_STATIC_TRACKING, FALSE }; OBJECT_ATTRIBUTES oa = { sizeof oa, 0, 0, 0, 0, &sqos }; - SECURITY_ATTRIBUTES sa = { sizeof sa, NULL, TRUE }; + char sa_buf[1024]; LUID auth_luid = SYSTEM_LUID; LARGE_INTEGER exp = { QuadPart:0x7fffffffffffffffLL }; @@ -827,9 +827,8 @@ create_token (cygsid &usersid, cygsid &pgrpsid) } /* Convert to primary token. */ - if (!DuplicateTokenEx (token, TOKEN_ALL_ACCESS, &sa, - SecurityImpersonation, TokenPrimary, - &primary_token)) + if (!DuplicateTokenEx (token, MAXIMUM_ALLOWED, sec_user (sa_buf, usersid), + SecurityImpersonation, TokenPrimary, &primary_token)) __seterrno (); out: |