mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 18:20:34 +00:00
p9: fix lcreate to respect the open mode
lcreate is not just used for creat(2), but open(2) as well. So it is possible that the read/write mode is specified manually. BUG=chromium:1105484 TEST=Run the test program in the bug. Read returns 0 like on other filesystem. Change-Id: I4fb642deb09831f00d3bd83e973e8a42c54ec5d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2297228 Tested-by: Victor Hsieh <victorhsieh@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org> Auto-Submit: Victor Hsieh <victorhsieh@chromium.org> Commit-Queue: Victor Hsieh <victorhsieh@chromium.org>
This commit is contained in:
parent
e43468f066
commit
fe863ad1bc
1 changed files with 2 additions and 2 deletions
|
@ -540,8 +540,8 @@ impl Server {
|
|||
}
|
||||
|
||||
let file = fs::OpenOptions::new()
|
||||
.read(false)
|
||||
.write(true)
|
||||
.read((lcreate.flags & P9_NOACCESS) == 0 || (lcreate.flags & P9_RDWR) != 0)
|
||||
.write((lcreate.flags & P9_WRONLY) != 0 || (lcreate.flags & P9_RDWR) != 0)
|
||||
.truncate(true)
|
||||
.create(true)
|
||||
.append((lcreate.flags & P9_APPEND) != 0)
|
||||
|
|
Loading…
Reference in a new issue