VirtualBox

Changeset 101227 in vbox


Ignore:
Timestamp:
Sep 21, 2023 7:14:56 PM (12 months ago)
Author:
vboxsync
Message:

FE/VBoxAutostart-posix: Add a config key (per user) which sets VBOX_USER_HOME env variable. This assumes that users normally don't need it, and those who use it have no VMs in the usual place.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-posix.cpp

    r98103 r101227  
    6262#include <iprt/ctype.h>
    6363#include <iprt/dir.h>
     64#include <iprt/env.h>
    6465
    6566#include <signal.h>
     
    443444    PCFGAST pCfgAstUser = NULL;
    444445    PCFGAST pCfgAstPolicy = NULL;
     446    PCFGAST pCfgAstUserHome = NULL;
    445447    bool fAllow = false;
    446448
     
    487489            else
    488490                return RTMsgErrorExit(RTEXITCODE_FAILURE, "'allow' must be either 'true' or 'false'");
     491        }
     492        pCfgAstUserHome = autostartConfigAstGetByName(pCfgAstUser, "VBOX_USER_HOME");
     493        if (   pCfgAstUserHome
     494            && pCfgAstUserHome->enmType == CFGASTNODETYPE_KEYVALUE)
     495        {
     496            rc = RTEnvSet("VBOX_USER_HOME", pCfgAstUserHome->u.KeyValue.aszValue);
     497            if (RT_FAILURE(rc))
     498                return RTMsgErrorExit(RTEXITCODE_FAILURE, "'VBOX_USER_HOME' could not be set for this user");
    489499        }
    490500    }
Note: See TracChangeset for help on using the changeset viewer.

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