Skip to content

Commit

Permalink
fix: remove the call to the bash program
Browse files Browse the repository at this point in the history
Remove the call to the bash program.

Log: enhance security
Task: https://pms.uniontech.com/task-view-362563.html
  • Loading branch information
wangrong1069 authored and deepin-bot[bot] committed Sep 13, 2024
1 parent 9ec42bd commit 9b6d242
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion deepin-system-monitor-main/system/cpu_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,17 @@ void CPUSet::read_dmi_cache_info()
if (!spnInfo.contains("KLVV", Qt::CaseInsensitive) && !spnInfo.contains("L540", Qt::CaseInsensitive) && !spnInfo.contains("KLVU", Qt::CaseInsensitive)
&& !spnInfo.contains("PGUV", Qt::CaseInsensitive) && !spnInfo.contains("PGUW", Qt::CaseInsensitive) && !spnInfo.contains("W585", Qt::CaseInsensitive)) {

process.start("bash", QStringList() << "-c" << "dmidecode | grep -i \"String 4\"");
process.start("dmidecode");
process.waitForStarted();
process.waitForFinished();
QString result = process.readAll();
QStringList lines = result.split('\n');
for (const QString &line : lines) {
if (line.contains("String 4", Qt::CaseInsensitive)) {
result = line;
break;
}
}
if(!result.contains("PWC30", Qt::CaseInsensitive)){ //w525
process.close();
return;
Expand Down

0 comments on commit 9b6d242

Please sign in to comment.