From 6e8447b4118db1b5f8e2c6ba42f365b70f16a3b7 Mon Sep 17 00:00:00 2001 From: Matt Mundell Date: Thu, 9 Apr 2020 10:29:37 +0200 Subject: [PATCH 1/2] Ensure path of listening UNIX socket exists --- src/gvmd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gvmd.c b/src/gvmd.c index 16f9073cb..71f420801 100644 --- a/src/gvmd.c +++ b/src/gvmd.c @@ -1370,6 +1370,7 @@ manager_listen (const char *address_str_unix, const char *address_str_tls, if (address_str_unix) { struct stat state; + gchar *address_parent; /* UNIX file socket. */ @@ -1398,6 +1399,18 @@ manager_listen (const char *address_str_unix, const char *address_str_tls, address = (struct sockaddr *) &address_unix; address_size = sizeof (address_unix); + + /* Ensure the path of the socket exists. */ + + address_parent = g_path_get_dirname (address_str_unix); + if (g_mkdir_with_parents (address_parent, 0755 /* "rwxr-xr-x" */)) + { + g_warning ("%s: failed to create socket dir %s", __func__, + address_parent); + g_free (address_parent); + return -1; + } + g_free (address_parent); } else if (address_str_tls) { From 6a1cc5310e89444dafd21a4db49e656b4e2d719e Mon Sep 17 00:00:00 2001 From: Matt Mundell Date: Thu, 9 Apr 2020 10:31:16 +0200 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7149009f..61acaf110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add a delay for re-requesting scan information via osp [#1012](https://github.com/greenbone/gvmd/pull/1012) - Add --optimize option cleanup-result-encoding [#1013](https://github.com/greenbone/gvmd/pull/1013) - Perform integrity check of VTs after updates [#1024](https://github.com/greenbone/gvmd/pull/1024) [#1035](https://github.com/greenbone/gvmd/pull/1035) +- Ensure path of listening UNIX socket exists [#1040](https://github.com/greenbone/gvmd/pull/1040) ### Changed - Update SCAP and CERT feed info in sync scripts [#810](https://github.com/greenbone/gvmd/pull/810)