summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/syscalls/linux/flags.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/syscalls/linux/flags.go')
-rw-r--r--pkg/sentry/syscalls/linux/flags.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/sentry/syscalls/linux/flags.go b/pkg/sentry/syscalls/linux/flags.go
index d1e0833fc..d2aec963a 100644
--- a/pkg/sentry/syscalls/linux/flags.go
+++ b/pkg/sentry/syscalls/linux/flags.go
@@ -22,6 +22,9 @@ import (
// flagsToPermissions returns a Permissions object from Linux flags.
// This includes truncate permission if O_TRUNC is set in the mask.
func flagsToPermissions(mask uint) (p fs.PermMask) {
+ if mask&linux.O_TRUNC != 0 {
+ p.Write = true
+ }
switch mask & linux.O_ACCMODE {
case linux.O_WRONLY:
p.Write = true