namespace: store and use original MountEntry paths when prefixing
authorLuca Boccassi <luca.boccassi@microsoft.com>
Thu, 28 Jan 2021 17:02:33 +0000 (17:02 +0000)
committerLuca Boccassi <luca.boccassi@microsoft.com>
Tue, 16 Feb 2021 14:33:23 +0000 (14:33 +0000)
commit809ceb8217ce88d00891353c2cbaa61f317937dd
treef834816fcd8f8f8d2bfc2f449827ebc166556250
parentb850a9b29f2bc14836415f0c85d42e7d4990285d
namespace: store and use original MountEntry paths when prefixing

Some paths (eg: mount_tmpfs) simply assumed that prefixing always
happens and it always stores the original path in path_const, and
the prefixed path in path_malloc.
But if a MountEntry is set up in a helper function and thus uses
only _malloc struct members, this assumption doesn't hold and there's
a crash.

Refactor so that prefixing is done with a helper which stores the
original path in a separate struct member, and accessing it also
uses a helper which does the right thing.
src/core/namespace.c