aboutsummaryrefslogtreecommitdiffhomepage
path: root/helper
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-06-25 03:59:52 +0900
committerOphestra <cat@gensokyo.uk>2025-06-25 04:57:41 +0900
commit87e008d56de974947ebb99c2cc40b25d3c2cf43e (patch)
tree31791911e5226d6ec04e3fac7d91b0bf53e63aa5 /helper
parent399207321265307bb15f37d867f9370cd51c82a8 (diff)
treewide: rename to hakurei
Fortify makes little sense for a container tool. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'helper')
-rw-r--r--helper/args_test.go2
-rw-r--r--helper/cmd.go10
-rw-r--r--helper/cmd_test.go6
-rw-r--r--helper/container.go12
-rw-r--r--helper/container_test.go16
-rw-r--r--helper/helper.go10
-rw-r--r--helper/helper_test.go4
-rw-r--r--helper/stub.go6
-rw-r--r--helper/stub_test.go2
9 files changed, 34 insertions, 34 deletions
diff --git a/helper/args_test.go b/helper/args_test.go
index 7eca66b3..8547f4c1 100644
--- a/helper/args_test.go
+++ b/helper/args_test.go
@@ -7,7 +7,7 @@ import (
"syscall"
"testing"
- "git.gensokyo.uk/security/fortify/helper"
+ "git.gensokyo.uk/security/hakurei/helper"
)
func TestArgsString(t *testing.T) {
diff --git a/helper/cmd.go b/helper/cmd.go
index bfdd3484..55fd52e7 100644
--- a/helper/cmd.go
+++ b/helper/cmd.go
@@ -10,7 +10,7 @@ import (
"sync"
"syscall"
- "git.gensokyo.uk/security/fortify/helper/proc"
+ "git.gensokyo.uk/security/hakurei/helper/proc"
)
// NewDirect initialises a new direct Helper instance with wt as the null-terminated argument writer.
@@ -67,17 +67,17 @@ func (h *helperCmd) Start() error {
h.Env = slices.Grow(h.Env, 2)
if h.useArgsFd {
- h.Env = append(h.Env, FortifyHelper+"=1")
+ h.Env = append(h.Env, HakureiHelper+"=1")
} else {
- h.Env = append(h.Env, FortifyHelper+"=0")
+ h.Env = append(h.Env, HakureiHelper+"=0")
}
if h.useStatFd {
- h.Env = append(h.Env, FortifyStatus+"=1")
+ h.Env = append(h.Env, HakureiStatus+"=1")
// stat is populated on fulfill
h.Cancel = func() error { return h.stat.Close() }
} else {
- h.Env = append(h.Env, FortifyStatus+"=0")
+ h.Env = append(h.Env, HakureiStatus+"=0")
}
return proc.Fulfill(h.helperFiles.ctx, &h.ExtraFiles, h.Cmd.Start, h.files, h.extraFiles)
diff --git a/helper/cmd_test.go b/helper/cmd_test.go
index baad0319..555e246b 100644
--- a/helper/cmd_test.go
+++ b/helper/cmd_test.go
@@ -8,7 +8,7 @@ import (
"os/exec"
"testing"
- "git.gensokyo.uk/security/fortify/helper"
+ "git.gensokyo.uk/security/hakurei/helper"
)
func TestCmd(t *testing.T) {
@@ -22,9 +22,9 @@ func TestCmd(t *testing.T) {
})
t.Run("valid new helper nil check", func(t *testing.T) {
- if got := helper.NewDirect(t.Context(), "fortify", argsWt, false, argF, nil, nil); got == nil {
+ if got := helper.NewDirect(t.Context(), "hakurei", argsWt, false, argF, nil, nil); got == nil {
t.Errorf("NewDirect(%q, %q) got nil",
- argsWt, "fortify")
+ argsWt, "hakurei")
return
}
})
diff --git a/helper/container.go b/helper/container.go
index 6872f55b..e0c6fc82 100644
--- a/helper/container.go
+++ b/helper/container.go
@@ -9,8 +9,8 @@ import (
"slices"
"sync"
- "git.gensokyo.uk/security/fortify/helper/proc"
- "git.gensokyo.uk/security/fortify/sandbox"
+ "git.gensokyo.uk/security/hakurei/helper/proc"
+ "git.gensokyo.uk/security/hakurei/sandbox"
)
// New initialises a Helper instance with wt as the null-terminated argument writer.
@@ -54,17 +54,17 @@ func (h *helperContainer) Start() error {
h.Env = slices.Grow(h.Env, 2)
if h.useArgsFd {
- h.Env = append(h.Env, FortifyHelper+"=1")
+ h.Env = append(h.Env, HakureiHelper+"=1")
} else {
- h.Env = append(h.Env, FortifyHelper+"=0")
+ h.Env = append(h.Env, HakureiHelper+"=0")
}
if h.useStatFd {
- h.Env = append(h.Env, FortifyStatus+"=1")
+ h.Env = append(h.Env, HakureiStatus+"=1")
// stat is populated on fulfill
h.Cancel = func(*exec.Cmd) error { return h.stat.Close() }
} else {
- h.Env = append(h.Env, FortifyStatus+"=0")
+ h.Env = append(h.Env, HakureiStatus+"=0")
}
return proc.Fulfill(h.helperFiles.ctx, &h.ExtraFiles, func() error {
diff --git a/helper/container_test.go b/helper/container_test.go
index 088237cc..c6341c68 100644
--- a/helper/container_test.go
+++ b/helper/container_test.go
@@ -7,10 +7,10 @@ import (
"os/exec"
"testing"
- "git.gensokyo.uk/security/fortify/helper"
- "git.gensokyo.uk/security/fortify/internal"
- "git.gensokyo.uk/security/fortify/internal/fmsg"
- "git.gensokyo.uk/security/fortify/sandbox"
+ "git.gensokyo.uk/security/hakurei/helper"
+ "git.gensokyo.uk/security/hakurei/internal"
+ "git.gensokyo.uk/security/hakurei/internal/hlog"
+ "git.gensokyo.uk/security/hakurei/sandbox"
)
func TestContainer(t *testing.T) {
@@ -25,9 +25,9 @@ func TestContainer(t *testing.T) {
})
t.Run("valid new helper nil check", func(t *testing.T) {
- if got := helper.New(t.Context(), "fortify", argsWt, false, argF, nil, nil); got == nil {
+ if got := helper.New(t.Context(), "hakurei", argsWt, false, argF, nil, nil); got == nil {
t.Errorf("New(%q, %q) got nil",
- argsWt, "fortify")
+ argsWt, "hakurei")
return
}
})
@@ -52,6 +52,6 @@ func TestHelperInit(t *testing.T) {
if len(os.Args) != 5 || os.Args[4] != "init" {
return
}
- sandbox.SetOutput(fmsg.Output{})
- sandbox.Init(fmsg.Prepare, func(bool) { internal.InstallFmsg(false) })
+ sandbox.SetOutput(hlog.Output{})
+ sandbox.Init(hlog.Prepare, func(bool) { internal.InstallFmsg(false) })
}
diff --git a/helper/helper.go b/helper/helper.go
index 8a25fee9..fe0b164b 100644
--- a/helper/helper.go
+++ b/helper/helper.go
@@ -8,16 +8,16 @@ import (
"os"
"time"
- "git.gensokyo.uk/security/fortify/helper/proc"
+ "git.gensokyo.uk/security/hakurei/helper/proc"
)
var WaitDelay = 2 * time.Second
const (
- // FortifyHelper is set to 1 when args fd is enabled and 0 otherwise.
- FortifyHelper = "FORTIFY_HELPER"
- // FortifyStatus is set to 1 when stat fd is enabled and 0 otherwise.
- FortifyStatus = "FORTIFY_STATUS"
+ // HakureiHelper is set to 1 when args fd is enabled and 0 otherwise.
+ HakureiHelper = "HAKUREI_HELPER"
+ // HakureiStatus is set to 1 when stat fd is enabled and 0 otherwise.
+ HakureiStatus = "HAKUREI_STATUS"
)
type Helper interface {
diff --git a/helper/helper_test.go b/helper/helper_test.go
index be85304c..f2ae5c2b 100644
--- a/helper/helper_test.go
+++ b/helper/helper_test.go
@@ -11,13 +11,13 @@ import (
"testing"
"time"
- "git.gensokyo.uk/security/fortify/helper"
+ "git.gensokyo.uk/security/hakurei/helper"
)
var (
wantArgs = []string{
"unix:path=/run/dbus/system_bus_socket",
- "/tmp/fortify.1971/12622d846cc3fe7b4c10359d01f0eb47/system_bus_socket",
+ "/tmp/hakurei.1971/12622d846cc3fe7b4c10359d01f0eb47/system_bus_socket",
"--filter",
"--talk=org.bluez",
"--talk=org.freedesktop.Avahi",
diff --git a/helper/stub.go b/helper/stub.go
index ae839d78..bd0e1b52 100644
--- a/helper/stub.go
+++ b/helper/stub.go
@@ -14,13 +14,13 @@ import (
func InternalHelperStub() {
// this test mocks the helper process
var ap, sp string
- if v, ok := os.LookupEnv(FortifyHelper); !ok {
+ if v, ok := os.LookupEnv(HakureiHelper); !ok {
return
} else {
ap = v
}
- if v, ok := os.LookupEnv(FortifyStatus); !ok {
- panic(FortifyStatus)
+ if v, ok := os.LookupEnv(HakureiStatus); !ok {
+ panic(HakureiStatus)
} else {
sp = v
}
diff --git a/helper/stub_test.go b/helper/stub_test.go
index 1de830e3..52973f61 100644
--- a/helper/stub_test.go
+++ b/helper/stub_test.go
@@ -3,7 +3,7 @@ package helper_test
import (
"testing"
- "git.gensokyo.uk/security/fortify/helper"
+ "git.gensokyo.uk/security/hakurei/helper"
)
func TestHelperStub(t *testing.T) { helper.InternalHelperStub() }