Skip to content

Commit

Permalink
Properly escape %__gpg_sign_cmd
Browse files Browse the repository at this point in the history
%__gpg_sign_cmd needs to be able to cope with strange characters in e.g.
%_gpg_name.  Use the builtin shescape macro to make this
straightforward.
  • Loading branch information
DemiMarie authored and pmatilai committed Apr 13, 2022
1 parent 8098776 commit 714422a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions macros.in
Original file line number Diff line number Diff line change
Expand Up @@ -586,15 +586,16 @@ package or when debugging this package.\
#==============================================================================
# ---- GPG/PGP/PGP5 signature macros.
# Macro(s) to hold the arguments passed to GPG/PGP for package
# signing and verification.
#

%__gpg_sign_cmd %{__gpg} \
gpg --no-verbose --no-armor \
%{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} \
--no-secmem-warning \
%{?_gpg_sign_cmd_extra_args:%{_gpg_sign_cmd_extra_args}} \
-u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
# signing. Expansion result is parsed by popt, so be sure to use
# %{shescape} where needed.
#
%__gpg_sign_cmd %{shescape:%{__gpg}} \
gpg --no-verbose --no-armor --no-secmem-warning \
%{?_gpg_digest_algo:--digest-algo=%{_gpg_digest_algo}} \
%{?_gpg_sign_cmd_extra_args} \
%{?_gpg_name:-u %{shescape:%{_gpg_name}}} \
-sbo %{shescape:%{?__signature_filename}} \
%{?__plaintext_filename:-- %{shescape:%{__plaintext_filename}}}

#==============================================================================
# ---- Transaction macros.
Expand Down

0 comments on commit 714422a

Please sign in to comment.