VirtualBox

Changeset 35227 in vbox


Ignore:
Timestamp:
Dec 17, 2010 2:39:59 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
69072
Message:

VBoxExtPackHelperApp: Older gksu does not grok --description or --.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/VBoxExtPackHelperApp.cpp

    r35226 r35227  
    13161316
    13171317#else
     1318
     1319    /*
     1320     * Several of the alternatives below will require a command line.
     1321     */
     1322    char *pszCmdLine;
     1323    int rc = RTGetOptArgvToString(&pszCmdLine, &papszArgs[cSuArgs], RTGETOPTARGV_CNV_QUOTE_BOURNE_SH);
     1324    if (RT_FAILURE(rc))
     1325        return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptArgvToString failed: %Rrc");
     1326
    13181327    /*
    13191328     * Look for various standard stuff for executing a program as root.
     
    13261335    bool        fHaveDisplayVar = RTEnvExist("DISPLAY");
    13271336    int         iSuArg          = cSuArgs;
    1328     char       *pszCmdLine      = NULL;
    13291337    PRTHANDLE   pStdNull        = NULL;
    13301338    RTHANDLE    StdNull;
    13311339    char        szExecTool[260];
    13321340    char        szXterm[260];
    1333     int         rc;
    13341341
    13351342    /*
     
    13721379            pStdNull = &StdNull;
    13731380
     1381#if 0 /* older gksu does not grok --description nor '--' and multiple args. */
    13741382            iSuArg = cSuArgs - 4;
    13751383            papszArgs[cSuArgs - 4] = szExecTool;
     
    13811389                                   : "VirtualBox extension pack maintainer";
    13821390            papszArgs[cSuArgs - 1] = "--";
     1391#else
     1392            iSuArg = cSuArgs - 2;
     1393            papszArgs[cSuArgs - 2] = szExecTool;
     1394            papszArgs[cSuArgs - 1] = pszCmdLine;
     1395            papszArgs[cSuArgs] = NULL;
     1396#endif
    13831397        }
    13841398        else
     
    14031417             && FindExecTool(szXterm, sizeof(szXterm), "xterm"))
    14041418    {
    1405         rc = RTGetOptArgvToString(&pszCmdLine, &papszArgs[cSuArgs], RTGETOPTARGV_CNV_QUOTE_BOURNE_SH);
    1406         if (RT_SUCCESS(rc))
    1407         {
    1408             iSuArg = cSuArgs - 9;
    1409             papszArgs[cSuArgs - 9] = szXterm;
    1410             papszArgs[cSuArgs - 8] = "-T";
    1411             papszArgs[cSuArgs - 7] = iCmd == CMD_INSTALL
    1412                                    ? "VirtualBox extension pack installer - su"
    1413                                    : iCmd == CMD_UNINSTALL
    1414                                    ? "VirtualBox extension pack uninstaller - su"
    1415                                    : "VirtualBox extension pack maintainer - su";
    1416             papszArgs[cSuArgs - 6] = "-e";
    1417             papszArgs[cSuArgs - 5] = szExecTool;
    1418             papszArgs[cSuArgs - 4] = "-";
    1419             papszArgs[cSuArgs - 3] = "root";
    1420             papszArgs[cSuArgs - 2] = "-c";
    1421             papszArgs[cSuArgs - 1] = pszCmdLine;
    1422             papszArgs[cSuArgs] = NULL;
    1423         }
    1424         else
    1425             RTMsgError("RTGetOptArgvToString failed: %Rrc");
     1419        iSuArg = cSuArgs - 9;
     1420        papszArgs[cSuArgs - 9] = szXterm;
     1421        papszArgs[cSuArgs - 8] = "-T";
     1422        papszArgs[cSuArgs - 7] = iCmd == CMD_INSTALL
     1423                               ? "VirtualBox extension pack installer - su"
     1424                               : iCmd == CMD_UNINSTALL
     1425                               ? "VirtualBox extension pack uninstaller - su"
     1426                               : "VirtualBox extension pack maintainer - su";
     1427        papszArgs[cSuArgs - 6] = "-e";
     1428        papszArgs[cSuArgs - 5] = szExecTool;
     1429        papszArgs[cSuArgs - 4] = "-";
     1430        papszArgs[cSuArgs - 3] = "root";
     1431        papszArgs[cSuArgs - 2] = "-c";
     1432        papszArgs[cSuArgs - 1] = pszCmdLine;
     1433        papszArgs[cSuArgs] = NULL;
    14261434    }
    14271435    else if (fHaveDisplayVar)
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