machine-drivers / docker-machine-driver-xhyve

docker-machine/minikube/minishift driver plugin for xhyve/hyperkit (native macOS hypervisor.framework)
https://godoc.org/github.com/machine-drivers/docker-machine-driver-xhyve
BSD 3-Clause "New" or "Revised" License
888 stars 74 forks source link

fix open mode inconsistencies #225

Open mroi opened 4 years ago

mroi commented 4 years ago

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.