VirtualBox

Changeset 57661 in vbox


Ignore:
Timestamp:
Sep 9, 2015 11:42:26 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
102563
Message:

Guest Control/VBoxService: Fixed adopting main service's env var USERPROFILE on Windows guests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp

    r57660 r57661  
    19891989                    }
    19901990                }
     1991
     1992#ifdef RT_OS_WINDOWS
     1993                if (RT_SUCCESS(rc))
     1994                {
     1995                    /*
     1996                     * On Windows, when VBoxService was started as local service via SCM, the environment variable
     1997                     * USERPROFILE was set to point to LocalService's user directory.
     1998                     *
     1999                     * As we want to make sure that USERPROFILE actually points to the directory of the user we want
     2000                     * to spawn the guest process for, unset the variable here before handing the environment block over
     2001                     * to RTProcCreateEx().
     2002                     *
     2003                     * Note: RTProcCreateEx() in turn will *not* overwrite _any_ of already set
     2004                     *       environment variables by default! */
     2005                    RTEnvUnsetEx(hEnv, "USERPROFILE");
     2006                }
     2007#endif
    19912008            }
    19922009
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette