VirtualBox

Ignore:
Timestamp:
Dec 1, 2021 3:04:59 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148560
Message:

VBoxService: Must claim all argv[0] strings starting with 'vbox_' just like vgsvcGstCtrlProcessResolveExecutable does.

File:
1 edited

Legend:

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

    r92658 r92664  
    17141714        if (argc < 2 || strcmp(argv[1], "--use-toolbox"))
    17151715        {
    1716             /** @todo must check for 'vbox_' and fail with a complaint that the tool does
    1717              *        not exist, because vgsvcGstCtrlProcessResolveExecutable will send
    1718              *        us anything with 'vbox_' as a prefix and no absolute path.  So,
    1719              *        handing non-existing vbox_xxx tools to the regular VBoxService main
    1720              *        routine is inconsistent and bound to cause trouble. */
    1721             return false;
     1716            /* We must match vgsvcGstCtrlProcessResolveExecutable here and claim
     1717               everything starting with "vbox_". */
     1718            if (!RTStrStartsWith(pszTool, "vbox_"))
     1719                return false;
     1720            RTMsgError("Unknown tool: %s\n", pszTool);
     1721            *prcExit = RTEXITCODE_SYNTAX;
     1722            return true;
    17221723        }
    17231724
     
    17251726        if (argc < 3)
    17261727        {
    1727             vgsvcToolboxShowUsage();
     1728            RTMsgError("No tool following --use-toolbox\n");
    17281729            *prcExit = RTEXITCODE_SYNTAX;
    17291730            return true;
     
    17361737        if (!pTool)
    17371738        {
    1738            *prcExit = RTEXITCODE_SUCCESS;
    1739            if (!strcmp(pszTool, "-V"))
    1740            {
    1741                vgsvcToolboxShowVersion();
    1742                return true;
    1743            }
    1744            if (   strcmp(pszTool, "help")
    1745                && strcmp(pszTool, "--help")
    1746                && strcmp(pszTool, "-h"))
    1747                *prcExit = RTEXITCODE_SYNTAX;
    1748            vgsvcToolboxShowUsage();
    1749            return true;
     1739            *prcExit = RTEXITCODE_SUCCESS;
     1740            if (   !strcmp(pszTool, "-V")
     1741                || !strcmp(pszTool, "version"))
     1742                vgsvcToolboxShowVersion();
     1743            else if (   !strcmp(pszTool, "help")
     1744                     || !strcmp(pszTool, "--help")
     1745                     || !strcmp(pszTool, "-h"))
     1746                vgsvcToolboxShowUsage();
     1747            else
     1748            {
     1749                RTMsgError("Unknown tool: %s\n", pszTool);
     1750                *prcExit = RTEXITCODE_SYNTAX;
     1751            }
     1752            return true;
    17501753        }
    17511754    }
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