Skip to content

fix open mode inconsistencies#225

Open
mroi wants to merge 1 commit intomachine-drivers:masterfrom
mroi:patch-1
Open

fix open mode inconsistencies#225
mroi wants to merge 1 commit intomachine-drivers:masterfrom
mroi:patch-1

Conversation

@mroi
Copy link
Copy Markdown

@mroi mroi commented Nov 13, 2019

The lib9p filesystem backend currently does not handle open modes properly.

When the guest opens a file with O_RDWR, check_access() will never find a match, since it only compares against L9P_OREAD, L9P_OWRITE, and L9P_OEXEC, but not against L9P_ORDWR. Therefore, check_access() fails, when guests open files with O_RDWR.

In addition, the other modes are not translated from L9P to host values. The current implementation assumes, these modes have the same numerical representation in both. But in reality, they don’t.

This may fix #188.

I am aware that this patch will cause this version of lib9p to diverge from the original. Maybe it would be an alternative to port a more recent version from upstream. But it has changed considerably there, and I do not know, whether the upstream version fixes this problem or whether upstream can be integrated here.

* checking should be limited to read and write flags
* other flags require translation from L9P to system values
dtzWill pushed a commit to dtzWill/nixpkgs that referenced this pull request Jan 23, 2020
File modes are not properly translated from L9P to host values.
Instead, they are assumed to be identical, which is wrong on macOS.
machine-drivers/docker-machine-driver-xhyve#225

(cherry picked from commit 338386b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Operation not permitted

1 participant