Changeset 35227 in vbox
- Timestamp:
- Dec 17, 2010 2:39:59 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 69072
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/VBoxExtPackHelperApp.cpp
r35226 r35227 1316 1316 1317 1317 #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 1318 1327 /* 1319 1328 * Look for various standard stuff for executing a program as root. … … 1326 1335 bool fHaveDisplayVar = RTEnvExist("DISPLAY"); 1327 1336 int iSuArg = cSuArgs; 1328 char *pszCmdLine = NULL;1329 1337 PRTHANDLE pStdNull = NULL; 1330 1338 RTHANDLE StdNull; 1331 1339 char szExecTool[260]; 1332 1340 char szXterm[260]; 1333 int rc;1334 1341 1335 1342 /* … … 1372 1379 pStdNull = &StdNull; 1373 1380 1381 #if 0 /* older gksu does not grok --description nor '--' and multiple args. */ 1374 1382 iSuArg = cSuArgs - 4; 1375 1383 papszArgs[cSuArgs - 4] = szExecTool; … … 1381 1389 : "VirtualBox extension pack maintainer"; 1382 1390 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 1383 1397 } 1384 1398 else … … 1403 1417 && FindExecTool(szXterm, sizeof(szXterm), "xterm")) 1404 1418 { 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; 1426 1434 } 1427 1435 else if (fHaveDisplayVar)
Note:
See TracChangeset
for help on using the changeset viewer.