Le Thu, Mar 28, 2024 at 02:52:52PM +0000, Lennart Jablonka a écrit : > I’m trying to get himitsu-firefox¹ working on OpenBSD. It’s a Firefox > extension that talks to a daemon² using “native messaging”: The extension > calls runtime.connectNative(); the browser spawns a himitsu-firefox-native > process, and extension and native process exchange JSON messages. > > The native process wants to talk to the daemon using the daemon’s socket in > $XDG_RUNTIME_DIR/himitsu. Problem is, the himitsu-firefox-native process’s > environment is empty—it doesn’t get no XDG_RUNTIME_DIR variable, or any > other one. > > How come? Is that documented somewhere? Can I change that somehow?
you can look with ktrace -i to figure out the env passed to the subprocess when it's spawned (look for the execv call) i've never played with those native messaging extensions, so those ideas are just random clues to put you on a path: - check if the same happens with unveil/pledge disabled to rule out a side effect of sandboxing (i dunno if the 'native process' spawned by the main process inherits sandboxing from parent, dont think so) - are you sure the himitsu-firefox-native process is spawned at all ? - compare what happens with a 'known working' other native messaging thing. i've personally tested none, but i think ppl use keepassxc-proxy with some browsers. Given the README in https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/security/keepassxc/pkg/README?rev=1.6&content-type=text/x-cvsweb-markup you might want to locally have to do similar things. Landry