iigs
2024-03-27 32d98a3796b058e946d5d41ed5637129c312a8e9
commit | author | age
96e62b 1 Subprocesses launched by firefox via modules/subprocess have an empty
I 2 environment due to incorrect assumptions about environ variable in the libc.
3
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.
7
8 Patch not suitable for upstream; the idea might be.
9
10
11 2023-12-19 Rocketman: Revised upstream patch to fix variable scoping
12
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
15 @@ -43,9 +43,11 @@
16    },
17  };
18  
19 -var libc = new Library("libc", LIBC_CHOICES, {
20 +var libenv = new Library("libenv", ["a.out"], {
21    environ: [ctypes.char.ptr.ptr],
22 +})
23  
24 +var libc = new Library("libc", LIBC_CHOICES, {
25    // Darwin-only.
26    _NSGetEnviron: [ctypes.default_abi, ctypes.char.ptr.ptr.ptr],
27  
28 @@ -118,6 +120,8 @@
29    ],
30  });
31  
32 +libc.environ = libenv.environ;
33 +
34  unix.Fd = function (fd) {
35    return ctypes.CDataFinalizer(ctypes.int(fd), libc.close);
36  };