* sec_auth.cc (lsaauth): Remove local definitions of struct
_TOKEN_LINKED_TOKEN and TokenLinkedToken in favor of definitions from winnt.h. (lsaprivkeyauth): As in lsaauth, fetch linked token if available and return that in favor of default token.
This commit is contained in:
parent
da413e0a39
commit
9e112520ff
|
@ -1,3 +1,11 @@
|
||||||
|
2009-03-18 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* sec_auth.cc (lsaauth): Remove local definitions of struct
|
||||||
|
_TOKEN_LINKED_TOKEN and TokenLinkedToken in favor of definitions
|
||||||
|
from winnt.h.
|
||||||
|
(lsaprivkeyauth): As in lsaauth, fetch linked token if available and
|
||||||
|
return that in favor of default token.
|
||||||
|
|
||||||
2009-03-15 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
|
2009-03-15 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
|
||||||
|
|
||||||
* errno.cc (_sys_errlist): Add ESTRPIPE.
|
* errno.cc (_sys_errlist): Add ESTRPIPE.
|
||||||
|
|
|
@ -1108,12 +1108,6 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
|
||||||
|
|
||||||
if (wincap.has_mandatory_integrity_control ())
|
if (wincap.has_mandatory_integrity_control ())
|
||||||
{
|
{
|
||||||
typedef struct _TOKEN_LINKED_TOKEN
|
|
||||||
{
|
|
||||||
HANDLE LinkedToken;
|
|
||||||
} TOKEN_LINKED_TOKEN, *PTOKEN_LINKED_TOKEN;
|
|
||||||
# define TokenLinkedToken ((TOKEN_INFORMATION_CLASS) 19)
|
|
||||||
|
|
||||||
TOKEN_LINKED_TOKEN linked;
|
TOKEN_LINKED_TOKEN linked;
|
||||||
|
|
||||||
if (GetTokenInformation (user_token, TokenLinkedToken,
|
if (GetTokenInformation (user_token, TokenLinkedToken,
|
||||||
|
@ -1200,13 +1194,28 @@ lsaprivkeyauth (struct passwd *pw)
|
||||||
__seterrno ();
|
__seterrno ();
|
||||||
token = NULL;
|
token = NULL;
|
||||||
}
|
}
|
||||||
else if (!SetHandleInformation (token,
|
else
|
||||||
HANDLE_FLAG_INHERIT,
|
|
||||||
HANDLE_FLAG_INHERIT))
|
|
||||||
{
|
{
|
||||||
__seterrno ();
|
if (wincap.has_mandatory_integrity_control ())
|
||||||
CloseHandle (token);
|
{
|
||||||
token = NULL;
|
TOKEN_LINKED_TOKEN linked;
|
||||||
|
DWORD size;
|
||||||
|
|
||||||
|
if (GetTokenInformation (token, TokenLinkedToken,
|
||||||
|
(PVOID) &linked, sizeof linked, &size))
|
||||||
|
{
|
||||||
|
debug_printf ("Linked Token: %p", linked.LinkedToken);
|
||||||
|
if (linked.LinkedToken)
|
||||||
|
token = linked.LinkedToken;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!SetHandleInformation (token, HANDLE_FLAG_INHERIT,
|
||||||
|
HANDLE_FLAG_INHERIT))
|
||||||
|
{
|
||||||
|
__seterrno ();
|
||||||
|
CloseHandle (token);
|
||||||
|
token = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
Loading…
Reference in New Issue