jsonrpc: don't umask in unit tests

It can interfere with the creation of dummy directories in other threads and cause spurious errors
This commit is contained in:
Antoine Poinsot 2022-08-11 13:03:51 +02:00
parent 14bd3890dc
commit e6fcdd5b09
No known key found for this signature in database
GPG Key ID: E13FC145CD3F4304

View File

@ -194,8 +194,10 @@ fn bind(socket_path: &path::Path) -> Result<net::UnixListener, io::Error> {
pub fn rpcserver_setup(socket_path: &path::Path) -> Result<net::UnixListener, io::Error> {
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);
}