VirtualBox

Changeset 47777 in vbox


Ignore:
Timestamp:
Aug 15, 2013 5:42:39 PM (11 years ago)
Author:
vboxsync
Message:

Main/glue: for XPCOM, look for the components subdirectory one level up if we're running testcases in a non-hardened build

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/glue/initterm.cpp

    r47117 r47777  
    363363    {
    364364        NULL, /* 0: will use VBOX_APP_HOME */
    365         NULL, /* 1: will try RTPathAppPrivateArch() */
    366 #ifdef RT_OS_LINUX
    367         "/usr/lib/virtualbox",
    368         "/opt/VirtualBox",
    369 #elif RT_OS_SOLARIS
    370         "/opt/VirtualBox/amd64",
    371         "/opt/VirtualBox/i386",
    372 #elif RT_OS_DARWIN
    373         "/Application/VirtualBox.app/Contents/MacOS",
    374 #endif
     365        NULL, /* 1: will try RTPathAppPrivateArch(), correctly installed release builds will never go further */
     366        NULL, /* 2: will try parent directory of RTPathAppPrivateArch(), only for testcases in non-hardened builds */
     367        /* There used to be hard coded paths, but they only caused trouble
     368         * because they often led to mixing of builds or even versions.
     369         * If you feel tempted to add anything here, think again. They would
     370         * only be used if option 1 would not work, which is a sign of a big
     371         * problem, as it returns a fixed location defined at compile time.
     372         * It is better to fail than blindly trying to cover the problem. */
    375373    };
    376374
     
    393391            vrc = RTPathAppPrivateArch(szAppHomeDir, sizeof(szAppHomeDir));
    394392            AssertRC(vrc);
     393        }
     394        else if (i == 2)
     395        {
     396#ifdef VBOX_WITH_HARDENING
     397            continue;
     398#else /* !VBOX_WITH_HARDENING */
     399            /* Use parent of RTPathAppPrivateArch() if ends with "testcase" */
     400            vrc = RTPathAppPrivateArch(szAppHomeDir, sizeof(szAppHomeDir));
     401            AssertRC(vrc);
     402            vrc = RTPathStripTrailingSlash(szAppHomeDir);
     403            AssertRC(vrc);
     404            char *filename = RTPathFilename(szAppHomeDir);
     405            if (!filename || strcmp(filename, "testcase"))
     406                continue;
     407            RTPathStripFilename(szAppHomeDir);
     408#endif /* !VBOX_WITH_HARDENING */
    395409        }
    396410        else
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