Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2019-02-23 22:48:59 +0300
committerCorinna Vinschen <corinna@vinschen.de>2019-02-23 22:48:59 +0300
commitdd3730ed9c1c78176f1aab1b429bb5a105d90a44 (patch)
treec528acac748fdd45c88045dfce0c232be505aaf0
parent8eee25241e86fc596acde25c7c53723b75afee30 (diff)
Cygwin: seteuid: allow inheriting impersonation user profile handle
The child process needs access to the handle to be able to unload it when switching user context. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/syscalls.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index b1039762d..a73af6748 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -3612,7 +3612,11 @@ seteuid32 (uid_t uid)
cygheap->user.imp_profile = load_user_profile (new_token, pw_new,
usersid);
if (cygheap->user.imp_profile)
- cygheap->user.imp_profile_token = new_token;
+ {
+ cygheap->user.imp_profile_token = new_token;
+ SetHandleInformation (cygheap->user.imp_profile,
+ HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
+ }
}
/* Try setting owner to same value as user. */