multipass icon indicating copy to clipboard operation
multipass copied to clipboard

Fix symlink resolution when mounting

Open Sploder12 opened this issue 1 year ago • 2 comments

fixes #1722

Symbolic links are now resolved when performing a mount. Previously they were not resolved.

Sploder12 avatar Sep 12 '24 20:09 Sploder12

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.88%. Comparing base (21430a3) to head (e4d1ea0). Report is 14 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3673   +/-   ##
=======================================
  Coverage   88.87%   88.88%           
=======================================
  Files         256      256           
  Lines       14579    14581    +2     
=======================================
+ Hits        12957    12960    +3     
+ Misses       1622     1621    -1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 12 '24 21:09 codecov[bot]

Hey Trevor, a quick experiment I did:

#include <filesystem>
#include <iostream>

using namespace std;
namespace fs = std::filesystem;

int main()
{
  // l4 -> ..
  // l2 -> ../subl-mdpreview
  auto src_path = "/home/ricab/tmp/asdf/l4/asdf/l4/asdf/l2/";

  error_code ec{};
  auto dst_path = fs::weakly_canonical(src_path, ec);

  if (!ec)
    cout << "\"" << src_path << "\" == " << dst_path << endl;

  // prints "/home/ricab/tmp/asdf/l4/asdf/l4/asdf/l2/" == "/home/ricab/tmp/subl-mdpreview"

  return bool(ec);
}

ricab avatar Oct 14 '24 10:10 ricab

I wonder if we should check elsewhere in the repo for usage of \"{}\" since a string like Hello\\ could cause issues (becomes "Hello\"). WDYT?

Sploder12 avatar Oct 21 '24 16:10 Sploder12

I wonder if we should check elsewhere in the repo for usage of "{}" since a string like Hello\ could cause issues (becomes "Hello"). WDYT?

We ended up considering this moot, correct @Sploder12 ?

ricab avatar Nov 15 '24 14:11 ricab

We ended up considering this moot, correct @Sploder12 ?

There was one issue that came from it https://github.com/canonical/multipass/issues/3759, but no real impact.

Sploder12 avatar Nov 15 '24 14:11 Sploder12

OK, all builds but windows succeeded in the merge queue: https://github.com/canonical/multipass-private/actions/runs/12067865806/job/33655393234

The private side is necessary for windows, so merging manually.

ricab avatar Nov 28 '24 13:11 ricab