aboutsummaryrefslogtreecommitdiffhomepage
path: root/container
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-03 17:57:37 +0900
committerOphestra <cat@gensokyo.uk>2025-08-03 17:57:37 +0900
commit6a3886e9db3745c50d75f064fd7bf456aaa0ec8c (patch)
tree10a09d8280a157ad3fa109ede488e0bae7f672ec /container
parentff662963781c0b9e32c85c6cf725533b61af2bc7 (diff)
container/op: unexport bind resolved source field
This is used for symlink resolution and is only used internally. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container')
-rw-r--r--container/ops.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/container/ops.go b/container/ops.go
index 42e03a9f..b25f3209 100644
--- a/container/ops.go
+++ b/container/ops.go
@@ -68,7 +68,7 @@ func (f *Ops) Bind(source, target string, flags int) *Ops {
}
type BindMountOp struct {
- Source, SourceFinal, Target string
+ Source, sourceFinal, Target string
Flags int
}
@@ -89,18 +89,18 @@ func (b *BindMountOp) early(*Params) error {
if v, err := filepath.EvalSymlinks(b.Source); err != nil {
if os.IsNotExist(err) && b.Flags&BindOptional != 0 {
- b.SourceFinal = "\x00"
+ b.sourceFinal = "\x00"
return nil
}
return wrapErrSelf(err)
} else {
- b.SourceFinal = v
+ b.sourceFinal = v
return nil
}
}
func (b *BindMountOp) apply(*Params) error {
- if b.SourceFinal == "\x00" {
+ if b.sourceFinal == "\x00" {
if b.Flags&BindOptional == 0 {
// unreachable
return EBADE
@@ -108,11 +108,11 @@ func (b *BindMountOp) apply(*Params) error {
return nil
}
- if !path.IsAbs(b.SourceFinal) || !path.IsAbs(b.Target) {
+ if !path.IsAbs(b.sourceFinal) || !path.IsAbs(b.Target) {
return msg.WrapErr(EBADE, "path is not absolute")
}
- source := toHost(b.SourceFinal)
+ source := toHost(b.sourceFinal)
target := toSysroot(b.Target)
// this perm value emulates bwrap behaviour as it clears bits from 0755 based on
@@ -135,7 +135,7 @@ func (b *BindMountOp) apply(*Params) error {
flags |= MS_NODEV
}
- return hostProc.bindMount(source, target, flags, b.SourceFinal == b.Target)
+ return hostProc.bindMount(source, target, flags, b.sourceFinal == b.Target)
}
func (b *BindMountOp) Is(op Op) bool { vb, ok := op.(*BindMountOp); return ok && *b == *vb }