diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2015-01-28 16:40:15 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2015-01-28 16:45:21 +0100 |
commit | 9c58e0da7c1cb8abc84aca094d3020aeb3c608b4 (patch) | |
tree | 8b03452de217d949231c889ad9d6c5fcc941081f | |
parent | cb4d6de58c0fa2ab9a1b798efd184fc269ecc239 (diff) |
Use more stable with-colons output
-rwxr-xr-x | src/password-store.sh | 2 | ||||
-rwxr-xr-x | tests/t0300-reencryption.sh | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/password-store.sh b/src/password-store.sh index f3aebc3..afdaf39 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -100,7 +100,7 @@ reencrypt_path() { IFS=";" eval 'GPG_RECIPIENTS+=( $group )' # http://unix.stackexchange.com/a/92190 unset GPG_RECIPIENTS[$index] done - gpg_keys="$($GPG --list-keys --keyid-format long "${GPG_RECIPIENTS[@]}" | sed -n 's/sub *.*\/\([A-F0-9]\{16\}\) .*/\1/p' | LC_ALL=C sort -u)" + gpg_keys="$($GPG --list-keys --with-colons "${GPG_RECIPIENTS[@]}" | sed -n 's/sub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u)" fi current_keys="$($GPG -v --no-secmem-warning --no-permission-warning --list-only --keyid-format long "$passfile" 2>&1 | cut -d ' ' -f 5 | LC_ALL=C sort -u)" diff --git a/tests/t0300-reencryption.sh b/tests/t0300-reencryption.sh index 96da41b..9d46580 100755 --- a/tests/t0300-reencryption.sh +++ b/tests/t0300-reencryption.sh @@ -7,10 +7,10 @@ cd "$(dirname "$0")" INITIAL_PASSWORD="will this password live? a big question indeed..." canonicalize_gpg_keys() { - $GPG --list-keys --keyid-format long "$@" | sed -n 's/sub *.*\/\([A-F0-9]\{16\}\) .*/\1/p' | sort -u + $GPG --list-keys --with-colons "$@" | sed -n 's/sub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u } gpg_keys_from_encrypted_file() { - $GPG -v --no-secmem-warning --no-permission-warning --list-only --keyid-format long "$1" 2>&1 | cut -d ' ' -f 5 | sort -u + $GPG -v --no-secmem-warning --no-permission-warning --list-only --keyid-format long "$1" 2>&1 | cut -d ' ' -f 5 | LC_ALL=C sort -u } gpg_keys_from_group() { local output="$($GPG --list-config --with-colons | sed -n "s/^cfg:group:$1:\\(.*\\)/\\1/p" | head -n 1)" |