Issue 1: UNIX Domain Socket SOCK_SEQPACKET is unsupported on macOS hosts
Problem Description
On macOS hosts, socket() or socketpair() calls utilizing AF_UNIX and SOCK_SEQPACKET fail with EPROTONOSUPPORT (Protocol not supported, errno 93). When guest applications (such as gdk-pixbuf or dynamic sandbox helpers like bwrap/bubblewrap) request a SOCK_SEQPACKET unix socket pair, they crash on startup.
Proposed Fix
To support running such applications on macOS hosts, elfuse should intercept AF_UNIX sockets/socketpairs of type SOCK_SEQPACKET and fall back to SOCK_STREAM, which is fully supported on macOS and provides equivalent stream/reliability semantics for most local IPC.
Location: src/syscall/net.c in sys_socket and sys_socketpair.
Issue 2: Standalone CLI loader cannot boot shebang (#!) script targets directly
Problem Description
When executing a script (like a Python, Bash, or Perl program with a shebang header) directly as the initial target for elfuse, the loader fails with a "not an ELF file" error. While the guest runtime handles shebang execution successfully inside execve, the initial host-side bootstrap in main.c does not parse shebang headers and requires an ELF binary.
Proposed Fix
Implement a shebang parsing loop in the initial startup routine in main.c. If the guest target is not an ELF file:
- Parse the shebang interpreter path and any optional arguments.
- Update the guest target binary path to point to the interpreter.
- Prepend the interpreter and arguments to
guest_argv.
- Recursively resolve the interpreter path.
Location: src/main.c.
Issue 1: UNIX Domain Socket
SOCK_SEQPACKETis unsupported on macOS hostsProblem Description
On macOS hosts,
socket()orsocketpair()calls utilizingAF_UNIXandSOCK_SEQPACKETfail withEPROTONOSUPPORT(Protocol not supported, errno 93). When guest applications (such asgdk-pixbufor dynamic sandbox helpers likebwrap/bubblewrap) request aSOCK_SEQPACKETunix socket pair, they crash on startup.Proposed Fix
To support running such applications on macOS hosts,
elfuseshould interceptAF_UNIXsockets/socketpairs of typeSOCK_SEQPACKETand fall back toSOCK_STREAM, which is fully supported on macOS and provides equivalent stream/reliability semantics for most local IPC.Location:
src/syscall/net.cinsys_socketandsys_socketpair.Issue 2: Standalone CLI loader cannot boot shebang (
#!) script targets directlyProblem Description
When executing a script (like a Python, Bash, or Perl program with a shebang header) directly as the initial target for
elfuse, the loader fails with a "not an ELF file" error. While the guest runtime handles shebang execution successfully insideexecve, the initial host-side bootstrap inmain.cdoes not parse shebang headers and requires an ELF binary.Proposed Fix
Implement a shebang parsing loop in the initial startup routine in
main.c. If the guest target is not an ELF file:guest_argv.Location:
src/main.c.