Skip to content

Commit

Permalink
Remove ALLOW_PRIVILEGE_ESCALATION
Browse files Browse the repository at this point in the history
The new elevation system is not prone to the security issues of
the old system, as such we no longer need to have users opt-in
to this functionality anymore.
  • Loading branch information
milianw committed Jul 21, 2023
1 parent fa4ddd9 commit 11b4bdb
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 8 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

option(APPIMAGE_BUILD "configure build for bundling in an appimage" OFF)
option(ALLOW_PRIVILEGE_ESCALATION "allow temporary privilege escalation" OFF)

# Enable the test harness
enable_testing()
Expand Down
2 changes: 0 additions & 2 deletions hotspot-config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@
#cmakedefine01 KGraphViewerPart_FOUND

#cmakedefine01 KF5SyntaxHighlighting_FOUND

#cmakedefine01 ALLOW_PRIVILEGE_ESCALATION
2 changes: 1 addition & 1 deletion src/perfrecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ bool PerfRecord::canCompress()

bool PerfRecord::canElevatePrivileges()
{
return ALLOW_PRIVILEGE_ESCALATION && (!sudoUtil().isEmpty());
return !sudoUtil().isEmpty();
}

QString PerfRecord::perfBinaryPath()
Expand Down
4 changes: 0 additions & 4 deletions src/recordpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,7 @@ RecordPage::RecordPage(QWidget* parent)
} else if (!PerfRecord::canElevatePrivileges()) {
ui->elevatePrivilegesCheckBox->setChecked(false);
ui->elevatePrivilegesCheckBox->setEnabled(false);
#if ALLOW_PRIVILEGE_ESCALATION
ui->elevatePrivilegesCheckBox->setText(tr("(Note: this requires pkexec installed"));
#else
ui->elevatePrivilegesCheckBox->setText(tr("(Note: hotspot is not build with ALLOW_PRIVILEGE_ESCALATION=ON)"));
#endif
}

connect(ui->elevatePrivilegesCheckBox, &QCheckBox::toggled, this, &RecordPage::updateOffCpuCheckboxState);
Expand Down

0 comments on commit 11b4bdb

Please sign in to comment.