From c0df57a3543e79cb9b5effe62054d5415f70e837 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 15 Apr 2014 15:59:55 +0200 Subject: All globals are upper-case. Signed-off-by: Jason A. Donenfeld --- src/platform/darwin.sh | 12 ++++++------ src/platform/freebsd.sh | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/platform') diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh index 8f39ee9..1b76c33 100644 --- a/src/platform/darwin.sh +++ b/src/platform/darwin.sh @@ -17,18 +17,18 @@ clip() { tmpdir() { cleanup_tmp() { - [[ -d $tmp_dir ]] || return - rm -rf "$tmp_file" "$tmp_dir" 2>/dev/null - umount "$tmp_dir" + [[ -d $SECURE_TMPDIR ]] || return + rm -rf "$tmp_file" "$SECURE_TMPDIR" 2>/dev/null + umount "$SECURE_TMPDIR" diskutil quiet eject "$ramdisk_dev" - rmdir "$tmp_dir" + rmdir "$SECURE_TMPDIR" } trap cleanup_tmp INT TERM EXIT - tmp_dir="$(mktemp -t "$template" -d)" + SECURE_TMPDIR="$(mktemp -t "$template" -d)" local ramdisk_dev="$(hdid -drivekey system-image=yes -nomount 'ram://32768' | cut -d ' ' -f 1)" # 32768 sectors = 16 mb [[ -z $ramdisk_dev ]] && exit 1 newfs_hfs -M 700 "$ramdisk_dev" &>/dev/null || exit 1 - mount -t hfs -o noatime -o nobrowse "$ramdisk_dev" "$tmp_dir" || exit 1 + mount -t hfs -o noatime -o nobrowse "$ramdisk_dev" "$SECURE_TMPDIR" || exit 1 } GETOPT="$(brew --prefix gnu-getopt 2>/dev/null || echo /usr/local)/bin/getopt" diff --git a/src/platform/freebsd.sh b/src/platform/freebsd.sh index 199742a..d2b8163 100644 --- a/src/platform/freebsd.sh +++ b/src/platform/freebsd.sh @@ -4,14 +4,14 @@ tmpdir() { local ramdisk="/var/tmp/password-store.ramdisk" if [[ -d $ramdisk && -d $ramdisk && -d $ramdisk ]]; then - tmp_dir="$(TMPDIR=$ramdisk mktemp -t "$template" -d)" + SECURE_TMPDIR="$(TMPDIR=$ramdisk mktemp -t "$template" -d)" else yesno "$(echo "A ramdisk does not exist at $ramdisk, which means that it may" echo "be difficult to entirely erase the temporary non-encrypted" echo "password file after editing. Are you sure you would like to" echo -n "continue?")" - tmp_dir="$(mktemp -t "$template" -d)" + SECURE_TMPDIR="$(mktemp -t "$template" -d)" fi } -- cgit v1.2.3