aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoviuro <moviuro+git@gmail.com>2017-03-12 11:57:30 +0100
committerMoviuro <moviuro+git@gmail.com>2017-03-12 11:57:30 +0100
commit19afc1e269ab1e357947b1486da8f47cd9f6487d (patch)
tree26766ed72a4952fb2c27f31e74d7d41b5f7190af
parentfab0475fba86bc4421bff82c1897e94da2fd02a8 (diff)
downloadrofi-pass-19afc1e269ab1e357947b1486da8f47cd9f6487d.tar.gz
rofi-pass: use umask instead of chmod.
Also avoids race conditions as a happy side effect
-rwxr-xr-xrofi-pass4
1 files 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 -