[MacPorts] #64061: perl: posix_spawn: ${prefix}/var/macports/sip-workaround/502/usr/bin/perl5.xx: No such file or directory

MacPorts noreply at macports.org
Tue Nov 30 15:35:40 UTC 2021


#64061: perl: posix_spawn: ${prefix}/var/macports/sip-
workaround/502/usr/bin/perl5.xx: No such file or directory
---------------------------+-----------------------
  Reporter:  chrstphrchvz  |      Owner:  (none)
      Type:  defect        |     Status:  new
  Priority:  Normal        |  Milestone:
 Component:  base          |    Version:  2.7.1
Resolution:                |   Keywords:  tracemode
      Port:                |
---------------------------+-----------------------

Comment (by neverpanic):

 This is weird. I'm guessing what's happening here is this:

 - We're copying /usr/bin/perl unmodified, only stripping the SIP flag
 - The binary retains Apple's signature, so our `DYLD_INSERT_LIBRARIES`
 environment variable that is set when executing the copy is ignored
 - The unmodified binary runs, which means the `posix_spawn(2)` invocation
 in that binary isn't traced by trace mode and the `perl5.xx` binary is
 thus not copied.

 However, this also means that code that runs in this perl interpreter
 doesn't run under trace mode, either, and any binaries spawned from there
 would also not run under trace mode.
 I guess the proper solution for this would be to strip Apple's signature
 when copying the binary? On the other hand, that could cause problems for
 binaries in /usr/bin that only properly run with Apple's signature, e.g.,
 because they use entitlements.

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


More information about the macports-tickets mailing list