From 36ea20b0ccfc6805d4942812e35de0f0dfdaab57 Mon Sep 17 00:00:00 2001 From: Socialpranker <273312799+Socialpranker@users.noreply.github.com> Date: Sun, 12 Jul 2026 16:40:39 +0200 Subject: [PATCH] vfs: build the real uid/gid lookup on OpenBSD too Mounted files showed up owned by 4294967295 (^uint32(0)) on OpenBSD. vfsflags_unix.go, which calls unix.Geteuid()/unix.Getegid() to get the real uid/gid, only builds for linux, darwin and freebsd; OpenBSD fell through to vfsflags_non_unix.go's zero-value stub instead. OpenBSD has no linux/darwin/freebsd-specific fields here, just the same POSIX Geteuid/Getegid/Umask calls golang.org/x/sys/unix already ships for openbsd on every arch, so this just adds openbsd to both build tags rather than needing a separate file. Cross-compiled for GOOS=openbsd (arm64, amd64) and go vet clean; ran the existing vfs test suite on darwin, no regressions. Not yet verified on a live OpenBSD mount, only that the right uid/gid syscalls now get called in this codepath. Co-Authored-By: Claude Opus 4.8 --- vfs/vfscommon/vfsflags_non_unix.go | 2 +- vfs/vfscommon/vfsflags_unix.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vfs/vfscommon/vfsflags_non_unix.go b/vfs/vfscommon/vfsflags_non_unix.go index 0cf18a200..eb20b2e30 100644 --- a/vfs/vfscommon/vfsflags_non_unix.go +++ b/vfs/vfscommon/vfsflags_non_unix.go @@ -1,4 +1,4 @@ -//go:build !linux && !darwin && !freebsd +//go:build !linux && !darwin && !freebsd && !openbsd package vfscommon diff --git a/vfs/vfscommon/vfsflags_unix.go b/vfs/vfscommon/vfsflags_unix.go index 48ea7ef2e..b2ee3022b 100644 --- a/vfs/vfscommon/vfsflags_unix.go +++ b/vfs/vfscommon/vfsflags_unix.go @@ -1,4 +1,4 @@ -//go:build linux || darwin || freebsd +//go:build linux || darwin || freebsd || openbsd package vfscommon