aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2026-03-30 16:43:01 +0200
committerGitHub <noreply@github.com>2026-03-30 16:43:01 +0200
commit00c6b0f549bd25ce82b73da8138d3c63599525f7 (patch)
tree261a8c9d367d5edfd8b3f2f966d7f86e74967afe /zellij-utils/src
parentLayout string flag (#4956) (diff)
downloadsl0ppij-00c6b0f549bd25ce82b73da8138d3c63599525f7.tar.gz
sl0ppij-00c6b0f549bd25ce82b73da8138d3c63599525f7.tar.xz
sl0ppij-00c6b0f549bd25ce82b73da8138d3c63599525f7.zip
Error on socket paths that are too long (#4957)
* error on socket paths that are too long * add pr
Diffstat (limited to 'zellij-utils/src')
-rw-r--r--zellij-utils/src/consts.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/zellij-utils/src/consts.rs b/zellij-utils/src/consts.rs
index 64c3ad95..75b9d4eb 100644
--- a/zellij-utils/src/consts.rs
+++ b/zellij-utils/src/consts.rs
@@ -276,6 +276,15 @@ mod unix_only {
use nix::unistd::Uid;
use std::env::temp_dir;
+ // Maximum length of a Unix domain socket path (from sockaddr_un.sun_path).
+ // macOS (and other BSDs) use 104, Linux/Android/Solaris use 108.
+ // The not(target_os = "macos") fallback of 108 is used for all other Unix
+ // platforms — this is correct for Linux/Android/Solaris and only 4 bytes
+ // over for BSDs, which would cause a slightly late error rather than a
+ // missed one.
+ #[cfg(target_os = "macos")]
+ pub const ZELLIJ_SOCK_MAX_LENGTH: usize = 104;
+ #[cfg(not(target_os = "macos"))]
pub const ZELLIJ_SOCK_MAX_LENGTH: usize = 108;
lazy_static! {