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

feat(uhyvefilemap): improve guest path handling #844

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

n0toose
Copy link
Member

@n0toose n0toose commented 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 #815.

@n0toose n0toose requested a review from jounathaen December 17, 2024 23:52
@n0toose n0toose force-pushed the sandbox-guest-paths branch 2 times, most recently from f661d85 to c9cd2eb Compare December 17, 2024 23:56
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.86%. Comparing base (537e7cc) to head (a851879).
Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #844   +/-   ##
=======================================
  Coverage   71.85%   71.86%           
=======================================
  Files          23       23           
  Lines        3063     3064    +1     
=======================================
+ Hits         2201     2202    +1     
  Misses        862      862           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@n0toose n0toose force-pushed the sandbox-guest-paths branch 3 times, most recently from 95418e5 to fd837f7 Compare January 8, 2025 16:20
@n0toose n0toose force-pushed the sandbox-guest-paths branch from 50f2221 to 12ca0cd Compare January 9, 2025 09:47
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.
We also began using .display().to_string(), so as to drop non-Unicode
characters, similarly to when parsing the mappings.
@n0toose n0toose force-pushed the sandbox-guest-paths branch from 12ca0cd to a851879 Compare January 9, 2025 11:01
@jounathaen jounathaen added this pull request to the merge queue Jan 9, 2025
Merged via the queue into hermit-os:main with commit da4b63e Jan 9, 2025
11 checks passed
@jounathaen jounathaen deleted the sandbox-guest-paths branch January 9, 2025 11:13
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.

UhyveFileMap: Canonicalize guest paths
2 participants