From 7dda5455d8f2fed1777f09c082e1308ee4faea73 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 4 Aug 2024 10:58:18 -0700 Subject: [PATCH] mumble: Mark secret strings in privileged actions Tests: - Run affected privileged actions through UI and notice that secret strings are not logged. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/mumble/privileged.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plinth/modules/mumble/privileged.py b/plinth/modules/mumble/privileged.py index 9385a0f8c..6e155eedf 100644 --- a/plinth/modules/mumble/privileged.py +++ b/plinth/modules/mumble/privileged.py @@ -9,7 +9,7 @@ import subprocess import augeas from plinth import action_utils -from plinth.actions import privileged +from plinth.actions import privileged, secret_str CONFIG_FILE = '/etc/mumble-server.ini' DATA_DIR = '/var/lib/mumble-server' @@ -25,7 +25,7 @@ def setup(): @privileged -def set_super_user_password(password: str): +def set_super_user_password(password: secret_str): """Set the superuser password with murmurd command.""" subprocess.run(['murmurd', '-readsupw'], input=password.encode(), stdout=subprocess.DEVNULL, check=False) @@ -50,7 +50,7 @@ def set_domain(domain_name: str | None): @privileged -def change_join_password(join_password: str): +def change_join_password(join_password: secret_str): """Change to password that is required to join the server""" aug = _load_augeas() aug.set('.anon/serverpassword', join_password)