[autobackport: sssd-2-10] Use macro rather than shell expansion for string processing in spec file#8521
Conversation
There was a problem hiding this comment.
Code Review
This pull request is an automatic backport that aims to replace a shell expansion with a macro in the spec file for security reasons. However, the backport resulted in a merge conflict in contrib/sssd.spec.in which has been left unresolved. This makes the spec file invalid and must be fixed. My review provides a suggestion to resolve the conflict and correct the macro syntax.
contrib/sssd.spec.in
Outdated
| <<<<<<< HEAD | ||
| Version: %{downstream_version} | ||
| ======= | ||
| Version: %{gsub @PACKAGE_VERSION@ - ~} | ||
| >>>>>>> f9697d4ff (Use macro rather than shell expansion for string processing in spec file) |
There was a problem hiding this comment.
This file contains unresolved merge conflict markers, which will cause the build to fail. The conflict needs to be resolved.
Based on the original pull request, the intention is to replace the shell expansion with an RPM macro. The correct resolution is to use the gsub macro. Additionally, the syntax for gsub in the conflicting change appears incorrect. The correct format is %{gsub:text:pattern:replacement}.
Please resolve the conflict using the suggested code.
Version: %{gsub:@PACKAGE_VERSION@:-:~}
cb2f38a to
0997efe
Compare
Based on commit f9697d4. But %gsub macro is not present in older (el9) version therefore we use %{lua:} to do the same thing. Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Nikola Forró <nforro@redhat.com> Reviewed-by: Tomáš Halman <thalman@redhat.com> (cherry picked from commit caa0ec2) Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
|
The pull request was accepted by @ikerexxe with the following PR CI status: 🟢 CodeQL (success) There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging. |
0997efe to
bd2bff9
Compare
This is an automatic backport of PR#8511 Use macro rather than shell expansion for string processing in spec file to branch sssd-2-10, created by @nforro.
Caution
@nforro The patches did not apply cleanly. It is necessary to resolve conflicts before merging this pull request. Commits that introduced conflict are marked with
CONFLICT!.You can push changes to this pull request
Original commits
f9697d4 - Use macro rather than shell expansion for string processing in spec file
caa0ec2 - Add a default for %samba_package_version
Backported commits
Conflicting Files Information (check for deleted and re-added files)
Original Pull Request Body
We've hardened security in Packit Service and shell expansions in spec files are now rejected as they can be used to execute arbitrary code. There is no need to use shell expansion for string processing, there is an existing macro for this very purpose.