From: Martin Schwenke Date: Tue, 18 Sep 2018 06:19:40 +0000 (+1000) Subject: ctdb-common: Allow path_socket() to use $CTDB_SOCKET X-Git-Tag: tdb-1.3.17~915 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32c2ec8fa25ad21b9739a288f4a11db2bac1dc6f;p=thirdparty%2Fsamba.git ctdb-common: Allow path_socket() to use $CTDB_SOCKET Use of CTDB_SOCKET is being generally removed. However, this override is being added to allow test code outside of ctdb/ to be able to specify the socket, if desired. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/common/path.c b/ctdb/common/path.c index 165664650ed..69e606b4ede 100644 --- a/ctdb/common/path.c +++ b/ctdb/common/path.c @@ -188,6 +188,14 @@ char *path_config(TALLOC_CTX *mem_ctx) char *path_socket(TALLOC_CTX *mem_ctx, const char *daemon) { + if (strcmp(daemon, "ctdbd") == 0) { + const char *t = getenv("CTDB_SOCKET"); + + if (t != NULL) { + return talloc_strdup(mem_ctx, t); + } + } + return talloc_asprintf(mem_ctx, "%s/%s.socket", path_rundir(),