diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-08-03 20:46:41 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-08-03 21:16:45 +0900 |
| commit | c6be82bcf91fc4b6e61d9df40213e80367addbd8 (patch) | |
| tree | ee245cf214ff845f0d8a3eac0cc1a6064107112d /container/ops.go | |
| parent | 38245559dca0833dc078b982d59490eee53e168c (diff) | |
container/path: fhs path constants
This increases readability since this can help disambiguate absolute paths from similarly named path segments.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/ops.go')
| -rw-r--r-- | container/ops.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/container/ops.go b/container/ops.go index e3eb45f8..8d9d1691 100644 --- a/container/ops.go +++ b/container/ops.go @@ -215,7 +215,7 @@ func (d *MountDevOp) apply(params *Params) error { return err } if err := hostProc.bindMount( - toHost("/dev/"+name), + toHost(FHSDev+name), targetPath, 0, true, @@ -225,15 +225,15 @@ func (d *MountDevOp) apply(params *Params) error { } for i, name := range []string{"stdin", "stdout", "stderr"} { if err := os.Symlink( - "/proc/self/fd/"+string(rune(i+'0')), + FHSProc+"self/fd/"+string(rune(i+'0')), path.Join(target, name), ); err != nil { return wrapErrSelf(err) } } for _, pair := range [][2]string{ - {"/proc/self/fd", "fd"}, - {"/proc/kcore", "core"}, + {FHSProc + "self/fd", "fd"}, + {FHSProc + "kcore", "core"}, {"pts/ptmx", "ptmx"}, } { if err := os.Symlink(pair[0], path.Join(target, pair[1])); err != nil { @@ -436,7 +436,7 @@ func (t *TmpfileOp) apply(params *Params) error { } var tmpPath string - if f, err := os.CreateTemp("/", "tmp.*"); err != nil { + if f, err := os.CreateTemp(FHSRoot, "tmp.*"); err != nil { return wrapErrSelf(err) } else if _, err = f.Write(t.Data); err != nil { return wrapErrSuffix(err, |
