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

incusd/device/disk: Allow relative paths within custom volumes #1092

Merged
merged 4 commits into from
Aug 8, 2024

Commits on Aug 8, 2024

  1. api: disk_volume_subpath

    Signed-off-by: Stéphane Graber <[email protected]>
    stgraber committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    9159e59 View commit details
    Browse the repository at this point in the history
  2. incusd/device/disk: Allow relative paths within custom volumes

    The general logic is pretty straightforward, we allow the `source`
    property to include both the volume name and then a relative path to
    that volume.
    
    The tricky part is to do this safely as the user will be in control of
    the volume and so can create dangerous symlinks in there, trying to
    trick us into reading data from the host.
    
    Carefuly use of Openat2 allows us to restrict resolution in a race-free way.
    
    Closes lxc#993
    
    Signed-off-by: Stéphane Graber <[email protected]>
    stgraber committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    a6303d7 View commit details
    Browse the repository at this point in the history
  3. doc/devices_disk: Mention sub-paths

    Signed-off-by: Stéphane Graber <[email protected]>
    stgraber committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    662de88 View commit details
    Browse the repository at this point in the history
  4. tests: Test volume subpaths

    Signed-off-by: Stéphane Graber <[email protected]>
    stgraber committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    9e19e19 View commit details
    Browse the repository at this point in the history