From: Alessandro Astone Date: Tue, 22 Jul 2025 07:40:43 +0000 (+0200) Subject: ply-utils: Create parent directory before binding concrete socket X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fmerge-requests%2F359%2Fhead;p=thirdparty%2Fplymouth.git ply-utils: Create parent directory before binding concrete socket bind()'ing a concrete socket requires that the parent directory exists already. --- 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);