From a0c2e66529cda9b89542501f1b7b3b3aae29652a Mon Sep 17 00:00:00 2001 From: Alessandro Astone Date: Tue, 22 Jul 2025 09:40:43 +0200 Subject: [PATCH] ply-utils: Create parent directory before binding concrete socket bind()'ing a concrete socket requires that the parent directory exists already. --- src/libply/ply-utils.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c index d8d28c08..f227589f 100644 --- a/src/libply/ply-utils.c +++ b/src/libply/ply-utils.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -223,6 +224,12 @@ ply_listen_to_unix_socket (const char *path, address = create_unix_address_from_path (path, type, &address_size); + if (type == PLY_UNIX_SOCKET_TYPE_CONCRETE) { + char *writable_path = strdup (path); + ply_create_directory (dirname (writable_path)); + free (writable_path); + } + if (bind (fd, address, address_size) < 0) { ply_save_errno (); free (address); -- 2.47.2