summaryrefslogtreecommitdiff
path: root/src/platform
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-08-01 04:12:04 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-08-01 04:12:04 +0200
commit44f54f0b02b567d621764a50b0920c87c245e4c9 (patch)
tree70d7e478dc86e48a26f7a750bef651d7d04adf82 /src/platform
parent6a6222eef23d25bec90015e49bd69c42062434ee (diff)
downloadpass-44f54f0b02b567d621764a50b0920c87c245e4c9.tar.gz
pass-44f54f0b02b567d621764a50b0920c87c245e4c9.tar.bz2
pass-44f54f0b02b567d621764a50b0920c87c245e4c9.zip
show: do not store binary data in bash vars
Instead we're forced to base64 it, like we do with the clipboard.
Diffstat (limited to 'src/platform')
-rw-r--r--src/platform/cygwin.sh8
-rw-r--r--src/platform/darwin.sh9
-rw-r--r--src/platform/freebsd.sh1
-rw-r--r--src/platform/openbsd.sh1
4 files changed, 11 insertions, 8 deletions
diff --git a/src/platform/cygwin.sh b/src/platform/cygwin.sh
index 737e367..5a8d5ea 100644
--- a/src/platform/cygwin.sh
+++ b/src/platform/cygwin.sh
@@ -4,13 +4,13 @@
clip() {
local sleep_argv0="password store sleep on display $DISPLAY"
pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5
- local before="$(base64 < /dev/clipboard)"
+ local before="$($BASE64 < /dev/clipboard)"
echo -n "$1" > /dev/clipboard
(
( exec -a "$sleep_argv0" sleep "$CLIP_TIME" )
- local now="$(base64 < /dev/clipboard)"
- [[ $now != $(echo -n "$1" | base64) ]] && before="$now"
- echo "$before" | base64 -d > /dev/clipboard
+ local now="$($BASE64 < /dev/clipboard)"
+ [[ $now != $(echo -n "$1" | $BASE64) ]] && before="$now"
+ echo "$before" | $BASE64 -d > /dev/clipboard
) >/dev/null 2>&1 & disown
echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds."
}
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"
diff --git a/src/platform/freebsd.sh b/src/platform/freebsd.sh
index d93c774..390bca2 100644
--- a/src/platform/freebsd.sh
+++ b/src/platform/freebsd.sh
@@ -3,3 +3,4 @@
GETOPT="/usr/local/bin/getopt"
SHRED="rm -P -f"
+BASE64="openssl base64"
diff --git a/src/platform/openbsd.sh b/src/platform/openbsd.sh
index b66b32f..fc27f6a 100644
--- a/src/platform/openbsd.sh
+++ b/src/platform/openbsd.sh
@@ -38,3 +38,4 @@ tmpdir() {
GETOPT="gnugetopt"
SHRED="rm -P -f"
+BASE64="openssl base64"
'2007-05-11 12:13:15 +0200'>2007-05-11Update README with submodule build infoLars Hjemli1-13/+39 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-05-11Add submodule links in tree listingLars Hjemli6-12/+27 When a submodule occurs in a tree, generate a link to show the module/commit. The link is specified as a sprintf string in /etc/cgitrc, using parameters 'module-link' and 'repo.module-link'. This should probably be extended with repo.module-link.$path. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-05-11Add submodules.sh and use it during buildsLars Hjemli3-13/+222 This adds a shell script which can be be used to initialize, list and update submodules in a git repository. It reads the file .gitmodules to find a mapping between submodule path and repository url for the initial clone of all submodules. The script is used during cgit builds to enable automatic download and checkout of the git git repository. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-05-11Added git as a submoduleLars Hjemli2-1/+1 This commit adds the subdirectory 'git' as a submodule containing the git git repository, but doesn't add support for automatically cloning the submodule. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-05-09Add support for downloading single blobsLars Hjemli5-3/+47 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-05-08ui-view: show pathname if specified in querystringLars Hjemli3-5/+10 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-05-08Update to libgit 1.5.2-rc2Lars Hjemli9-837/+50 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-02-21Layout updateLars Hjemli9-32/+127 2007-02-08Make snapshot feature configurableLars Hjemli5-6/+22 Snapshots can now be enabled/disabled by default for all repositories in cgitrc with param "snapshots". Additionally, any repo can override the default setting with param "repo.snapshots". By default, no snapshotting is enabled. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-02-08Add support for snapshotsLars Hjemli8-8/+153 Make a link from the commit viewer to a snapshot of the corresponding tree. Currently only zip-format is supported. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-02-05cgit v0.2v0.2Lars Hjemli1-1/+1 Main changes since v0.1: -list tags in repo summary -allow search in log-view -read repository paths from cgitrc Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-02-05Add support for prefix and gitsrc arguments to 'make'Lars Hjemli2-15/+37 This should improve the installation a little, especially since the new options are mentioned in the README. Also, add a make-rule to build the git binaries if necessary + a dependency between cgit and libgit.a. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-02-04Update cgitrc templateLars Hjemli1-21/+32 Make the descriptions more helpfull. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-02-04Add support for lightweight tagsLars Hjemli2-19/+37 There is nothing bad about a tag that has no tag-object, but the old code didn't handle such tags correctly. Fix it. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-02-04Read repo-info from /etc/cgitrcLars Hjemli5-55/+120 This makes cgit read all repo-info from the configfile, instead of scanning for possible git-dirs below a common root path. This is primarily done to get better security (separate physical path from logical repo-name). In /etc/cgitrc each repo is registered with the following keys: repo.url repo.name repo.path repo.desc repo.owner Note: *Required keys are repo.url and repo.path, all others are optional *Each occurrence of repo.url starts a new repository registration *Default value for repo.name is taken from repo.url *The value of repo.url cannot contain characters with special meaning for urls (i.e. one of /?%&), while repo.name can contain anything. Example: repo.url=cgit-pub repo.name=cgit/public repo.path=/pub/git/cgit repo.desc=My public cgit repo repo.owner=Lars Hjemli repo.url=cgit-priv repo.name=cgit/private repo.path=/home/larsh/src/cgit/.git repo.desc=My private cgit repo repo.owner=Lars Hjemli Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-02-04Do not die if tag has no messageLars Hjemli1-2/+2 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-02-03Fix search for non-virtual urlsLars Hjemli1-0/+6 When cgit don't use virtual urls, the current repo and page url parameters must be included in the search form as hidden input fields. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-01-28Update README with install/config informationLars Hjemli1-24/+28 Signed-off-by: Lars Hjemli <hjemli@gmail.com>