summaryrefslogtreecommitdiff
path: root/source3/param
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-05-15 02:15:20 +0200
committerMichael Adam <obnox@samba.org>2008-05-15 02:42:40 +0200
commit86766b522018973e1c5e37b45e8b5b01dbcbd202 (patch)
tree89cd411975a8884eba2a0a8f12e6767588d38cc5 /source3/param
parent8cb4461044d3020736d985012e4beb9c5db358ad (diff)
downloadsamba-86766b522018973e1c5e37b45e8b5b01dbcbd202.tar.gz
samba-86766b522018973e1c5e37b45e8b5b01dbcbd202.tar.bz2
samba-86766b522018973e1c5e37b45e8b5b01dbcbd202.zip
loadparm: add a function process_registry_shares()
This loads the shares defined in registry into the services array. Michael (This used to be commit b3a90b72517c2e25d972796908aec4d2b85a030e)
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/loadparm.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 5774b22795..9eee1691a8 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -6568,6 +6568,43 @@ done:
return ret;
}
+static bool process_registry_shares(void)
+{
+ WERROR werr;
+ uint32_t count;
+ struct smbconf_service **service = NULL;
+ uint32_t num_shares = 0;
+ TALLOC_CTX *mem_ctx = talloc_stackframe();
+ struct smbconf_ctx *conf_ctx = lp_smbconf_ctx();
+ bool ret = false;
+
+ if (conf_ctx == NULL) {
+ goto done;
+ }
+
+ werr = smbconf_get_config(conf_ctx, mem_ctx, &num_shares, &service);
+ if (!W_ERROR_IS_OK(werr)) {
+ goto done;
+ }
+
+ for (count = 0; count < num_shares; count++) {
+ if (strequal(service[count]->name, GLOBAL_NAME)) {
+ continue;
+ }
+ ret = process_registry_service(service[count]);
+ if (!ret) {
+ goto done;
+ }
+ }
+
+ /* store the csn */
+ smbconf_changed(conf_ctx, &conf_last_csn, NULL, NULL);
+
+done:
+ TALLOC_FREE(mem_ctx);
+ return ret;
+}
+
static struct file_lists {
struct file_lists *next;
char *name;