Skip to content

Commit

Permalink
Sanitize %__foo_sign_cmd macros
Browse files Browse the repository at this point in the history
These have been in this bizarre double-command format for passing
to execve(), but there's really no point. Just make it a regular
command and pass the same argument as the pathname and argv[0].
No functional changes.
  • Loading branch information
pmatilai committed Nov 28, 2024
1 parent 03448bc commit 6838482
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions macros.in
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ Supplements: (%{name} = %{version}-%{release} and langpacks-%{1})\
#
%__gpg @__GPG@
%__gpg_sign_cmd %{shescape:%{__gpg}} \
gpg --no-verbose --no-armor --no-secmem-warning \
--no-verbose --no-armor --no-secmem-warning \
%{?_gpg_digest_algo:--digest-algo=%{_gpg_digest_algo}} \
%{?_gpg_sign_cmd_extra_args} \
%{?_openpgp_sign_id:-u %{shescape:%{_openpgp_sign_id}}} \
Expand All @@ -628,7 +628,7 @@ Supplements: (%{name} = %{version}-%{release} and langpacks-%{1})\

%__sq @__SQ@
%__sq_sign_cmd %{shescape:%{__sq}} \
%{__sq} sign \
sign \
%{?_openpgp_sign_id:--signer-key %{_openpgp_sign_id}} \
%{?_sq_sign_cmd_extra_args} \
--detached --output %{shescape:%{?__signature_filename}} \
Expand Down
2 changes: 1 addition & 1 deletion sign/rpmgensig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static int runGPG(sigTarget sigt, const char *sigfile)
dup2(pipefd[0], STDIN_FILENO);
close(pipefd[1]);

rc = execve(argv[0], argv+1, environ);
rc = execve(argv[0], argv, environ);

rpmlog(RPMLOG_ERR, _("Could not exec %s: %s\n"), argv[0],
strerror(errno));
Expand Down

0 comments on commit 6838482

Please sign in to comment.