aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/landlock.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-11-05 20:13:19 +0900
committerOphestra <cat@gensokyo.uk>2025-11-05 20:13:19 +0900
commit9fd97e71d0330d6b6509f28686cf53825bc80941 (patch)
tree35774cbde4c1abd9967a1de98341a732ff3b464f /container/landlock.go
parentfba201c9953a490da914b09e09eaaa697a4b36e1 (diff)
treewide: fit test untyped int literals in 32-bit
This enables hakurei test suite to run on 32-bit targets. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/landlock.go')
-rw-r--r--container/landlock.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/container/landlock.go b/container/landlock.go
index 63d03817..7f0a821f 100644
--- a/container/landlock.go
+++ b/container/landlock.go
@@ -14,7 +14,8 @@ const (
LANDLOCK_CREATE_RULESET_VERSION = 1 << iota
)
-type LandlockAccessFS uintptr
+// LandlockAccessFS is bitmask of handled filesystem actions.
+type LandlockAccessFS uint64
const (
LANDLOCK_ACCESS_FS_EXECUTE LandlockAccessFS = 1 << iota
@@ -105,7 +106,8 @@ func (f LandlockAccessFS) String() string {
}
}
-type LandlockAccessNet uintptr
+// LandlockAccessNet is bitmask of handled network actions.
+type LandlockAccessNet uint64
const (
LANDLOCK_ACCESS_NET_BIND_TCP LandlockAccessNet = 1 << iota
@@ -140,7 +142,8 @@ func (f LandlockAccessNet) String() string {
}
}
-type LandlockScope uintptr
+// LandlockScope is bitmask of scopes restricting a Landlock domain from accessing outside resources.
+type LandlockScope uint64
const (
LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET LandlockScope = 1 << iota
@@ -175,6 +178,7 @@ func (f LandlockScope) String() string {
}
}
+// RulesetAttr is equivalent to struct landlock_ruleset_attr.
type RulesetAttr struct {
// Bitmask of handled filesystem actions.
HandledAccessFS LandlockAccessFS