Skip to content

Commit

Permalink
rofi-pass: use umask instead of chmod.
Browse files Browse the repository at this point in the history
Also avoids race conditions as a happy side effect
  • Loading branch information
moviuro committed Mar 12, 2017
1 parent fab0475 commit 19afc1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rofi-pass
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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 -
Expand Down

0 comments on commit 19afc1e

Please sign in to comment.