VirtualBox

Changeset 41100 in vbox


Ignore:
Timestamp:
Apr 30, 2012 3:18:06 PM (13 years ago)
Author:
vboxsync
Message:

better error report if the global settings directory is not accessible

Location:
trunk/src/VBox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdog.cpp

    r41043 r41100  
    10921092    using namespace com;
    10931093    HRESULT hrc = com::Initialize();
     1094# ifdef VBOX_WITH_XPCOM
     1095    if (hrc == NS_ERROR_FILE_ACCESS_DENIED)
     1096    {
     1097        char szHome[RTPATH_MAX] = "";
     1098        com::GetVBoxUserHomeDirectory(szHome, sizeof(szHome));
     1099        return RTMsgErrorExit(RTEXITCODE_FAILURE,
     1100               "Failed to initialize COM because the global settings directory '%s' is not accessible!", szHome);
     1101    }
     1102# endif
    10941103    if (FAILED(hrc))
    10951104        return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to initialize COM (%Rhrc)!", hrc);
  • trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp

    r40383 r41100  
    755755
    756756    rc = com::Initialize();
     757#ifdef VBOX_WITH_XPCOM
     758    if (rc == NS_ERROR_FILE_ACCESS_DENIED)
     759    {
     760        char szHome[RTPATH_MAX] = "";
     761        com::GetVBoxUserHomeDirectory(szHome, sizeof(szHome));
     762        RTPrintf("Failed to initialize COM because the global settings directory '%s' is not accessible!", szHome);
     763        return 1;
     764    }
     765#endif
    757766    if (FAILED(rc))
    758767    {
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r39793 r41100  
    3838#include <iprt/buildconfig.h>
    3939#include <iprt/initterm.h>
     40#include <iprt/path.h>
    4041#include <iprt/stream.h>
    4142#include <iprt/string.h>
     
    333334    using namespace com;
    334335    HRESULT hrc = com::Initialize();
     336# ifdef VBOX_WITH_XPCOM
     337    if (hrc == NS_ERROR_FILE_ACCESS_DENIED)
     338    {
     339        char szHome[RTPATH_MAX] = "";
     340        com::GetVBoxUserHomeDirectory(szHome, sizeof(szHome));
     341        return RTMsgErrorExit(RTEXITCODE_FAILURE,
     342               "Failed to initialize COM because the global settings directory '%s' is not accessible!", szHome);
     343    }
     344# endif
    335345    if (FAILED(hrc))
    336346        return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to initialize COM!");
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r40023 r41100  
    13201320
    13211321    rc = com::Initialize();
     1322#ifdef VBOX_WITH_XPCOM
     1323    if (rc == NS_ERROR_FILE_ACCESS_DENIED)
     1324    {
     1325        char szHome[RTPATH_MAX] = "";
     1326        com::GetVBoxUserHomeDirectory(szHome, sizeof(szHome));
     1327        RTPrintf("Failed to initialize COM because the global settings directory '%s' is not accessible!\n", szHome);
     1328        return 1;
     1329    }
     1330#endif
    13221331    if (FAILED(rc))
    13231332    {
  • trunk/src/VBox/Main/src-server/xpcom/server.cpp

    r41040 r41100  
    884884    if (!pszLogFile)
    885885    {
    886         char szLogFile[RTPATH_MAX];
     886        char szLogFile[RTPATH_MAX] = "";
    887887        vrc = com::GetVBoxUserHomeDirectory(szLogFile, sizeof(szLogFile));
     888        if (vrc == VERR_ACCESS_DENIED)
     889            return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open global settings directory '%s'", szLogFile);
    888890        if (RT_SUCCESS(vrc))
    889891            vrc = RTPathAppend(szLogFile, sizeof(szLogFile), "VBoxSVC.log");
    890892        if (RT_SUCCESS(vrc))
    891893            pszLogFile = RTStrDup(szLogFile);
     894        if (RT_FAILURE(vrc))
     895            return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to determine release log file (%Rrc)", vrc);
    892896    }
    893897    char szError[RTPATH_MAX + 128];
  • trunk/src/VBox/Main/webservice/vboxweb.cpp

    r41045 r41100  
    11431143    // initialize COM/XPCOM
    11441144    HRESULT hrc = com::Initialize();
     1145#ifdef VBOX_WITH_XPCOM
     1146    if (hrc == NS_ERROR_FILE_ACCESS_DENIED)
     1147    {
     1148        char szHome[RTPATH_MAX] = "";
     1149        com::GetVBoxUserHomeDirectory(szHome, sizeof(szHome));
     1150        return RTMsgErrorExit(RTEXITCODE_FAILURE,
     1151               "Failed to initialize COM because the global settings directory '%s' is not accessible!", szHome);
     1152    }
     1153#endif
    11451154    if (FAILED(hrc))
    11461155        return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to initialize COM! hrc=%Rhrc\n", hrc);
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