Only encrypt to keys with encrypt capability
This commit is contained in:
parent
aa4b80db7f
commit
543ca86029
1 changed files with 8 additions and 4 deletions
|
@ -257,10 +257,14 @@ safe_git_rev_parse()
|
||||||
|
|
||||||
check_recipients()
|
check_recipients()
|
||||||
{
|
{
|
||||||
Recipients="$(gpg --no-default-keyring --keyring "$Conf_keyring" \
|
# Find which keys in the keyring we can encrypt to
|
||||||
--with-colons -k | xgrep ^pub | cut -f 5 -d ':' | tr '\n' ' ')"
|
Recipients=$(gpg --no-default-keyring --keyring "$Conf_keyring" \
|
||||||
# Split recipients by space, example "a b c" => -R a -R b -R c
|
--with-colons --fast-list -k | xgrep ^pub | \
|
||||||
Recipients=$(xecho_n "$Recipients" | sed -e 's/\([^ ]\+\)/-R &/g')
|
while read rc_line; do
|
||||||
|
cap_=$(xecho "$rc_line" | cut -f 12 -d :)
|
||||||
|
keyid_=$(xecho "$rc_line" | cut -f 5 -d :)
|
||||||
|
iseq "${cap_#*E}" "$cap_" || xecho_n "-R $keyid_ "
|
||||||
|
done)
|
||||||
if isnull "$Recipients"
|
if isnull "$Recipients"
|
||||||
then
|
then
|
||||||
echo_info "You must configure a keyring for the repository."
|
echo_info "You must configure a keyring for the repository."
|
||||||
|
|
Loading…
Reference in a new issue