Skip to content

Commit

Permalink
games-util/game-device-udev-rules: Apply patsub_replacement defences
Browse files Browse the repository at this point in the history
Per bug #881383, string replacing forms of parameter expansion must take care
to quote - or appropriately escape - any nested parameter expansions, assuming
that their values are intended to be taken literally (as is almost invariably
the case). This has long been the case, but the introduction of the new
patsub_replacement option in bash >=5.2 has brought the issue to the fore.

In the case of the games-util/game-device-udev-rules package, the improper
quoting is not yet causing any issues. Still, it is better to write the code
properly to begin with, especially considering the demonstrative value of
robust code.

Signed-off-by: Kerin Millar <[email protected]>
Bug: https://bugs.gentoo.org/881383
Signed-off-by: Sam James <[email protected]>
  • Loading branch information
Kerin Millar authored and thesamesam committed Dec 6, 2022
1 parent 23e57ee commit 980c4cf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ src_prepare() {
local SRC DEST EXTRA
for SRC in 60-steam-{input,vr}.rules; do
DEST=${SRC//steam/game}
EXTRA=${FILESDIR}/${DEST/./-${PV}.}
EXTRA=${FILESDIR}/${DEST/./-"${PV}".}

# Make changes in a copy.
cp -v "${SRC}" "${DEST}" || die
Expand Down

0 comments on commit 980c4cf

Please sign in to comment.