diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2019-02-23 23:06:12 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2019-02-23 23:06:12 +0300 |
commit | bcb33dc4f0552e749dcb6c44e1ef7815b5db75a1 (patch) | |
tree | bf8ceb0d7c4a978055d2c602c52bf2c6fdfc1a0b /winsup/cygwin | |
parent | dd3730ed9c1c78176f1aab1b429bb5a105d90a44 (diff) |
Cywin: user profile: unload impersonation user profile on exit
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/cygheap.h | 5 | ||||
-rw-r--r-- | winsup/cygwin/pinfo.cc | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h index 5c5e3cd1e..4d9feb072 100644 --- a/winsup/cygwin/cygheap.h +++ b/winsup/cygwin/cygheap.h @@ -193,6 +193,11 @@ public: { return effec_cygsid.string (buf); } + void exit () + { + if (imp_profile_token && imp_profile) + unload_user_profile (imp_profile_token, imp_profile); + } const char __reg3 *test_uid (char *&, const char *, size_t); }; diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 064299e0c..e29c00746 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -224,6 +224,7 @@ pinfo::exit (DWORD n) exitcode = ((exitcode & 0xff) << 8) | ((exitcode >> 8) & 0xff); sigproc_printf ("Calling dlls.cleanup_forkables n %y, exitcode %y", n, exitcode); dlls.cleanup_forkables (); + cygheap->user.exit (); sigproc_printf ("Calling ExitProcess n %y, exitcode %y", n, exitcode); if (!TerminateProcess (GetCurrentProcess (), exitcode)) system_printf ("TerminateProcess failed, %E"); |