From 41f77e25f11d2b152d2f4da12d1e6378c64fc78e Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 2 Dec 2014 10:49:47 +0000 Subject: * autoload.cc (CreateProfile): Import. (LoadUserProfileW): Import. * registry.cc (get_registry_hive_path): Move to sec_auth.cc. (load_registry_hive): Remove. * registry.h (get_registry_hive_path): Drop declaration. (load_registry_hive): Ditto. * sec_auth.cc (get_user_profile_directory): Moved from registry.cc and renamed. Take third parameter with buffer length. (load_user_profile): New function taking over for load_registry_hive. Use official functions to load profile. If profile is missing, create it on Vista and later. * security.h (get_user_profile_directory): Declare. (load_user_profile): Declare. * syscalls.cc (seteuid32): Replace call to load_registry_hive with call to load_user_profile. * uinfo.cc (cygheap_user::env_userprofile): Replace call to get_registry_hive_path with call to get_user_profile_directory. --- winsup/cygwin/syscalls.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'winsup/cygwin/syscalls.cc') diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 933bfe464..9890db4f2 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -3387,11 +3387,7 @@ seteuid32 (uid_t uid) NTSTATUS status; if (!request_restricted_uid_switch) - { - /* Avoid having HKCU use default user */ - WCHAR name[128]; - load_registry_hive (usersid.string (name)); - } + load_user_profile (new_token, pw_new, usersid); /* Try setting owner to same value as user. */ status = NtSetInformationToken (new_token, TokenOwner, -- cgit v1.2.3