]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-common: Fix CTDB_SOCKET default outside test mode
authorMartin Schwenke <mschwenke@ddn.com>
Mon, 6 Jul 2026 08:44:34 +0000 (18:44 +1000)
committerMartin Schwenke <martins@samba.org>
Mon, 13 Jul 2026 12:53:23 +0000 (12:53 +0000)
smbd expects to use CTDB_SOCKET (define, not environment variable) as
a default.

If --with-socketpath was specified at build time then smbd and ctdbd
might disagree on the socket location.  smbd will use whatever is
specified (i.e. CTDB_SOCKET) but CTDB always uses path_socket() to put
the socket in CTDB_RUNDIR.

CTDB should default to CTDB_SOCKET (define) too.

This only changes the result when --with-socketpath is specified.  We
should get rid of that later and always use something in
CTDB_SOCKETDIR.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
ctdb/common/path.c

index 2aac1e39d371434e0f892b64fa49e179f66703e9..e207641beb9ed97ff98946d93e2569ca0799daf6 100644 (file)
@@ -314,6 +314,8 @@ char *path_socket(TALLOC_CTX *mem_ctx, const char *daemon)
                        if (t != NULL) {
                                return talloc_strdup(mem_ctx, t);
                        }
+               } else {
+                       return talloc_strdup(mem_ctx, CTDB_SOCKET);
                }
        }