File yggdrasil-no-openbsd-unveil-2.patch of Package yggdrasil-go
From c16fa4f7e20d3775f3d2f11b801b5ac3506c9515 Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Wed, 25 Dec 2024 18:07:47 +0000
Subject: [PATCH] Revert "genkeys, yggdrasilctl: Use pledge(2) on OpenBSD
(#1193)"
This introduces unnecessary dependency that is meaningless in Linux.
This reverts commit 2d587740c11e136dbc094be206bfaeeda8559d3f.
---
cmd/genkeys/main.go | 6 ------
cmd/yggdrasilctl/main.go | 12 ------------
2 files changed, 18 deletions(-)
diff --git a/cmd/genkeys/main.go b/cmd/genkeys/main.go
index 2d007cb..5a90b1c 100644
--- a/cmd/genkeys/main.go
+++ b/cmd/genkeys/main.go
@@ -18,8 +18,6 @@ import (
"runtime"
"time"
- "suah.dev/protect"
-
"github.com/yggdrasil-network/yggdrasil-go/src/address"
)
@@ -30,10 +28,6 @@ type keySet struct {
}
func main() {
- if err := protect.Pledge("stdio"); err != nil {
- panic(err)
- }
-
threads := runtime.GOMAXPROCS(0)
fmt.Println("Threads:", threads)
start := time.Now()
diff --git a/cmd/yggdrasilctl/main.go b/cmd/yggdrasilctl/main.go
index 51c25dc..ca0bce1 100644
--- a/cmd/yggdrasilctl/main.go
+++ b/cmd/yggdrasilctl/main.go
@@ -13,8 +13,6 @@ import (
"strings"
"time"
- "suah.dev/protect"
-
"github.com/olekukonko/tablewriter"
"github.com/yggdrasil-network/yggdrasil-go/src/admin"
"github.com/yggdrasil-network/yggdrasil-go/src/core"
@@ -24,11 +22,6 @@ import (
)
func main() {
- // read config, speak DNS/TCP and/or over a UNIX socket
- if err := protect.Pledge("stdio rpath inet unix dns"); err != nil {
- panic(err)
- }
-
// makes sure we can use defer and still return an error code to the OS
os.Exit(run())
}
@@ -85,11 +78,6 @@ func run() int {
panic(err)
}
- // config and socket are done, work without unprivileges
- if err := protect.Pledge("stdio"); err != nil {
- panic(err)
- }
-
logger.Println("Connected")
defer conn.Close()
--
2.47.1