return werr;
}
+
+
+WERROR smbconf_delete_includes(struct smbconf_ctx *ctx, const char *service)
+{
+ if (!smbconf_share_exists(ctx, service)) {
+ return WERR_NO_SUCH_SERVICE;
+ }
+
+ return ctx->ops->delete_includes(ctx, service);
+}
+
+WERROR smbconf_delete_global_includes(struct smbconf_ctx *ctx)
+{
+ WERROR werr;
+
+ werr = smbconf_global_check(ctx);
+ if (W_ERROR_IS_OK(werr)) {
+ werr = smbconf_delete_includes(ctx, GLOBAL_NAME);
+ }
+
+ return werr;
+}
WERROR smbconf_set_global_includes(struct smbconf_ctx *ctx,
uint32_t num_includes,
const char **includes);
+WERROR smbconf_delete_includes(struct smbconf_ctx *ctx, const char *service);
+WERROR smbconf_delete_global_includes(struct smbconf_ctx *ctx);
#endif /* _LIBSMBCONF_H_ */
WERROR (*set_includes)(struct smbconf_ctx *ctx,
const char *service,
uint32_t num_includes, const char **includes);
+ WERROR (*delete_includes)(struct smbconf_ctx *ctx,
+ const char *service);
};
struct smbconf_ctx {
return werr;
}
+static WERROR smbconf_reg_delete_includes(struct smbconf_ctx *ctx,
+ const char *service)
+{
+ WERROR werr = WERR_OK;
+ struct registry_key *key = NULL;
+ TALLOC_CTX *tmp_ctx = talloc_stackframe();
+
+ werr = smbconf_reg_open_service_key(tmp_ctx, ctx, service,
+ REG_KEY_ALL, &key);
+ if (!W_ERROR_IS_OK(werr)) {
+ goto done;
+ }
+
+ if (!smbconf_value_exists(key, INCLUDES_VALNAME)) {
+ goto done;
+ }
+
+ werr = reg_deletevalue(key, INCLUDES_VALNAME);
+
+
+done:
+ TALLOC_FREE(tmp_ctx);
+ return werr;
+}
struct smbconf_ops smbconf_ops_reg = {
.init = smbconf_reg_init,
.delete_parameter = smbconf_reg_delete_parameter,
.get_includes = smbconf_reg_get_includes,
.set_includes = smbconf_reg_set_includes,
+ .delete_includes = smbconf_reg_delete_includes,
};
return WERR_NOT_SUPPORTED;
}
+static WERROR smbconf_txt_delete_includes(struct smbconf_ctx *ctx,
+ const char *service)
+{
+ return WERR_NOT_SUPPORTED;
+}
+
+
static struct smbconf_ops smbconf_ops_txt = {
.init = smbconf_txt_init,
.shutdown = smbconf_txt_shutdown,
.delete_parameter = smbconf_txt_delete_parameter,
.get_includes = smbconf_txt_get_includes,
.set_includes = smbconf_txt_set_includes,
+ .delete_includes = smbconf_txt_delete_includes,
};