m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Shore <brian@networkredux.com>2013-09-12 14:38:35 -0700
committerJason A. Donenfeld <Jason@zx2c4.com>2013-09-14 19:15:16 +0200
commit79d5267d5911d753ab6ba3cb4c12c919312a85fc (patch)
tree863e112a5c2125b2a83997beecd62a43a42a01b9
parentc832d4647439a0d504a310fba51f20dcb5051c47 (diff)
Fix directory traversal for reencryption when $PREFIX is a symlink
-rwxr-xr-xsrc/password-store.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index e080627..2d6ba18 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -158,7 +158,7 @@ case "$command" in
git_add_file "$ID" "Set GPG id to $gpg_id."
if [[ $reencrypt -eq 1 ]]; then
- find "$PREFIX" -iname '*.gpg' | while read passfile; do
+ find "$PREFIX/" -iname '*.gpg' | while read passfile; do
gpg2 -d $GPG_OPTS "$passfile" | gpg2 -e -r "$gpg_id" -o "$passfile.new" $GPG_OPTS &&
mv -v "$passfile.new" "$passfile"
done