From 79d5267d5911d753ab6ba3cb4c12c919312a85fc Mon Sep 17 00:00:00 2001 From: Brian Shore Date: Thu, 12 Sep 2013 14:38:35 -0700 Subject: Fix directory traversal for reencryption when $PREFIX is a symlink --- src/password-store.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3