From e6fcdd5b095232729cbeef4bd42bf6e57d77ffde Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Thu, 11 Aug 2022 13:03:51 +0200 Subject: [PATCH] jsonrpc: don't umask in unit tests It can interfere with the creation of dummy directories in other threads and cause spurious errors --- src/jsonrpc/server.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/jsonrpc/server.rs b/src/jsonrpc/server.rs index 4100f990..4d6a45c1 100644 --- a/src/jsonrpc/server.rs +++ b/src/jsonrpc/server.rs @@ -194,8 +194,10 @@ fn bind(socket_path: &path::Path) -> Result { pub fn rpcserver_setup(socket_path: &path::Path) -> Result { log::debug!("Binding socket at {}", socket_path.display()); // Create the socket with RW permissions only for the user + #[cfg(not(test))] let old_umask = unsafe { libc::umask(0o177) }; let listener = bind(&socket_path); + #[cfg(not(test))] unsafe { libc::umask(old_umask); }