aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/initbind.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-11-05 02:47:43 +0900
committerOphestra <cat@gensokyo.uk>2025-11-05 02:47:43 +0900
commitc1399f5030abde76728ba7982a7a22fd49e75359 (patch)
tree06e2a2ce11dbd7536150fd57824e406f101d50d9 /container/initbind.go
parent9ac63aac0cb025d1de195dbc57d0c89ebd1d7cc5 (diff)
std: rename from comp
Seccomp lookup tables are going to be relocated here, and PNR constants. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/initbind.go')
-rw-r--r--container/initbind.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/container/initbind.go b/container/initbind.go
index 12ebf994..2e63219b 100644
--- a/container/initbind.go
+++ b/container/initbind.go
@@ -7,7 +7,7 @@ import (
"syscall"
"hakurei.app/container/check"
- "hakurei.app/container/comp"
+ "hakurei.app/container/std"
)
func init() { gob.Register(new(BindMountOp)) }
@@ -29,18 +29,18 @@ type BindMountOp struct {
func (b *BindMountOp) Valid() bool {
return b != nil &&
b.Source != nil && b.Target != nil &&
- b.Flags&(comp.BindOptional|comp.BindEnsure) != (comp.BindOptional|comp.BindEnsure)
+ b.Flags&(std.BindOptional|std.BindEnsure) != (std.BindOptional|std.BindEnsure)
}
func (b *BindMountOp) early(_ *setupState, k syscallDispatcher) error {
- if b.Flags&comp.BindEnsure != 0 {
+ if b.Flags&std.BindEnsure != 0 {
if err := k.mkdirAll(b.Source.String(), 0700); err != nil {
return err
}
}
if pathname, err := k.evalSymlinks(b.Source.String()); err != nil {
- if os.IsNotExist(err) && b.Flags&comp.BindOptional != 0 {
+ if os.IsNotExist(err) && b.Flags&std.BindOptional != 0 {
// leave sourceFinal as nil
return nil
}
@@ -53,7 +53,7 @@ func (b *BindMountOp) early(_ *setupState, k syscallDispatcher) error {
func (b *BindMountOp) apply(state *setupState, k syscallDispatcher) error {
if b.sourceFinal == nil {
- if b.Flags&comp.BindOptional == 0 {
+ if b.Flags&std.BindOptional == 0 {
// unreachable
return OpStateError("bind")
}
@@ -76,10 +76,10 @@ func (b *BindMountOp) apply(state *setupState, k syscallDispatcher) error {
}
var flags uintptr = syscall.MS_REC
- if b.Flags&comp.BindWritable == 0 {
+ if b.Flags&std.BindWritable == 0 {
flags |= syscall.MS_RDONLY
}
- if b.Flags&comp.BindDevice == 0 {
+ if b.Flags&std.BindDevice == 0 {
flags |= syscall.MS_NODEV
}