Skip to content

Commit

Permalink
mktemp with -d causes errors on other distros, just making a temp fil…
Browse files Browse the repository at this point in the history
…e instead of directory instead (removing -d)
  • Loading branch information
acidvegas committed Aug 26, 2023
1 parent c28199a commit 78dfa80
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pass
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# posix password manager - developed by acidvegas (https://git.acid.vegas/pass)

umask 077

export GPG_TTY=$(tty)

GPG_ID="acidvegas" # change me
Expand All @@ -19,10 +18,10 @@ mkdir -p $PASS_DIR
edit() {
local template="pw.XXXXXXXXXXXXX"
if [ -d /dev/shm ] && [ -w /dev/shm ] && [ -x /dev/shm ]; then
tmp=$(mktemp -d /dev/shm/$template)
tmp=$(mktemp /dev/shm/$template)
else
echo "warning: /dev/shm does not exist or is missing permissions required for temporary files (using insecure fallback to /tmp directory)"
tmp=$(mktemp -d /tmp/$template)
tmp=$(mktemp /tmp/$template)
fi
rm_tmp() {
rm -rf "$tmp"
Expand Down

0 comments on commit 78dfa80

Please sign in to comment.