aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-03-17 16:10:55 +0900
committerOphestra <cat@gensokyo.uk>2025-03-17 16:10:55 +0900
commit70c9757e26909a7ac6780dc6140af6a1b925e508 (patch)
tree63b7083bbe2186735cddfa81ddefd8da25e1ca66
parentc83a7e2efc0ae87a6a3d300f18212e4f46c950a2 (diff)
sandbox/mount: rename device flag
Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--sandbox/mount.go4
-rw-r--r--sandbox/sequential.go7
2 files changed, 4 insertions, 7 deletions
diff --git a/sandbox/mount.go b/sandbox/mount.go
index e47e7f5d..e2cc2907 100644
--- a/sandbox/mount.go
+++ b/sandbox/mount.go
@@ -13,7 +13,7 @@ const (
BindSource
BindRecursive
BindWritable
- BindDevices
+ BindDevice
)
func bindMount(src, dest string, flags int) error {
@@ -66,7 +66,7 @@ func bindMount(src, dest string, flags int) error {
if flags&BindWritable == 0 {
mf |= syscall.MS_RDONLY
}
- if flags&BindDevices == 0 {
+ if flags&BindDevice == 0 {
mf |= syscall.MS_NODEV
}
if msg.IsVerbose() {
diff --git a/sandbox/sequential.go b/sandbox/sequential.go
index 9b6e34b8..bcfded8f 100644
--- a/sandbox/sequential.go
+++ b/sandbox/sequential.go
@@ -89,7 +89,7 @@ func (d MountDev) apply(params *InitParams) error {
for _, name := range []string{"null", "zero", "full", "random", "urandom", "tty"} {
if err := bindMount(
"/dev/"+name, path.Join(v, name),
- BindSource|BindDevices,
+ BindSource|BindDevice,
); err != nil {
return err
}
@@ -132,10 +132,7 @@ func (d MountDev) apply(params *InitParams) error {
syscall.SYS_IOCTL, 1, syscall.TIOCGWINSZ,
uintptr(unsafe.Pointer(&buf[0])),
); errno == 0 {
- if err := bindMount(
- "/proc/self/fd/1", path.Join(v, "console"),
- BindDevices,
- ); err != nil {
+ if err := bindMount("/proc/self/fd/1", path.Join(v, "console"), BindDevice); err != nil {
return err
}
}