summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs-xml/smbdotconf/misc/ctdbdsocket.xml3
-rw-r--r--lib/param/param_table.c2
-rw-r--r--source3/include/ctdbd_conn.h1
-rw-r--r--source3/lib/ctdb_dummy.c5
-rw-r--r--source3/lib/ctdbd_conn.c12
-rw-r--r--source3/lib/dbwrap/dbwrap_open.c4
-rw-r--r--source3/param/loadparm.c10
-rw-r--r--source3/torture/test_ctdbconn.c1
8 files changed, 24 insertions, 14 deletions
diff --git a/docs-xml/smbdotconf/misc/ctdbdsocket.xml b/docs-xml/smbdotconf/misc/ctdbdsocket.xml
index 378d6e24c5..27e8121bd6 100644
--- a/docs-xml/smbdotconf/misc/ctdbdsocket.xml
+++ b/docs-xml/smbdotconf/misc/ctdbdsocket.xml
@@ -1,8 +1,9 @@
<samba:parameter name="ctdbd socket"
context="G"
advanced="1"
- type="string"
+ type="string"
constant="1"
+ function="_ctdbd_socket"
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
<description>
<para>If you set <value type="example">clustering=yes</value>,
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index ad929ec16b..40f8eb50d8 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -1938,7 +1938,7 @@ static struct parm_struct parm_table[] = {
.label = "ctdbd socket",
.type = P_STRING,
.p_class = P_GLOBAL,
- .offset = GLOBAL_VAR(ctdbd_socket),
+ .offset = GLOBAL_VAR(_ctdbd_socket),
.special = NULL,
.enum_list = NULL,
.flags = FLAG_ADVANCED | FLAG_GLOBAL,
diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h
index e250925a75..49445d91b2 100644
--- a/source3/include/ctdbd_conn.h
+++ b/source3/include/ctdbd_conn.h
@@ -30,6 +30,7 @@ NTSTATUS ctdbd_messaging_connection(TALLOC_CTX *mem_ctx,
struct ctdbd_connection **pconn);
uint32_t ctdbd_vnn(const struct ctdbd_connection *conn);
+const char *lp_ctdbd_socket(void);
NTSTATUS ctdbd_register_msg_ctx(struct ctdbd_connection *conn,
struct messaging_context *msg_ctx);
diff --git a/source3/lib/ctdb_dummy.c b/source3/lib/ctdb_dummy.c
index 9f32d1353c..e2b7c17e4c 100644
--- a/source3/lib/ctdb_dummy.c
+++ b/source3/lib/ctdb_dummy.c
@@ -59,6 +59,11 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
return NT_STATUS_NOT_IMPLEMENTED;
}
+const char *lp_ctdbd_socket(void)
+{
+ return "";
+}
+
bool ctdb_serverids_exist_supported(struct ctdbd_connection *conn)
{
return false;
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 94d19c744d..ae4f7bbfba 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -194,6 +194,18 @@ uint32_t ctdbd_vnn(const struct ctdbd_connection *conn)
return conn->our_vnn;
}
+const char *lp_ctdbd_socket(void)
+{
+ const char *ret;
+
+ ret = lp__ctdbd_socket();
+ if (ret != NULL && strlen(ret) > 0) {
+ return ret;
+ }
+
+ return CTDB_PATH;
+}
+
/*
* Get us a ctdb connection
*/
diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
index 3c8756b0bc..021ebc3980 100644
--- a/source3/lib/dbwrap/dbwrap_open.c
+++ b/source3/lib/dbwrap/dbwrap_open.c
@@ -26,9 +26,7 @@
#include "dbwrap/dbwrap_ctdb.h"
#include "lib/param/param.h"
#include "util_tdb.h"
-#ifdef CLUSTER_SUPPORT
-#include "ctdb_private.h"
-#endif
+#include "ctdbd_conn.h"
bool db_is_local(const char *name)
{
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 05657591e4..ad879725b4 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -78,10 +78,6 @@
#include <cups/http.h>
#endif
-#ifdef CLUSTER_SUPPORT
-#include "ctdb_private.h"
-#endif
-
bool bLoaded = false;
extern userdom_struct current_user_info;
@@ -934,11 +930,7 @@ static void init_globals(bool reinit_globals)
string_set(&Globals.cups_server, "");
string_set(&Globals.iprint_server, "");
-#ifdef CLUSTER_SUPPORT
- string_set(&Globals.ctdbd_socket, CTDB_PATH);
-#else
- string_set(&Globals.ctdbd_socket, "");
-#endif
+ string_set(&Globals._ctdbd_socket, "");
Globals.cluster_addresses = NULL;
Globals.clustering = false;
diff --git a/source3/torture/test_ctdbconn.c b/source3/torture/test_ctdbconn.c
index 7b30288acc..d8f744c24b 100644
--- a/source3/torture/test_ctdbconn.c
+++ b/source3/torture/test_ctdbconn.c
@@ -23,6 +23,7 @@
#ifdef CLUSTER_SUPPORT
#include "ctdb_conn.h"
+#include "ctdbd_conn.h"
#include "lib/util/tevent_unix.h"
#include "tdb.h"