*/
#include "includes.h"
-#include "smbconf_private.h"
+#include "lib/smbconf/smbconf_private.h"
#define INCLUDES_VALNAME "includes"
if (!W_ERROR_IS_OK(werr)) {
DEBUG(5, ("Error opening registry path '%s': %s\n",
- path, dos_errstr(werr)));
+ path, win_errstr(werr)));
}
done:
werr = smbconf_reg_open_path(mem_ctx, ctx, path, desired_access, key);
done:
- TALLOC_FREE(path);
+ talloc_free(path);
return werr;
}
ret = true;
}
- TALLOC_FREE(ctx);
+ talloc_free(ctx);
return ret;
}
}
if (!W_ERROR_IS_OK(werr)) {
DEBUG(5, ("Error creating key %s: %s\n",
- subkeyname, dos_errstr(werr)));
+ subkeyname, win_errstr(werr)));
}
done:
- TALLOC_FREE(create_ctx);
+ talloc_free(create_ctx);
return werr;
}
if (!W_ERROR_IS_OK(werr)) {
DEBUG(5, ("Error adding value '%s' to "
"key '%s': %s\n",
- canon_valname, key->key->name, dos_errstr(werr)));
+ canon_valname, key->key->name, win_errstr(werr)));
}
done:
werr = reg_setvalue(key, valname, value);
if (!W_ERROR_IS_OK(werr)) {
DEBUG(5, ("Error adding value '%s' to key '%s': %s\n",
- valname, key->key->name, dos_errstr(werr)));
+ valname, key->key->name, win_errstr(werr)));
}
done:
- TALLOC_FREE(tmp_ctx);
+ talloc_free(tmp_ctx);
return werr;
}
}
done:
- TALLOC_FREE(tmp_ctx);
+ talloc_free(tmp_ctx);
return werr;
}
}
done:
- TALLOC_FREE(tmp_ctx);
+ talloc_free(tmp_ctx);
return werr;
}
DEBUG(1, ("smbconf_reg_delete_values: "
"Error enumerating values of %s: %s\n",
key->key->name,
- dos_errstr(werr)));
+ win_errstr(werr)));
goto done;
}
werr = WERR_OK;
done:
- TALLOC_FREE(mem_ctx);
+ talloc_free(mem_ctx);
return werr;
}
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 bool smbconf_reg_is_writeable(struct smbconf_ctx *ctx)
+{
+ /*
+ * The backend has write support.
+ *
+ * TODO: add access checks whether the concrete
+ * config source is really writeable by the calling user.
+ */
+ return true;
+}
+
static WERROR smbconf_reg_open(struct smbconf_ctx *ctx)
{
WERROR werr;
&new_key, &action);
done:
- TALLOC_FREE(mem_ctx);
+ talloc_free(mem_ctx);
return werr;
}
}
done:
- TALLOC_FREE(tmp_ctx);
+ talloc_free(tmp_ctx);
return werr;
}
ret = true;
}
- TALLOC_FREE(mem_ctx);
+ talloc_free(mem_ctx);
return ret;
}
servicename, &key);
}
- TALLOC_FREE(mem_ctx);
+ talloc_free(mem_ctx);
return werr;
}
werr = smbconf_reg_open_service_key(tmp_ctx, ctx, servicename,
REG_KEY_READ, &key);
if (!W_ERROR_IS_OK(werr)) {
+ if (W_ERROR_EQUAL(werr, WERR_BADFILE)) {
+ werr = WERR_NO_SUCH_SERVICE;
+ }
goto done;
}
}
done:
- TALLOC_FREE(tmp_ctx);
+ talloc_free(tmp_ctx);
return werr;
}
}
done:
- TALLOC_FREE(mem_ctx);
+ talloc_free(mem_ctx);
return werr;
}
werr = smbconf_reg_set_value(key, param, valstr);
done:
- TALLOC_FREE(mem_ctx);
+ talloc_free(mem_ctx);
return werr;
}
}
done:
- TALLOC_FREE(key);
- TALLOC_FREE(value);
+ talloc_free(key);
+ talloc_free(value);
return werr;
}
werr = reg_deletevalue(key, param);
done:
- TALLOC_FREE(mem_ctx);
+ talloc_free(mem_ctx);
return werr;
}
includes);
done:
- TALLOC_FREE(tmp_ctx);
+ talloc_free(tmp_ctx);
return werr;
}
}
done:
- TALLOC_FREE(tmp_ctx);
+ talloc_free(tmp_ctx);
return werr;
}
done:
- TALLOC_FREE(tmp_ctx);
+ talloc_free(tmp_ctx);
return werr;
}
struct smbconf_ops smbconf_ops_reg = {
.init = smbconf_reg_init,
.shutdown = smbconf_reg_shutdown,
+ .requires_messaging = smbconf_reg_requires_messaging,
+ .is_writeable = smbconf_reg_is_writeable,
.open_conf = smbconf_reg_open,
.close_conf = smbconf_reg_close,
.get_csn = smbconf_reg_get_csn,