VirtualBox

Changeset 99151 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Mar 23, 2023 6:02:50 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156516
Message:

IPRT/testcase: Always resolve the real paths before passing them to the child process. bugref:8053

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstRTProcCreateEx.cpp

    r99145 r99151  
    183183
    184184    char szCWD[RTPATH_MAX];
     185    char szResolved[RTPATH_MAX];
    185186
    186187    /* Try current CWD, whatever that is. */
    187188    RTTESTI_CHECK_RC_OK_RETV(RTPathGetCurrent(szCWD, sizeof(szCWD)));
    188     apszArgs[2] = szCWD;
     189    RTTESTI_CHECK_RC_OK_RETV(RTPathReal(szCWD, szResolved, sizeof(szResolved)));
     190    apszArgs[2] = szResolved;
    189191    RTTESTI_CHECK_RC_RETV(RTProcCreateEx(g_szExecName, apszArgs, RTENV_DEFAULT, fFlags,
    190192                                         NULL, NULL, NULL, pszAsUser, pszPassword,
     
    197199    /* Try temporary directory. */
    198200    RTTESTI_CHECK_RC_OK_RETV(RTPathTemp(szCWD, sizeof(szCWD)));
    199     apszArgs[2] = szCWD;
     201    RTTESTI_CHECK_RC_OK_RETV(RTPathReal(szCWD, szResolved, sizeof(szResolved)));
     202    apszArgs[2] = szResolved;
    200203    RTTESTI_CHECK_RC_RETV(RTProcCreateEx(g_szExecName, apszArgs, RTENV_DEFAULT, fFlags,
    201204                                         NULL, NULL, NULL, pszAsUser, pszPassword,
     
    208211    /* Try user home. */
    209212    RTTESTI_CHECK_RC_OK_RETV(RTPathUserHome(szCWD, sizeof(szCWD)));
    210     apszArgs[2] = szCWD;
     213    RTTESTI_CHECK_RC_OK_RETV(RTPathReal(szCWD, szResolved, sizeof(szResolved)));
     214    apszArgs[2] = szResolved;
    211215    RTTESTI_CHECK_RC_RETV(RTProcCreateEx(g_szExecName, apszArgs, RTENV_DEFAULT, fFlags,
    212216                                         NULL, NULL, NULL, pszAsUser, pszPassword,
Note: See TracChangeset for help on using the changeset viewer.

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