summaryrefslogtreecommitdiff
path: root/source3/lib/smbconf/smbconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/smbconf/smbconf.c')
-rw-r--r--source3/lib/smbconf/smbconf.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source3/lib/smbconf/smbconf.c b/source3/lib/smbconf/smbconf.c
index e5a865a62b..86c1692574 100644
--- a/source3/lib/smbconf/smbconf.c
+++ b/source3/lib/smbconf/smbconf.c
@@ -60,6 +60,32 @@ bool smbconf_is_writeable(struct smbconf_ctx *ctx)
}
/**
+ * utitlity function:
+ * check whether a config source is writeable,
+ * given only the name of the config source.
+ */
+bool smbconf_is_writeable_bystring(const char *configsource)
+{
+ struct smbconf_ctx *conf_ctx;
+ WERROR err;
+ bool ret;
+ TALLOC_CTX *mem_ctx = talloc_stackframe;
+
+ err = smbconf_init_reg(mem_ctx, &conf_ctx, configsource);
+ if (!W_ERROR_IS_OK(err)) {
+ ret = false;
+ goto done;
+ }
+
+ ret = smbconf_is_writeable(conf_ctx);
+
+done:
+ smbconf_shutdown(conf_ctx);
+ TALLOC_FREE(mem_ctx);
+ return ret;
+}
+
+/**
* Close the configuration.
*/
void smbconf_shutdown(struct smbconf_ctx *ctx)