* cygwin.din: Define symbols for `cygwin_logon_user' and
`cygwin_set_impersonation_token'. * dcrt0.cc (dll_crt0_1): Eliminate superfluous conditional statements. Add load statements for `ImpersonateLoggedOnUser', `LogonUserA' and `RevertToSelf'. * fork.cc (fork): Care for correct impersonation of parent and child process. * security.cc (cygwin_set_impersonation_token): New function. (cygwin_logon_user): Ditto. shared.h (class pinfo): New members `orig_uid', `orig_gid', `real_uid' nad `real_gid'. spawn.cc (spawn_guts): Care for impersonation when starting child process in a different user context. * syscalls.cc (setgid): Call `setegid' now. Set real_gid. (setuid): Call `seteuid' now. Set real_uid. (seteuid): Functionality moved from setuid to here. Care for correct impersonation. (setegid): Functionality moved from setgid to here. * uinfo.cc (uinfo_init): Initialization of additional pinfo members. (getuid): Return real uid. (getgid): Return real gid. (geteuid): Return effective uid. (getegid): Return effective gid. include/sys/cygwin.h: Add prototypes for `cygwin_logon_user' and `cygwin_set_impersonation_token'. include/cygwin/version.h: Bumb API minor version to 22.
This commit is contained in:
@@ -763,10 +763,9 @@ dll_crt0_1 ()
|
||||
/* Flush signals and ensure that signal thread is up and running. Can't
|
||||
do this for noncygwin case since the signal thread is blocked due to
|
||||
LoadLibrary serialization. */
|
||||
if (!dynamically_loaded)
|
||||
sig_send (NULL, __SIGFLUSH); /* also initializes uid, gid */
|
||||
sig_send (NULL, __SIGFLUSH); /* also initializes uid, gid */
|
||||
|
||||
if (user_data->main && !dynamically_loaded)
|
||||
if (user_data->main)
|
||||
exit (user_data->main (argc, argv, *user_data->envptr));
|
||||
}
|
||||
|
||||
@@ -1157,10 +1156,12 @@ LoadDLLfunc (GetSidSubAuthority, 8, advapi32)
|
||||
LoadDLLfunc (GetSidSubAuthorityCount, 4, advapi32)
|
||||
LoadDLLfunc (GetTokenInformation, 20, advapi32)
|
||||
LoadDLLfunc (GetUserNameA, 8, advapi32)
|
||||
LoadDLLfunc (ImpersonateLoggedOnUser, 4, advapi32)
|
||||
LoadDLLfunc (InitializeAcl, 12, advapi32)
|
||||
LoadDLLfunc (InitializeSecurityDescriptor, 8, advapi32)
|
||||
LoadDLLfunc (InitializeSid, 12, advapi32)
|
||||
LoadDLLfunc (IsValidSid, 4, advapi32)
|
||||
LoadDLLfunc (LogonUserA, 24, advapi32)
|
||||
LoadDLLfunc (LookupAccountNameA, 28, advapi32)
|
||||
LoadDLLfunc (LookupAccountSidA, 28, advapi32)
|
||||
LoadDLLfunc (LookupPrivilegeValueA, 12, advapi32)
|
||||
@@ -1175,6 +1176,7 @@ LoadDLLfunc (RegQueryValueExA, 24, advapi32)
|
||||
LoadDLLfunc (RegSetValueExA, 24, advapi32)
|
||||
LoadDLLfunc (RegisterEventSourceA, 8, advapi32)
|
||||
LoadDLLfunc (ReportEventA, 36, advapi32)
|
||||
LoadDLLfunc (RevertToSelf, 0, advapi32)
|
||||
LoadDLLfunc (SetKernelObjectSecurity, 12, advapi32)
|
||||
LoadDLLfunc (SetSecurityDescriptorDacl, 16, advapi32)
|
||||
LoadDLLfunc (SetSecurityDescriptorGroup, 12, advapi32)
|
||||
|
Reference in New Issue
Block a user