From ee2f5d545825752af63da36e2b9ec7a92985a875 Mon Sep 17 00:00:00 2001 From: James O'Doherty Date: Fri, 29 May 2026 18:29:12 -0400 Subject: feat: implement userspace wireguard data-path and unprivileged host fd-passing - Implement complete rootless network namespace bootstrap via C launcher using unshare(CLONE_NEWUSER | CLONE_NEWNS | CLONE_NEWNET). - Resolve unprivileged network isolation blackhole via host-socket preservation (FD passing): open client UDP sockets on the host pre-isolation, clear O_CLOEXEC, and ingest them via custom `FDBind` inside the sandbox. - Implement isolated routing table automation over `tun0` (addresses, MTU, default routes). - Implement persistent, multi-process namespace sharing and joining using reference-counted PID files and the setns system call. - Write robust, self-contained E2E data plane test suites in `tests/e2e/e2e_test.go` using a mock UDP listener. - Update project documentation (`README.md` and `AGENTS.md`) to reflect completed milestones. - Ensure 100% test passing rate and zero lint/staticcheck warnings. --- internal/namespace/namespace_stub.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'internal/namespace/namespace_stub.go') diff --git a/internal/namespace/namespace_stub.go b/internal/namespace/namespace_stub.go index 352ec13..84946bf 100644 --- a/internal/namespace/namespace_stub.go +++ b/internal/namespace/namespace_stub.go @@ -2,4 +2,22 @@ package namespace -// The namespace package provides stubs for non-Linux platforms. +import ( + "fmt" + "git.theodohertyfamily.com/tools/wg-wrap/internal/paths" +) + +// PinNamespace touches the namespace path to indicate it is pinned/active. +func PinNamespace(pm *paths.PathManager, profile string) error { + return fmt.Errorf("namespaces are not supported on this platform") +} + +// UnpinNamespace removes the pinned namespace file from the filesystem. +func UnpinNamespace(pm *paths.PathManager, profile string) error { + return fmt.Errorf("namespaces are not supported on this platform") +} + +// JoinExistingNamespace attempts to join the namespaces (user, mount, net) of an already active process. +func JoinExistingNamespace(pm *paths.PathManager, profile string) (bool, error) { + return false, fmt.Errorf("namespaces are not supported on this platform") +} -- cgit v1.2.3