[PATCH] polkitd: add logging for successfully loaded rules
Michael Trapp
michael.trapp at sap.com
Tue Aug 1 14:47:55 UTC 2023
Log each successful load operation of a rule file including the name
of the loaded file. Getting the list of active rule files from the
logs is an important information in a support case and should not need
additional tracing/debugging.
---
Built and tested on top of 4b7a5c3. The info is logged during polkitd
startup and with changes of rule files, also in case '--no-debug' is set.
It might be a good idea to add a log_level to the argument list of
polkit_backend_authority_log() but this would affect >60 callers and is
out of scope of this patch.
src/polkitbackend/polkitbackendduktapeauthority.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
index dc13971..64bbd47 100644
--- a/src/polkitbackend/polkitbackendduktapeauthority.c
+++ b/src/polkitbackend/polkitbackendduktapeauthority.c
@@ -148,6 +148,9 @@ load_scripts (PolkitBackendJsAuthority *authority)
if (!execute_script_with_runaway_killer(authority, filename))
continue;
+ polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
+ "Successfully loaded and evaluated script %s",
+ filename);
num_scripts++;
}
--
More information about the polkit-devel
mailing list