mirror of
https://github.com/NixOS/nix
synced 2025-06-27 00:11:17 +02:00
Ignore EPERM when unsharing FS state
On Docker (but not podman), unshare(CLONE_FS) fails with EPERM. So let's ignore it and hope nothing bad happens. Attempted fix for #5777.
This commit is contained in:
parent
c260640dec
commit
ec8f24ed3a
3 changed files with 14 additions and 7 deletions
|
@ -1660,6 +1660,14 @@ void restoreMountNamespace()
|
|||
#endif
|
||||
}
|
||||
|
||||
void unshareFilesystem()
|
||||
{
|
||||
#ifdef __linux__
|
||||
if (unshare(CLONE_FS) != 0 && errno != EPERM)
|
||||
throw SysError("unsharing filesystem state in download thread");
|
||||
#endif
|
||||
}
|
||||
|
||||
void restoreProcessContext(bool restoreMounts)
|
||||
{
|
||||
restoreSignals();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue