From daca4d1d9c22c999f9a3ab66b7aa408c4109b041 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 17 Sep 2025 20:16:35 -0700 Subject: [PATCH] actions: Log method arguments in privileged daemon - This change means that when invalid module or action name is provided, the log message is not printed. However, this is acceptable as those cases are rare in production and are logged properly on the client side. Tests: - Run diagnostics for an app and notice that arguments are printed in privileged daemon's journald logs. - Remove a password from bepasty app and notice that the password argument is not logged. Signed-off-by: Sunil Mohan Adapa Reviewed-by: Veiko Aasa --- plinth/actions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plinth/actions.py b/plinth/actions.py index 45dbc228b..0634e3dd2 100644 --- a/plinth/actions.py +++ b/plinth/actions.py @@ -431,8 +431,6 @@ def privileged_handle_json_request( try: request = _parse_request() - logger.info('Received request for %s..%s(..)', request['module'], - request['action']) arguments = {'args': request['args'], 'kwargs': request['kwargs']} _setup_thread_storage() return_value = _privileged_call(request['module'], request['action'], @@ -495,6 +493,8 @@ def _privileged_call(module_name, action_name, arguments): _privileged_assert_valid_arguments(func, arguments) + _log_action(func, module_name, action_name, arguments['args'], + arguments['kwargs'], run_in_background=False) try: return_values = func(*arguments['args'], **arguments['kwargs']) if isinstance(return_values, io.BufferedReader):