summaryrefslogtreecommitdiffstats
path: root/klaptopdaemon/acpi.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-05-25 12:56:52 +0200
committerSlávek Banko <slavek.banko@axis.cz>2020-05-25 12:56:52 +0200
commitbf71f730b3e204d4404fbd47562946170bf87de0 (patch)
treebf1b2252d54eb8c1e887e52c1fb17faa16754d1b /klaptopdaemon/acpi.cpp
parentc20f6cb658e757b8174be8fb537036bfc3c7c7a8 (diff)
downloadtdeutils-bf71f730b3e204d4404fbd47562946170bf87de0.tar.gz
tdeutils-bf71f730b3e204d4404fbd47562946170bf87de0.zip
klaptopdaemon: Fix acpi helper violation check.
1. Dependence on crcresult.h solved correctly. 2. Used macro tde_add_executable to define makecrc target. 3. Fixed command to run makecrc - it depends on both makecrc and klaptop_acpi_helper, - it must be run in build binary directory, not source, - the target name is used as the makecrc command, so there is no need to use get_target_property( ... LOCATION ), which caused a warning due to CMP0026. 4. The block of code that performs the binary violation verification was rolled back because it was removed in commit 2abe1e6f40 for an unknown reason, and the check was not actually performed. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'klaptopdaemon/acpi.cpp')
-rw-r--r--klaptopdaemon/acpi.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/klaptopdaemon/acpi.cpp b/klaptopdaemon/acpi.cpp
index 27125dd..8bce86b 100644
--- a/klaptopdaemon/acpi.cpp
+++ b/klaptopdaemon/acpi.cpp
@@ -165,6 +165,17 @@ void AcpiConfig::setupHelper()
unsigned long len, crc;
TQString helper = TDEStandardDirs::findExe("klaptop_acpi_helper");
checkcrc(TQFile::encodeName(helper), len, crc);
+ if (len != file_len || crc != file_crc)
+ {
+ TQString str(i18n("The %1 application does not seem to have "
+ "the same size or checksum as when it was compiled we do NOT recommend "
+ "you proceed with making it setuid-root without further investigation").arg(helper));
+ int rc = KMessageBox::warningContinueCancel(0, str, i18n("KLaptopDaemon"), i18n("Run Nevertheless"));
+ if (rc != KMessageBox::Continue)
+ {
+ return;
+ }
+ }
TQString tdesu = TDEStandardDirs::findExe("tdesu");
if (!tdesu.isEmpty()) {