swrap: Abort on failure to use SOCKET_WRAPPER_DIR
authorMartin Schwenke <martin@meltin.net>
Sat, 13 Jun 2020 10:50:42 +0000 (20:50 +1000)
committerStefan Metzmacher <metze@samba.org>
Mon, 22 Jun 2020 14:43:01 +0000 (16:43 +0200)
If SOCKET_WRAPPER_DIR is set the intention is to use socket wrapper.
Returning NULL means socket wrapper is disabled.  The only sure way to
avoid running without socket wrapper is to abort.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
src/socket_wrapper.c

index 5b7c9eaddc526625bdaf034baf5cf6beafe56eb9..f8715e68ee3115c6b29cc48da3983f19f86f9179 100644 (file)
@@ -1385,7 +1385,7 @@ static char *socket_wrapper_dir(void)
                SWRAP_LOG(SWRAP_LOG_ERROR,
                          "Unable to resolve socket_wrapper dir path: %s",
                          strerror(errno));
-               return NULL;
+               abort();
        }
 
        SWRAP_LOG(SWRAP_LOG_TRACE, "socket_wrapper_dir: %s", swrap_dir);