diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-21 20:54:03 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-21 20:54:03 +0900 |
| commit | e94acc424c5746eb6cf903ed97b4e71223fda50f (patch) | |
| tree | c55f4b467ed11149006a799421936845bf64de99 /container/initbind.go | |
| parent | b1a4d801be033b41c559e9642ee05e2f0ec43d5b (diff) | |
container/comp: rename from bits
This package will also hold syscall lookup tables for seccomp.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/initbind.go')
| -rw-r--r-- | container/initbind.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/container/initbind.go b/container/initbind.go index 54f00120..12ebf994 100644 --- a/container/initbind.go +++ b/container/initbind.go @@ -6,8 +6,8 @@ import ( "os" "syscall" - "hakurei.app/container/bits" "hakurei.app/container/check" + "hakurei.app/container/comp" ) 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&(bits.BindOptional|bits.BindEnsure) != (bits.BindOptional|bits.BindEnsure) + b.Flags&(comp.BindOptional|comp.BindEnsure) != (comp.BindOptional|comp.BindEnsure) } func (b *BindMountOp) early(_ *setupState, k syscallDispatcher) error { - if b.Flags&bits.BindEnsure != 0 { + if b.Flags&comp.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&bits.BindOptional != 0 { + if os.IsNotExist(err) && b.Flags&comp.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&bits.BindOptional == 0 { + if b.Flags&comp.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&bits.BindWritable == 0 { + if b.Flags&comp.BindWritable == 0 { flags |= syscall.MS_RDONLY } - if b.Flags&bits.BindDevice == 0 { + if b.Flags&comp.BindDevice == 0 { flags |= syscall.MS_NODEV } |
