Skip to content

UNIX Domain Socket SOCK_SEQPACKET is unsupported on macOS hosts #104

@doanbaotrung

Description

@doanbaotrung

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:

  1. Parse the shebang interpreter path and any optional arguments.
  2. Update the guest target binary path to point to the interpreter.
  3. Prepend the interpreter and arguments to guest_argv.
  4. Recursively resolve the interpreter path.

Location: src/main.c.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions