VirtualBox

Changeset 42386 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 25, 2012 11:53:18 AM (12 years ago)
Author:
vboxsync
Message:

Autostart: Don't try to start VMs if the settings directory doesn't exist

File:
1 edited

Legend:

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

    r42384 r42386  
    5151#include <iprt/time.h>
    5252#include <iprt/ctype.h>
    53 
     53#include <iprt/dir.h>
    5454
    5555#include <algorithm>
     
    882882        return RTMsgErrorExit(RTEXITCODE_FAILURE, "User is not allowed to autostart VMs");
    883883
     884    /* Don't start if the VirtualBox settings directory does not exist. */
     885    char szUserHomeDir[RTPATH_MAX];
     886    rc = com::GetVBoxUserHomeDirectory(szUserHomeDir, sizeof(szUserHomeDir), false /* fCreateDir */);
     887    if (RT_FAILURE(rc))
     888        return RTMsgErrorExit(RTEXITCODE_FAILURE, "could not get base directory: %Rrc", rc);
     889    else if (!RTDirExists(szUserHomeDir))
     890        return RTEXITCODE_SUCCESS;
     891
    884892    /* create release logger, to stdout */
    885893    char szError[RTPATH_MAX + 128];
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