pass- posix password manager |
git clone git://git.acid.vegas/pass.git |
Log | Files | Refs | Archive | README | LICENSE |
commit 6a932074b57bbaa022d81d77e72905ed1949d692
parent 5426e53dafb0ec4a4af33c880d4dd6e7fa024243 Author: acidvegas <acid.vegas@acid.vegas> Date: Tue, 13 Jun 2023 19:12:24 -0400 Added insecure fallback to /tmp when /dev/shm does not exist Diffstat:
|
1 file changed, 8 insertions(+), 4 deletions(-) |
diff --git a/pass b/pass @@ -17,13 +17,17 @@ fi mkdir -p $PASS_DIR edit() { + local template="pw.XXXXXXXXXXXXX" if [ -d /dev/shm ] && [ -w /dev/shm ] && [ -x /dev/shm ]; then - tmp=$(mktemp -u /dev/shm/pw.XXXXXXXXXX) - trap "rm -rf $tmp" EXIT + tmp=$(mktemp -d /dev/shm/$template) else - echo "error: /dev/shm does not exist or is missing permissions required for temporary files" - exit 1 + 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) fi + rm_tmp() { + rm -rf "$tmp" + } + trap rm_tmp EXIT if [ -f $PASS_DIR/$1.gpg ]; then gpg -d -o $tmp $GPG_OPTS $PASS_DIR/$1.gpg || exit 1 $EDITOR $tmp |