s3:param: add wrapper lp_load_with_shares().
authorMichael Adam <obnox@samba.org>
Wed, 30 Jul 2014 14:50:48 +0000 (16:50 +0200)
committerIra Cooper <ira@samba.org>
Wed, 22 Apr 2015 11:57:29 +0000 (13:57 +0200)
Most common pattern with shares, including IPC,
but not forcing immediate loading of all registry shares.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
source3/include/proto.h
source3/param/loadparm.c

index c66283b9066fbe4c68ccb27961170214796664ba..89e6429fca291c84c7b01d9b39b64f970b211f72 100644 (file)
@@ -1063,6 +1063,7 @@ bool lp_load(const char *pszFname,
             bool initialize_globals);
 bool lp_load_initial_only(const char *pszFname);
 bool lp_load_global(const char *file_name);
+bool lp_load_with_shares(const char *file_name);
 bool lp_load_client(const char *file_name);
 bool lp_load_global_no_reinit(const char *file_name);
 bool lp_load_client_no_reinit(const char *file_name);
index 6059f038cd658e170024481e5f2a0dc652548166..2b0bfee9958d3571bfe231ab34f91df6e8ec6a41 100644 (file)
@@ -3837,6 +3837,20 @@ bool lp_load_global(const char *file_name)
                       true);  /* initialize_globals */
 }
 
+/**
+ * The typical lp_load wrapper with shares, loads global and
+ * shares, including IPC, but does not force immediate
+ * loading of all shares from registry.
+ */
+bool lp_load_with_shares(const char *file_name)
+{
+       return lp_load(file_name,
+                      false,  /* global_only */
+                      false,  /* save_defaults */
+                      true,   /* add_ipc */
+                      true);  /* initialize_globals */
+}
+
 /**
  * lp_load wrapper, especially for clients
  */