VirtualBox

Ignore:
Timestamp:
Dec 1, 2021 3:09:04 AM (3 years ago)
Author:
vboxsync
Message:

VBoxService: Replaced the silly RTStrStr(pszExec, 'vbox_') == pszExec with a RTStrStartsWith().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp

    r92663 r92666  
    13481348    bool fExecutingSelf = false;
    13491349#ifdef VBOX_WITH_VBOXSERVICE_TOOLBOX
    1350     if (RTStrStr(pszExec, "vbox_") == pszExec) /** @todo WTF search the whole string for "vbox_" when all you want is to know if whether string starts with "vbox_" or not. geee^2 */
    1351     {
    1352         /* We want to use the internal toolbox (all internal
    1353          * tools are starting with "vbox_" (e.g. "vbox_cat"). */
     1350    /* The "vbox_" prefix is reserved for the toolbox (vbox_cat, vbox_mkdir,
     1351       et al.) and we will replace pszExec with the full VBoxService path instead.  */
     1352    if (RTStrStartsWith(pszExec, "vbox_"))
     1353    {
    13541354        fExecutingSelf = true;
    13551355        rc = vgsvcGstCtrlProcessResolveExecutable(VBOXSERVICE_NAME, szExecExp, sizeof(szExecExp));
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