[MacPorts] #69585: Special regex characters are not escaped in path depspecs

MacPorts noreply at macports.org
Mon Jun 10 15:07:21 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  |
-------------------------------------------------+-------------------------
Changes (by ryandesign):

 * cc: larryv (added)


Comment:

 Replying to [comment:21 ryandesign]:
 > I would guess that this was not intentional and it was simply not
 considered that a filename that we might want to test would contain the
 `+` character. The problem would also occur for any filenames we might
 test that contain other special regex characters—like `*`, `^`, `$`, `[`,
 `]`, `{`, `}`, `(`, `)`—but I don't think we've encountered those.

 It looks like one person previously discovered this feature and
 [changeset:6b23f7c999a584168a115a028a38b77a68b6cbb2/macports-ports made
 use of it] in the HandBrake and HandBrakeCLI ports by depending on
 `{bin:python2(\.(4|5|6|7))?:python27}`. Since allowing the build to use
 whatever python it finds is not particularly [wiki:ReproducibleBuilds
 reproducible] I would be ok with breaking this and requiring the HandBrake
 ports to change (for example to always depend on `port:python27` and force
 the build system to use that python).

-- 
Ticket URL: <https://trac.macports.org/ticket/69585#comment:25>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list