Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix open mode inconsistencies #225

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix open mode inconsistencies #225

wants to merge 1 commit into from

Conversation

mroi
Copy link

@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