From d124a1e4699ccba51ec6c68594e1694016314801 Mon Sep 17 00:00:00 2001 From: Val Packett Date: Thu, 4 May 2023 19:00:43 -0300 Subject: [PATCH] Do not unwrap() the sticky bit setting! (#2424) It fails on FreeBSD, making the zellij server quit and the client spin endlessly retrying to connect. --- zellij-server/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zellij-server/src/lib.rs b/zellij-server/src/lib.rs index f82c9d68..166a60c5 100644 --- a/zellij-server/src/lib.rs +++ b/zellij-server/src/lib.rs @@ -278,7 +278,8 @@ pub fn start_server(mut os_input: Box, socket_path: PathBuf) { // set the sticky bit to avoid the socket file being potentially cleaned up // https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html states that for XDG_RUNTIME_DIR: // "To ensure that your files are not removed, they should have their access time timestamp modified at least once every 6 hours of monotonic time or the 'sticky' bit should be set on the file. " - set_permissions(&socket_path, 0o1700).unwrap(); + // It is not guaranteed that all platforms allow setting the sticky bit on sockets! + drop(set_permissions(&socket_path, 0o1700)); for stream in listener.incoming() { match stream { Ok(stream) => {