public inbox for cygwin-cvs@sourceware.org help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org> To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: seteuid: allow inheriting impersonation user profile handle Date: Sat, 23 Feb 2019 20:06:00 -0000 [thread overview] Message-ID: <20190223200632.75306.qmail@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=dd3730ed9c1c78176f1aab1b429bb5a105d90a44 commit dd3730ed9c1c78176f1aab1b429bb5a105d90a44 Author: Corinna Vinschen <corinna@vinschen.de> Date: Sat Feb 23 20:48:59 2019 +0100 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> Diff: --- winsup/cygwin/syscalls.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index b103976..a73af67 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. */
reply other threads:[~2019-02-23 20:06 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190223200632.75306.qmail@sourceware.org \ --to=corinna@sourceware.org \ --cc=cygwin-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).