*
**********************************************************************/
+/**
+ * Tell whether the backend requires messaging to be set up
+ * for the backend to work correctly.
+ */
+bool smbconf_backend_requires_messaging(struct smbconf_ctx *ctx)
+{
+ return ctx->ops->requires_messaging(ctx);
+}
+
/**
* Close the configuration.
*/
/*
* the smbconf API functions
*/
+bool smbconf_backend_requires_messaging(struct smbconf_ctx *ctx);
void smbconf_shutdown(struct smbconf_ctx *ctx);
bool smbconf_changed(struct smbconf_ctx *ctx, struct smbconf_csn *csn,
const char *service, const char *param);
struct smbconf_ops {
WERROR (*init)(struct smbconf_ctx *ctx, const char *path);
int (*shutdown)(struct smbconf_ctx *ctx);
+ bool (*requires_messaging)(struct smbconf_ctx *ctx);
WERROR (*open_conf)(struct smbconf_ctx *ctx);
int (*close_conf)(struct smbconf_ctx *ctx);
void (*get_csn)(struct smbconf_ctx *ctx, struct smbconf_csn *csn,
return ctx->ops->close_conf(ctx);
}
+static bool smbconf_reg_requires_messaging(struct smbconf_ctx *ctx)
+{
+#ifdef CLUSTER_SUPPORT
+ if (lp_clustering() && lp_parm_bool(-1, "ctdb", "registry.tdb", true)) {
+ return true;
+ }
+#endif
+ return false;
+}
+
static WERROR smbconf_reg_open(struct smbconf_ctx *ctx)
{
WERROR werr;
struct smbconf_ops smbconf_ops_reg = {
.init = smbconf_reg_init,
.shutdown = smbconf_reg_shutdown,
+ .requires_messaging = smbconf_reg_requires_messaging,
.open_conf = smbconf_reg_open,
.close_conf = smbconf_reg_close,
.get_csn = smbconf_reg_get_csn,
return ctx->ops->close_conf(ctx);
}
+static bool smbconf_txt_requires_messaging(struct smbconf_ctx *ctx)
+{
+ return false;
+}
+
static WERROR smbconf_txt_open(struct smbconf_ctx *ctx)
{
return smbconf_txt_load_file(ctx);
static struct smbconf_ops smbconf_ops_txt = {
.init = smbconf_txt_init,
.shutdown = smbconf_txt_shutdown,
+ .requires_messaging = smbconf_txt_requires_messaging,
.open_conf = smbconf_txt_open,
.close_conf = smbconf_txt_close,
.get_csn = smbconf_txt_get_csn,