diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-14 02:12:35 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-14 02:12:35 +0900 |
| commit | 2eff47009102d53844906aa90fb2b8eddae78c1b (patch) | |
| tree | fce33594aa17c9847295cd86fe469a7d5c13d437 /internal/sandbox/mount.go | |
| parent | a092b042abca15ce3ba9def9b502d8a7cb889c1b (diff) | |
sandbox/mount: pass custom tmpfs name
The tmpfs driver allows arbitrary fsname.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/sandbox/mount.go')
| -rw-r--r-- | internal/sandbox/mount.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/sandbox/mount.go b/internal/sandbox/mount.go index ea781d60..eaede7b4 100644 --- a/internal/sandbox/mount.go +++ b/internal/sandbox/mount.go @@ -82,7 +82,7 @@ func bindMount(src, dest string, flags int) error { fmt.Sprintf("cannot bind %q on %q:", src, dest)) } -func mountTmpfs(name string, size int, perm os.FileMode) error { +func mountTmpfs(fsname, name string, size int, perm os.FileMode) error { target := toSysroot(name) if err := os.MkdirAll(target, perm); err != nil { return err @@ -91,7 +91,7 @@ func mountTmpfs(name string, size int, perm os.FileMode) error { if size > 0 { opt += fmt.Sprintf(",size=%d", size) } - return fmsg.WrapErrorSuffix(syscall.Mount("tmpfs", target, "tmpfs", + return fmsg.WrapErrorSuffix(syscall.Mount(fsname, target, "tmpfs", syscall.MS_NOSUID|syscall.MS_NODEV, opt), fmt.Sprintf("cannot mount tmpfs on %q:", name)) } |
