From 44f54f0b02b567d621764a50b0920c87c245e4c9 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 1 Aug 2018 04:12:04 +0200 Subject: show: do not store binary data in bash vars Instead we're forced to base64 it, like we do with the clipboard. --- src/platform/darwin.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/platform/darwin.sh') diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh index a4f3515..342ecce 100644 --- a/src/platform/darwin.sh +++ b/src/platform/darwin.sh @@ -4,13 +4,13 @@ clip() { local sleep_argv0="password store sleep for user $(id -u)" pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 - local before="$(pbpaste | openssl base64)" + local before="$(pbpaste | $BASE64)" echo -n "$1" | pbcopy ( ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) - local now="$(pbpaste | openssl base64)" - [[ $now != $(echo -n "$1" | openssl base64) ]] && before="$now" - echo "$before" | openssl base64 -d | pbcopy + local now="$(pbpaste | $BASE64)" + [[ $now != $(echo -n "$1" | $BASE64) ]] && before="$now" + echo "$before" | $BASE64 -d | pbcopy ) >/dev/null 2>&1 & disown echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds." } @@ -45,3 +45,4 @@ qrcode() { GETOPT="$(brew --prefix gnu-getopt 2>/dev/null || { which port &>/dev/null && echo /opt/local; } || echo /usr/local)/bin/getopt" SHRED="srm -f -z" +BASE64="openssl base64" -- cgit v1.2.3-70-g09d2