Re: [Spice-devel] [PATCH] vdagent-win: Assure you set a new HKEY_CURRENT_USER changing user.

2015-04-24 Thread Christophe Fergeau
On Thu, Apr 23, 2015 at 09:09:05AM -0400, Frediano Ziglio wrote: > Anyway when you impersonate a user HKEY_CURRENT_USER is pointed to > HKEY_USERS\ (think as a symbolic link). If > HEKY_CURRENT_USER is already opened (which usually is the case) > Windows do not change the registry key and you will

Re: [Spice-devel] [PATCH] vdagent-win: Assure you set a new HKEY_CURRENT_USER changing user.

2015-04-23 Thread Frediano Ziglio
> > On Thu, Apr 23, 2015 at 09:09:05AM -0400, Frediano Ziglio wrote: > > During impersonation one thing that Windows does is to try to create > > HKEY_CURRENT_USER. This is done automatically for you by Windows when it > > launch a process. > > HKEY_CURRENT_KEY is a predefined key value. > > Anywa

Re: [Spice-devel] [PATCH] vdagent-win: Assure you set a new HKEY_CURRENT_USER changing user.

2015-04-23 Thread Christophe Fergeau
On Thu, Apr 23, 2015 at 09:09:05AM -0400, Frediano Ziglio wrote: > During impersonation one thing that Windows does is to try to create > HKEY_CURRENT_USER. This is done automatically for you by Windows when it > launch a process. > HKEY_CURRENT_KEY is a predefined key value. > Anyway when you im

Re: [Spice-devel] [PATCH] vdagent-win: Assure you set a new HKEY_CURRENT_USER changing user.

2015-04-23 Thread Frediano Ziglio
> > Hey, > > On Thu, Apr 23, 2015 at 08:22:51AM -0400, Frediano Ziglio wrote: > > HKEY_CURRENT_USER is cached as first profile is loaded. Closing the key > > before setting the token allow the system to set a new HKEY_CURRENT_USER. > > Some informations are readed from this key (like Desktop fold

Re: [Spice-devel] [PATCH] vdagent-win: Assure you set a new HKEY_CURRENT_USER changing user.

2015-04-23 Thread Christophe Fergeau
Hey, On Thu, Apr 23, 2015 at 08:22:51AM -0400, Frediano Ziglio wrote: > HKEY_CURRENT_USER is cached as first profile is loaded. Closing the key > before setting the token allow the system to set a new HKEY_CURRENT_USER. > Some informations are readed from this key (like Desktop folder using > shel

[Spice-devel] [PATCH] vdagent-win: Assure you set a new HKEY_CURRENT_USER changing user.

2015-04-23 Thread Frediano Ziglio
HKEY_CURRENT_USER is cached as first profile is loaded. Closing the key before setting the token allow the system to set a new HKEY_CURRENT_USER. Some informations are readed from this key (like Desktop folder using shell APIs). Signed-off-by: Frediano Ziglio --- vdagent/as_user.cpp | 2 ++ 1 fi