s3:loadparm: add reload_registry_shares() - reload only those shares already loaded...
authorMichael Adam <obnox@samba.org>
Fri, 22 Jul 2011 08:10:43 +0000 (10:10 +0200)
committerKarolin Seeger <kseeger@samba.org>
Fri, 29 Jul 2011 19:05:13 +0000 (21:05 +0200)
source3/param/loadparm.c

index 0a1a4b063f79d1c3441370a9a0071e675b0692b7..ed01c9b29f36a1d78edaf27dcc36c6165257a558 100644 (file)
@@ -7351,6 +7351,35 @@ done:
        return ret;
 }
 
+/**
+ * reload those shares from registry that are already
+ * activated in the services array.
+ */
+static bool reload_registry_shares(void)
+{
+       int i;
+       bool ret = true;
+
+       for (i = 0; i < iNumServices; i++) {
+               if (!VALID(i)) {
+                       continue;
+               }
+
+               if (ServicePtrs[i]->usershare == USERSHARE_VALID) {
+                       continue;
+               }
+
+               ret = process_registry_service(ServicePtrs[i]->szService);
+               if (!ret) {
+                       goto done;
+               }
+       }
+
+done:
+       return ret;
+}
+
+
 #define MAX_INCLUDE_DEPTH 100
 
 static uint8_t include_depth;