From ec8f24ed3a3115cba85f908515c423112e5b13e0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 16 Dec 2021 21:26:22 +0100 Subject: 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. --- src/libstore/filetransfer.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/libstore/filetransfer.cc') diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index 4621a8217..17980ab22 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -544,13 +544,7 @@ struct curlFileTransfer : public FileTransfer stopWorkerThread(); }); -#ifdef __linux__ - /* Cause this thread to not share any FS attributes with the main thread, - because this causes setns() in restoreMountNamespace() to fail. - Ideally, this would happen in the std::thread() constructor. */ - if (unshare(CLONE_FS) != 0) - throw SysError("unsharing filesystem state in download thread"); -#endif + unshareFilesystem(); std::map> items; -- cgit v1.2.3