m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/platform
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2014-04-15 15:59:55 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2014-04-15 15:59:55 +0200
commitc0df57a3543e79cb9b5effe62054d5415f70e837 (patch)
treef430a90fe3c19c35091330e134b356ea8a509c86 /src/platform
parent9814164829ce169fef152ee43d89ca48d0b8adb8 (diff)
All globals are upper-case.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/platform')
-rw-r--r--src/platform/darwin.sh12
-rw-r--r--src/platform/freebsd.sh4
2 files changed, 8 insertions, 8 deletions
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
}