VirtualBox

Ignore:
Timestamp:
Jun 24, 2020 9:40:54 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138796
Message:

Validation Kit/TXS: Resolve executables for EXEC command before feeding into into RTProcCreateEx(), more verbose version.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/TestExecServ/TestExecService.cpp

    r84923 r84924  
    27902790    if (RT_SUCCESS(rc))
    27912791    {
    2792         char *pszExecResolved = RTPathRealDup(pszExecName);
    2793         if (pszExecResolved)
     2792        char szPathResolved[RTPATH_MAX + 1];
     2793        rc = RTPathReal(pszExecName, szPathResolved, sizeof(szPathResolved));
     2794        if (RT_SUCCESS(rc))
    27942795        {
    27952796            /*
     
    27982799            if (g_fDisplayOutput)
    27992800            {
    2800                 RTPrintf("txs: Executing \"%s\" -> \"%s\": ", pszExecName, pszExecResolved);
     2801                RTPrintf("txs: Executing \"%s\" -> \"%s\": ", pszExecName, szPathResolved);
    28012802                for (uint32_t i = 0; i < cArgs; i++)
    28022803                    RTPrintf(" \"%s\"", papszArgs[i]);
     
    28042805            }
    28052806
    2806             rc = RTProcCreateEx(pszExecResolved, papszArgs, pTxsExec->hEnv, 0 /*fFlags*/,
     2807            rc = RTProcCreateEx(szPathResolved, papszArgs, pTxsExec->hEnv, 0 /*fFlags*/,
    28072808                                pTxsExec->StdIn.phChild, pTxsExec->StdOut.phChild, pTxsExec->StdErr.phChild,
    28082809                                *pszUsername ? pszUsername : NULL, NULL, NULL,
     
    28312832                rc = txsDoExecHlp2(pTxsExec);
    28322833            }
    2833             else
    2834                 rc = txsReplyFailure(pPktHdr, "FAILED  ", "Executing process \"%s\" failed with %Rrc",
    2835                                      pszExecResolved, rc);
    2836 
    2837             RTStrFree(pszExecResolved);
    28382834        }
    2839         else
    2840             rc = VERR_NO_MEMORY;
     2835
     2836        if (RT_FAILURE(rc))
     2837           rc = txsReplyFailure(pPktHdr, "FAILED  ", "Executing process \"%s\" failed with %Rrc",
     2838                                pszExecName, rc);
    28412839    }
    28422840    else
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