* Executes the given command using QProcess async technology with ROOT credentials */
| 1053 | * Executes the given command using QProcess async technology with ROOT credentials |
| 1054 | */ |
| 1055 | void UnixCommand::executeCommandWithSharedMemHelper(const QString &pCommand, QSharedMemory *sharedMem) |
| 1056 | { |
| 1057 | //Checks if octopi-helper is running. If so, we exit! |
| 1058 | if (isOctopiHelperRunning()) return; |
| 1059 | |
| 1060 | //COLUMNS variable code! |
| 1061 | QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); |
| 1062 | env.remove(QStringLiteral("COLUMNS")); |
| 1063 | env.insert(QStringLiteral("COLUMNS"), QStringLiteral("132")); |
| 1064 | m_process->setProcessEnvironment(env); |
| 1065 | |
| 1066 | /*if (!sharedMem->attach(QSharedMemory::ReadWrite)) |
| 1067 | { |
| 1068 | qDebug() << "\nDetaching and creating new SharedMem...\n"; |
| 1069 | sharedMem->detach(); |
| 1070 | UnixCommand::removeSharedMemFiles(); |
| 1071 | }*/ |
| 1072 | |
| 1073 | buildOctopiHelperCommandWithSharedMem(pCommand, sharedMem); |
| 1074 | |
| 1075 | QStringList sl; |
| 1076 | sl << ctn_QTSUDO_PARAMS; |
| 1077 | sl << ctn_OCTOPI_HELPER_PATH << QStringLiteral("-ts"); |
| 1078 | m_process->start(WMHelper::getSUCommand(), sl); |
| 1079 | } |
| 1080 | |
| 1081 | /* |
| 1082 | * Executes the given command using QProcess async technology as a normal user |
no outgoing calls
no test coverage detected