-
Notifications
You must be signed in to change notification settings - Fork 29
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
UhyveFileMap: Canonicalize guest paths #815
Labels
enhancement
New feature or request
Comments
Possibly related to hermit-os/kernel#1477. We should emulate Hermit's behavior and pass on an environment variable instead of exclusively hard-coding |
Mild dependency on #814. |
n0toose
added a commit
to n0toose/uhyve
that referenced
this issue
Dec 17, 2024
Until now, guest paths were not canonicalized. This would mean that Uhyve would not be able to see that, for example, "/root" and "/root/directory/.." are both locations referring to the same directory. This requires a new dependency for now, although we should remove it once Path::normalize_lexically is implemented and part of Rust. This also "removes" support for empty, mapped guest paths. Fixes hermit-os#815.
n0toose
added a commit
to n0toose/uhyve
that referenced
this issue
Dec 17, 2024
Until now, guest paths were not canonicalized. This would mean that Uhyve would not be able to see that, for example, "/root" and "/root/directory/.." are both locations referring to the same directory. This requires a new dependency for now, although we should remove it once Path::normalize_lexically is implemented and part of Rust. This also "removes" support for empty, mapped guest paths. Fixes hermit-os#815.
n0toose
added a commit
to n0toose/uhyve
that referenced
this issue
Dec 17, 2024
Until now, guest paths were not canonicalized. This would mean that Uhyve would not be able to see that, for example, "/root" and "/root/directory/.." are both locations referring to the same directory. This requires a new dependency for now, although we should remove it once Path::normalize_lexically is implemented and part of Rust. This also "removes" support for empty, mapped guest paths. Fixes hermit-os#815.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, entering
--file-mapping host.txt:..
as a parameter leads to behavior that is not... exactly how it should be (opening the parent directory would result in opening a text file), and--file-mapping host.txt:guest.txt
!=--file-mapping host.txt:/root/guest.txt
(guest.txt
and/root/guest.txt
are seen as two separate files, as we only look up a mapping against a "string" provided in the form of achar*
inOpenParams
).The first case isn't as severe, because the actual problem at hand can only be caused by a user trying to break things. However, the second case is a problem - both could be solved by "canonicalizing" the paths provided by the guest, same as on the host. An idea is to make Hermit and Uhyve "
chdir
-aware" or "force" Hermit to provide full paths when running anopen
call.The text was updated successfully, but these errors were encountered: