[CRIU] [PATCH 2/2] sk-unix: Fix path resolving for sockets with abs symlinks in paths
Pavel Emelyanov
xemul at virtuozzo.com
Thu Jun 9 08:13:53 PDT 2016
On 06/08/2016 10:22 AM, Cyrill Gorcunov wrote:
> On Wed, Jun 08, 2016 at 12:03:43AM -0700, Andrey Vagin wrote:
>> Actually we need to fix the same problem not only for unix sockets.
>>
>> We need to check all places where we work with mntns_root.
>
> Yes, I said so in the cover message.
>
>>>
>>> + if (cr_set_root(mntns_root, &root_fd))
>>> + goto err;
>>> +
>>> snprintf(path, sizeof(path), ".%s/%s", dir, sk->name);
>>> - if (fstatat(mntns_root, path, &st, 0)) {
>>> - if (errno == ENOENT)
>>> + ret = fstatat(mntns_root, path, &st, 0);
>>> + errno_save = errno;
>>> + if (cr_restore_root(root_fd))
>>> + goto err;
>>
>> I was talking with Pavel about this problem and we decided to not
>> restore root each time. We can do it only when it's requred. In this
>> case the overhead will be much smaller.
>
> How can we figure out if we don't need to use this helper?
We need to (I don't know how :) ) make sure that we use only -at calls
that work with paths.
-- Pavel
More information about the CRIU
mailing list