1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2018-09-18 16:19:40 +10:00 committed by Amitay Isaacs
parent 2229f4620d
commit 32c2ec8fa2

View File

@ -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(),