Esempio n. 1
0
/*
 * The generic SU get method. It retrieves the SU you have installed in your system!
 */
QString WMHelper::getSUCommand(){
  QString result(ctn_NO_SU_COMMAND);

  if (SettingsManager::getPrivilegeEscalationTool() == ctn_AUTOMATIC){
    //User wants the app to automatically choose Privilege escalation tool
    if (isXFCERunning() && (UnixCommand::hasTheExecutable(ctn_GKSU_2))){
      result = getGKSUCommand();
    }
    else if (isKDERunning() && UnixCommand::hasTheExecutable(ctn_KDESU)){
      result = getKDESUCommand();
    }
    else if (isTDERunning() && UnixCommand::hasTheExecutable(ctn_TDESU)){
      result = getTDESUCommand();
    }
    else if (UnixCommand::hasTheExecutable(ctn_GKSU_2)){
      result = getGKSUCommand();
    }
    else if (UnixCommand::isKtsussVersionOK()){
      result = getKTSUSSCommand();
    }
    else if (UnixCommand::hasTheExecutable(ctn_KDESU)){
      result = getKDESUCommand();
    }
    else if (UnixCommand::hasTheExecutable(ctn_TDESU)){
      result = getTDESUCommand();
    }
    //Otherwise, user chose his own privilege escalation tool...
    else if (SettingsManager::getPrivilegeEscalationTool() == ctn_GKSU_2)
      result = getGKSUCommand();
    else if (SettingsManager::getPrivilegeEscalationTool() == ctn_KDESU)
      result = getKDESUCommand();
    else if (SettingsManager::getPrivilegeEscalationTool() == ctn_TDESU)
      result = getTDESUCommand();
    else if (SettingsManager::getPrivilegeEscalationTool() == ctn_KTSUSS){
      result = getKTSUSSCommand();
    }
  }

  return result;
}
Esempio n. 2
0
/*
 * The generic SU get method. It retrieves the SU you have installed in your system!
 */
QString WMHelper::getSUCommand(){
  QString result(ctn_NO_SU_COMMAND);

  if (isXFCERunning() && (UnixCommand::hasTheExecutable(ctn_GKSU_2))){
    result = getGKSUCommand();
  }
  else if (isKDERunning() && UnixCommand::hasTheExecutable(ctn_KDESU)){
    result = getKDESUCommand();
  }
  else if (isTDERunning() && UnixCommand::hasTheExecutable(ctn_TDESU)){
    result = getTDESUCommand();
  }
  else if (UnixCommand::hasTheExecutable(ctn_GKSU_2)){
    result = getGKSUCommand();
  }
  else if (UnixCommand::hasTheExecutable(ctn_KDESU)){
    result = getKDESUCommand();
  }
  else if (UnixCommand::hasTheExecutable(ctn_TDESU)){
    result = getTDESUCommand();
  }

  return result;
}