mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
runner.Execute was not filtering ~/.pmg/bin from the environment passed to child processes. This caused two bugs: 1. Sandboxed commands (bubblewrap) inherited the unfiltered PATH, so child processes resolved package manager binaries to the shim instead of the real binary, causing "file not found" errors. 2. Direct pmg invocations (pmg npm install) would spawn subprocess that find the shim in PATH, causing infinite recursion (shim → pmg → shim → pmg) until the system runs out of OS threads. The proxy flow already filtered the environment via setupEnvForProxy and FilterPMGFromEnv. This applies the same filtering to the non-proxy execute path.