1 Subprocesses launched by firefox via modules/subprocess have an empty
2 environment due to incorrect assumptions about environ variable in the libc.
4 On Solaris, environ variable is not part of libc.so (weak binding
5 only) and hence loading it from libc yields only a null pointer. This
6 workaround gets environ variable directly from the firefox process.
8 Patch not suitable for upstream; the idea might be.
11 2023-12-19 Rocketman: Revised upstream patch to fix variable scoping
13 --- firefox-115.5.0/toolkit/modules/subprocess/subprocess_shared_unix.js.orig 2023-12-17 18:18:29.773082257 +0000
14 +++ firefox-115.5.0/toolkit/modules/subprocess/subprocess_shared_unix.js 2023-12-19 12:52:30.798318503 +0000
19 -var libc = new Library("libc", LIBC_CHOICES, {
20 +var libenv = new Library("libenv", ["a.out"], {
21 environ: [ctypes.char.ptr.ptr],
24 +var libc = new Library("libc", LIBC_CHOICES, {
26 _NSGetEnviron: [ctypes.default_abi, ctypes.char.ptr.ptr.ptr],
32 +libc.environ = libenv.environ;
34 unix.Fd = function (fd) {
35 return ctypes.CDataFinalizer(ctypes.int(fd), libc.close);