From 012102eefd2b145ddee774cba28e4fa889fadd49 Mon Sep 17 00:00:00 2001 From: Nicolas Lacasse Date: Wed, 20 Nov 2019 14:54:03 -0800 Subject: Pass OpenTruncate to gofer in Open call when opening file with O_TRUNC. Note that the Sentry still calls Truncate() on the file before calling Open. A new p9 version check was added to ensure that the p9 server can handle the the OpenTruncate flag. If not, then the flag is stripped before sending. PiperOrigin-RevId: 281609112 --- pkg/sentry/syscalls/linux/flags.go | 1 + 1 file changed, 1 insertion(+) (limited to 'pkg/sentry/syscalls/linux') diff --git a/pkg/sentry/syscalls/linux/flags.go b/pkg/sentry/syscalls/linux/flags.go index 444f2b004..07961dad9 100644 --- a/pkg/sentry/syscalls/linux/flags.go +++ b/pkg/sentry/syscalls/linux/flags.go @@ -50,5 +50,6 @@ func linuxToFlags(mask uint) fs.FileFlags { Directory: mask&linux.O_DIRECTORY != 0, Async: mask&linux.O_ASYNC != 0, LargeFile: mask&linux.O_LARGEFILE != 0, + Truncate: mask&linux.O_TRUNC != 0, } } -- cgit v1.2.3