Skip to content
Commit 9a392dff authored by Pavel Emelyanov's avatar Pavel Emelyanov
Browse files

reg-files: Do not try to linkat with wrong user



We link files to each other at restore time to restore
unlinked paths. Kernel has strange secutiry restrictions
about linkat we use. If the fsuid of the caller doesn't
equals the uid of the file and the file is not "safe"
one, then only global CAP_CHOWN will be allowed to link().

This brings problems in user namespaces -- uns root is
not allowed to linkat any file, unlike global root.

Fortunately, we can change the fsuid temporarily and
still linkat the file we want. Hopefully this hack will
go away some day soon, when the kernel will have saner
checks for linkat capabilities.

Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
Acked-by: default avatarAndrew Vagin <avagin@parallels.com>
parent ba66b14b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment