From 18f3540e2f89bf2631f147a19092efee0030ed9f Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 2 Jul 2019 15:55:31 +0200 Subject: [PATCH] Also redact psql password if it exists --- src/yunohost/log.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/yunohost/log.py b/src/yunohost/log.py index c228c2853..decb546f4 100644 --- a/src/yunohost/log.py +++ b/src/yunohost/log.py @@ -338,7 +338,10 @@ class OperationLogger(object): self.logger = None self._name = None self.data_to_redact = [] - self.data_to_redact.append(open("/etc/yunohost/mysql", "r").read().strip()) + + for filename in ["/etc/yunohost/mysql", "/etc/yunohost/psql"]: + if os.path.exists(filename): + self.data_to_redact.append(read_file(filename).strip()) self.path = OPERATIONS_PATH