From 40e08796d1e24de93eab01db298b0f1a6be5380c Mon Sep 17 00:00:00 2001 From: Alexander Shaduri Date: Sun, 27 Aug 2017 19:07:52 +0000 Subject: [PATCH] Use pkexec --disable-internal-agent for polkit. Don't warn on Unknown property "Form Factor". --- gsmartcontrol/TODO | 3 --- gsmartcontrol/data/gsmartcontrol-root.in | 2 +- gsmartcontrol/src/applib/smartctl_parser.cpp | 5 +++++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gsmartcontrol/TODO b/gsmartcontrol/TODO index bf085fb..3d2b12b 100644 --- a/gsmartcontrol/TODO +++ b/gsmartcontrol/TODO @@ -28,9 +28,6 @@ Bugs / patches: TODO: -Implement PolKit support. - - Don't rely on smartctl return code (2), parse the output instead. This will allow us to show the Info page. diff --git a/gsmartcontrol/data/gsmartcontrol-root.in b/gsmartcontrol/data/gsmartcontrol-root.in index 8b94755..310b6f7 100644 --- a/gsmartcontrol/data/gsmartcontrol-root.in +++ b/gsmartcontrol/data/gsmartcontrol-root.in @@ -138,7 +138,7 @@ if [ "$GSMARTCONTROL_SU" != "" ]; then full_cmd="$GSMARTCONTROL_SU '$EXEC_BIN $final_args_quoted'"; elif [ "$found_su" = "pkexec" ]; then - full_cmd="pkexec '$EXEC_BIN $final_args_quoted'"; + full_cmd="pkexec --disable-internal-agent '$EXEC_BIN $final_args_quoted'"; elif [ "$found_su" = "sux" ]; then full_cmd="xterm -e sux -c '$EXEC_BIN $final_args_quoted'"; diff --git a/gsmartcontrol/src/applib/smartctl_parser.cpp b/gsmartcontrol/src/applib/smartctl_parser.cpp index dc2f57f..46bf899 100644 --- a/gsmartcontrol/src/applib/smartctl_parser.cpp +++ b/gsmartcontrol/src/applib/smartctl_parser.cpp @@ -483,6 +483,11 @@ bool SmartctlParser::parse_section_info_property(StorageProperty& p) p.value_type = StorageProperty::value_type_string; p.value_string = p.reported_value; + } else if (app_pcre_match("/^Form Factor$/mi", p.reported_name)) { + p.set_name(p.reported_name, "form_factor", "Form Factor"); + p.value_type = StorageProperty::value_type_string; + p.value_string = p.reported_value; + } else if (app_pcre_match("/^Device is$/mi", p.reported_name)) { p.set_name(p.reported_name, "in_smartctl_db", "In Smartctl Database"); p.value_type = StorageProperty::value_type_bool;