[MacPorts] #69585: Special regex characters are not escaped in path depspecs
MacPorts
noreply at macports.org
Fri Jun 14 12:01:31 UTC 2024
#69585: Special regex characters are not escaped in path depspecs
-------------------------------------------------+-------------------------
Reporter: barracuda156 | Owner: ryandesign
Type: defect | Status: accepted
Priority: Normal | Milestone: MacPorts
| Future
Component: base | Version: 2.9.3
Resolution: | Keywords: haspatch
Port: gtk2, gtk2-devel, gtk3, gtk3-devel |
-------------------------------------------------+-------------------------
Comment (by jmroot):
Replying to [comment:21 ryandesign]:
> MacPorts takes the middle part of the depspec
`path:lib/pkgconfig/gtk+-3.0.pc:gtk3`—`lib/pkgconfig/gtk+-3.0.pc`—and
turns the last path component—`gtk+-3.0.pc`—into a regular expression.
Specifically, it anchors it at the beginning (`^`) and end (`$`) but other
than that it is copied directly into the regular expression without
escaping (even though the MacPorts Guide says it's just a file path).
Note that the code has talked about "depspec regexes" for a very long
time, see e.g. r2163. But I agree it's probably better to treat them as
simple filenames.
--
Ticket URL: <https://trac.macports.org/ticket/69585#comment:26>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list