summaryrefslogtreecommitdiff
path: root/src/password-store.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/password-store.sh14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index ce1646f..b67ebc7 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -86,12 +86,7 @@ agent_check() {
}
reencrypt_path() {
local passfile passfile_dir passfile_display passfile_temp prev_gpg_recipients gpg_keys current_keys config
- local -A groups
- while read -r config; do
- [[ $config =~ cfg:group:* ]] || continue
- groups[$(cut -d : -f 3 <<<"$config")]="$(cut -d : -f 4 <<<"$config")"
- done < <($GPG --list-config --with-colons)
-
+ local groups="$($GPG --list-config --with-colons | grep ^cfg:group:.*)"
while read -r -d "" passfile; do
passfile_dir="${passfile%/*}"
passfile_dir="${passfile_dir#$PREFIX}"
@@ -103,10 +98,11 @@ reencrypt_path() {
set_gpg_recipients "$passfile_dir"
if [[ $prev_gpg_recipients != "${GPG_RECIPIENTS[@]}" ]]; then
for config in "${!GPG_RECIPIENTS[@]}"; do
- [[ ${groups[${GPG_RECIPIENTS[$config]}]} ]] || continue
+ local group="$(sed -n "s/^cfg:group:${GPG_RECIPIENTS[$config]}:\\(.*\\)$/\\1/p" <<<"$groups" | head -n 1)"
+ [[ -z $group ]] && continue
local saved_ifs="$IFS"
IFS=";"
- GPG_RECIPIENTS+=( ${groups[${GPG_RECIPIENTS[$config]}]} )
+ GPG_RECIPIENTS+=( $group )
IFS="$saved_ifs"
unset GPG_RECIPIENTS[$config]
done
@@ -120,7 +116,7 @@ reencrypt_path() {
mv "$passfile_temp" "$passfile" || rm -f "$passfile_temp"
fi
prev_gpg_recipients="${GPG_RECIPIENTS[@]}"
- done < <(find "$PREFIX" -iname '*.gpg' -print0)
+ done < <(find "$1" -iname '*.gpg' -print0)
}
check_sneaky_paths() {
for path in "$@"; do
ommit/portato/gui/gtk/windows.py?h=v0.14.1&id=60e51e08dde38b982dc84923e3678555aeef21ba&follow=1'> r603@Devoty: necoro | 2008-01-14 11:30:26 +0100Necoro4-26/+38 2008-01-11 r598@Devoty: necoro | 2008-01-10 16:36:29 +0100Necoro4-10/+50 2008-01-11 r597@Devoty: necoro | 2008-01-10 14:12:35 +0100Necoro1-3/+3 2008-01-10 r595@Devoty: necoro | 2008-01-10 04:04:15 +0100Necoro1-52/+3 2008-01-09 r586@Devoty: necoro | 2008-01-09 14:54:18 +0100Necoro1-1/+1 2007-12-06 r577@Devoty: necoro | 2007-12-06 20:37:36 +0100Necoro1-1/+1 2007-12-06 r572@Devoty: necoro | 2007-11-28 08:48:15 +0100Necoro1-0/+1 2007-11-27 r570@Devoty: necoro | 2007-11-27 02:08:21 +0100Necoro3-84/+108