From 19afc1e269ab1e357947b1486da8f47cd9f6487d Mon Sep 17 00:00:00 2001 From: Moviuro Date: Sun, 12 Mar 2017 11:57:30 +0100 Subject: rofi-pass: use umask instead of chmod. Also avoids race conditions as a happy side effect --- rofi-pass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rofi-pass b/rofi-pass index 1adf828..fcd9282 100755 --- a/rofi-pass +++ b/rofi-pass @@ -43,6 +43,8 @@ help="Alt+h" switch="Alt+x" insert_pass="Alt+n" +# Safe permissions +umask 077 # get all password files and create an array list_passwords() { @@ -69,14 +71,12 @@ doClip () { checkIfPass () { rm -f "$HOME/.cache/rofi-pass/last_used" echo "${root}: $selected_password" > "$HOME/.cache/rofi-pass/last_used" - chmod 600 "$HOME/.cache/rofi-pass/last_used" } autopass () { rm -f "$HOME/.cache/rofi-pass/last_used" echo "${root}: $selected_password" > "$HOME/.cache/rofi-pass/last_used" - chmod 600 "$HOME/.cache/rofi-pass/last_used" if [[ -z "${stuff["$AUTOTYPE_field"]}" ]]; then if [[ "${stuff["${USERNAME_field}"]}" ]]; then echo -n "${stuff["${USERNAME_field}"]}" | xdotool type --clearmodifiers --file - -- cgit