summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/lib/ctdbd_conn.c4
-rw-r--r--source3/lib/dbwrap/dbwrap_open.c8
-rw-r--r--source3/param/loadparm.c18
4 files changed, 18 insertions, 13 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index dae69b7501..035d87e321 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1293,6 +1293,7 @@ int lp_cups_encrypt(void);
char *lp_iprint_server(void);
int lp_cups_connection_timeout(void);
const char *lp_ctdbd_socket(void);
+const char *_lp_ctdbd_socket(void);
const char **lp_cluster_addresses(void);
bool lp_clustering(void);
int lp_ctdb_timeout(void);
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index ba51137915..096616038e 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -205,10 +205,6 @@ static NTSTATUS ctdbd_connect(TALLOC_CTX *mem_ctx,
int fd;
socklen_t salen;
- if (!sockname || !*sockname) {
- sockname = CTDB_PATH;
- }
-
fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (fd == -1) {
DEBUG(3, ("Could not create socket: %s\n", strerror(errno)));
diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
index 06ae7c6eff..9bf279b1d8 100644
--- a/source3/lib/dbwrap/dbwrap_open.c
+++ b/source3/lib/dbwrap/dbwrap_open.c
@@ -34,10 +34,6 @@ bool db_is_local(const char *name)
#ifdef CLUSTER_SUPPORT
const char *sockname = lp_ctdbd_socket();
- if(!sockname || !*sockname) {
- sockname = CTDB_PATH;
- }
-
if (lp_clustering() && socket_exist(sockname)) {
const char *partname;
/* ctdb only wants the file part of the name */
@@ -83,10 +79,6 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
#ifdef CLUSTER_SUPPORT
sockname = lp_ctdbd_socket();
- if(!sockname || !*sockname) {
- sockname = CTDB_PATH;
- }
-
if (lp_clustering()) {
const char *partname;
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index dbf47c0320..e781048d8e 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -78,6 +78,10 @@
#include <cups/http.h>
#endif
+#ifdef CLUSTER_SUPPORT
+#include "ctdb_private.h"
+#endif
+
bool bLoaded = false;
extern userdom_struct current_user_info;
@@ -5335,7 +5339,7 @@ int lp_cups_encrypt(void)
}
FN_GLOBAL_STRING(iprint_server, szIPrintServer)
FN_GLOBAL_INTEGER(cups_connection_timeout, cups_connection_timeout)
-FN_GLOBAL_CONST_STRING(ctdbd_socket, ctdbdSocket)
+static FN_GLOBAL_CONST_STRING(_ctdbd_socket, ctdbdSocket)
FN_GLOBAL_LIST(cluster_addresses, szClusterAddresses)
FN_GLOBAL_BOOL(clustering, clustering)
FN_GLOBAL_INTEGER(ctdb_timeout, ctdb_timeout)
@@ -9648,3 +9652,15 @@ int lp_server_role(void)
lp_domain_logons(),
lp_domain_master_true_or_auto());
}
+
+const char *lp_ctdbd_socket(void)
+{
+ const char *result = lp__ctdbd_socket();
+
+#ifdef CLUSTER_SUPPORT
+ if ((result == NULL) || (*result == '\0')) {
+ return CTDB_PATH;
+ }
+#endif
+ return result;
+}