src/socket_wrapper.c: Improve checks and debug output of socket_wrapper_dir()
authorAndreas Schneider <asn@samba.org>
Thu, 28 Jan 2021 19:06:11 +0000 (20:06 +0100)
committerAndreas Schneider <asn@samba.org>
Fri, 29 Jan 2021 07:42:31 +0000 (08:42 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
src/socket_wrapper.c

index 78cf7119920952a5dd7705225f814393f10e3afb..89454ca34d6e90fcc175e6911a20c0966f227934 100644 (file)
@@ -1475,7 +1475,7 @@ static char *socket_wrapper_dir(void)
        char *t;
        bool ok;
 
-       if (s == NULL) {
+       if (s == NULL || s[0] == '\0') {
                SWRAP_LOG(SWRAP_LOG_WARN, "SOCKET_WRAPPER_DIR not set");
                return NULL;
        }
@@ -1483,7 +1483,8 @@ static char *socket_wrapper_dir(void)
        swrap_dir = realpath(s, NULL);
        if (swrap_dir == NULL) {
                SWRAP_LOG(SWRAP_LOG_ERROR,
-                         "Unable to resolve socket_wrapper dir path: %s",
+                         "Unable to resolve socket_wrapper dir path: %s - %s",
+                         s,
                          strerror(errno));
                abort();
        }