Commit d1d200b2 authored by Rom Walton's avatar Rom Walton Committed by Oliver Bock

- VBOX: On *nix systems, force the wrapper into sandbox mode if the

        HOME environment variable is missing.  Without the HOME environment
        variable VirtualBox attempts to write log files and other state
        information in root's home directory.
parent be553882
......@@ -7936,3 +7936,12 @@ David 27 Dec 2012
api/
boinc_api.cpp
Rom 28 Dec 2012
- VBOX: On *nix systems, force the wrapper into sandbox mode if the
HOME environment variable is missing. Without the HOME environment
variable VirtualBox attempts to write log files and other state
information in root's home directory.
samples\vboxwrapper\
vbox.cpp
......@@ -113,6 +113,7 @@ int VBOX_VM::initialize() {
string new_path;
string virtualbox_user_home;
APP_INIT_DATA aid;
bool force_sandbox = false;
char buf[256];
boinc_get_init_data_p(&aid);
......@@ -138,10 +139,21 @@ int VBOX_VM::initialize() {
}
#endif
// On *nix style systems, VirtualBox expects that there is a home directory specified
// by environment variable. When it doesn't exist it attempts to store logging information
// in root's home directory. Bad things happen if the process isn't owned by root.
//
// if the HOME environment variable is missing force VirtualBox to use a directory it
// has a reasonable chance of writing log files too.
#ifndef _WIN32
if (NULL == getenv("HOME")) {
force_sandbox = true;
}
#endif
// Set the location in which the VirtualBox Configuration files can be
// stored for this instance.
//
if (aid.using_sandbox) {
if (aid.using_sandbox || force_sandbox) {
virtualbox_user_home = aid.project_dir;
virtualbox_user_home += "/../virtualbox";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment