From 2ddb4a564597e315baa4f140448bbc118e76bed2 Mon Sep 17 00:00:00 2001 From: Owen Date: Thu, 4 Dec 2025 21:39:20 -0500 Subject: [PATCH] Check permissions Former-commit-id: 0f8c6b2e17f186b78df3f969e9d08e96f3c7dc7d --- olm/olm.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/olm/olm.go b/olm/olm.go index 22c1aa7..7f52ce9 100644 --- a/olm/olm.go +++ b/olm/olm.go @@ -12,6 +12,7 @@ import ( "time" "github.com/fosrl/newt/bind" + "github.com/fosrl/newt/clients/permissions" "github.com/fosrl/newt/holepunch" "github.com/fosrl/newt/logger" "github.com/fosrl/newt/network" @@ -99,6 +100,13 @@ func Init(ctx context.Context, config GlobalConfig) { logger.GetLogger().SetLevel(util.ParseLogLevel(config.LogLevel)) + logger.Debug("Checking permissions for native interface") + err := permissions.CheckNativeInterfacePermissions() + if err != nil { + logger.Fatal("Insufficient permissions to create native TUN interface: %v", err) + return + } + if config.HTTPAddr != "" { apiServer = api.NewAPI(config.HTTPAddr) } else if config.SocketPath != "" {