From 65e623a629c3a75e5b62ba48b67744e5f1beef54 Mon Sep 17 00:00:00 2001 From: Michal Koutný Date: Tue, 7 May 2024 11:46:48 +0200 Subject: Make debugging output opt-in Despite the file is user-only readable, generate the output only when debugging the tool (DEBUG=1 in environment) to prevent forgotten PIN inside log files to be leaked. Also slight attempt to support multi-user systems (not tested). --- pinentry-rofi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pinentry-rofi.sh b/pinentry-rofi.sh index e09c60e..f7b3ba2 100755 --- a/pinentry-rofi.sh +++ b/pinentry-rofi.sh @@ -38,7 +38,7 @@ set -eu VERSION="0.0.1" log_debug() { - echo "$@" >> /tmp/pinentry-log.txt + [ -z "${DEBUG:-}" ] || echo "$@" >> /tmp/pinentry-log-$USER.txt } assuan_send() { -- cgit