[SCM] Samba Shared Repository - branch master updated

Ira Cooper ira at samba.org
Wed Apr 22 08:38:04 MDT 2015


The branch, master has been updated
       via  464f4b9 param: remove two unused #defines
       via  40c9cc1 s3:param: remove arg save_defaults from lp_load_with_registry_shares()
       via  0e0d775 s3:param: remove arg initialize_globals from lp_load_with_registry_shares()
       via  55bf0d0 s3:param: rename arg initialize_globals->reinit_globals in lp_load()
       via  3a8952e s3:param: rename arg initialize_globals->reinit_globals in lp_load_ex()
       via  8b7acbb s3:param: fix a comment
       via  af539f4 s3:param: use GLOBAL_SECTION_SNUM in lp_enforce_ad_dc_settings()
       via  3dbff67 s3:param: factor lp_enforce_ad_dc_settings() out of lp_load_ex()
       via  db60f1d s3:param: in lp_load_initial_only(), make sure to save defaults.
       via  5a7147a s3:param: make lp_load() static
       via  31392f6 vfstest: use lp_load_with_shares() in cmd_conf
       via  7af9d23 s3:param: use lp_load_no_reinit() in lp_load_for_s4_ctx()
       via  14c1e05 s3:param: add lp_load_no_reinit()
       via  526e376 s3:torture:msg: use lp_load()-wrapper lp_load_global()
       via  677fbce s4:torture:libnetapi: use lp_load_global() instead of lp_load()
       via  1f60ceed s3:param: remove "add_ipc" parameter from lp_load_with_registry_shares().
       via  97e8768 s3:param: remove "global_only" parameter from lp_load_with_registry_shares().
       via  696ce36 s3:auth: use lp_load_with_shares() in auth3_check_password()
       via  f1cdba2 s3:auth: use lp_load_with_shares() in auth3_generate_session_info_pac()
       via  d892ce2 nsswitch/wins: use lp_load_global() wrapper of lp_load().
       via  214ef25 s3:smbd: use lp_load_with_shares() in reload_services().
       via  df7677c s3:param: let lp_load_global_no_reinit() call lp_load() instead of lp_load_ex()
       via  79f8fd9 s3:param: add wrapper lp_load_with_shares().
       via  8f2c5fd s3:param: let lp_load_global() call lp_load(), not lp_load_ex().
       via  e197ddc s3:lsasd: use lp_load() wrapper lp_load_global()
       via  2f889f7 s3:spoolss: use lp_load() wrapper lp_load_global().
      from  5074cf8 Convert all uses of uint8/16/32 to uint8/16/32_t in the libads code.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 464f4b95c6c731cafa2cfab07912a20cfe6e928e
Author: Michael Adam <obnox at samba.org>
Date:   Wed Sep 24 10:30:17 2014 +0200

    param: remove two unused #defines
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>
    
    Autobuild-User(master): Ira Cooper <ira at samba.org>
    Autobuild-Date(master): Wed Apr 22 16:37:12 CEST 2015 on sn-devel-104

commit 40c9cc150ad99c468207f1762b0a2eaba9f03925
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 21 15:24:42 2015 +0200

    s3:param: remove arg save_defaults from lp_load_with_registry_shares()
    
    This is only used in command line contexts, especially for testparm
    which relies on safe defaults. The only changed use is in sharesec,
    but it does not harm to also safe the defaults there.
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 0e0d77519c27038b30fec92d542198e97be767d9
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 21 14:48:42 2015 +0200

    s3:param: remove arg initialize_globals from lp_load_with_registry_shares()
    
    This is only ever called in client context, and only called once.
    So there is no point at all in requesting reinit_globals.
    Set it to false.
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 55bf0d0a2b1f3c9bc43dcf7ab19380501b251f0a
Author: Michael Adam <obnox at samba.org>
Date:   Sat Sep 20 04:49:10 2014 +0200

    s3:param: rename arg initialize_globals->reinit_globals in lp_load()
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 3a8952e3e7e69ae5d8616da333b1977ee559f4b1
Author: Michael Adam <obnox at samba.org>
Date:   Sat Sep 20 04:48:11 2014 +0200

    s3:param: rename arg initialize_globals->reinit_globals in lp_load_ex()
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 8b7acbbc8087fce37449ed9c0b7c46bc22cc3542
Author: Michael Adam <obnox at samba.org>
Date:   Sat Sep 20 04:46:41 2014 +0200

    s3:param: fix a comment
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit af539f44a98ca16a24f7014f27cde742725b18c7
Author: Michael Adam <obnox at samba.org>
Date:   Sat Sep 20 04:45:45 2014 +0200

    s3:param: use GLOBAL_SECTION_SNUM in lp_enforce_ad_dc_settings()
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 3dbff676eaadb5140296b5ede7aba93a6d0311b7
Author: Michael Adam <obnox at samba.org>
Date:   Sat Sep 20 04:42:40 2014 +0200

    s3:param: factor lp_enforce_ad_dc_settings() out of lp_load_ex()
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit db60f1d9562f91fcb83c7e9f42915ec9b426abca
Author: Michael Adam <obnox at samba.org>
Date:   Wed Aug 6 16:20:42 2014 +0200

    s3:param: in lp_load_initial_only(), make sure to save defaults.
    
    This is the initial loading of the config in the daemons (and some tools).
    So we should save the defaults here. This should especially take into account
    some dynamic defaults like log file and maybe some changed values
    handed in via the command line.
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 5a7147a9d9f89073eb6347f6db9db21b7168ee24
Author: Michael Adam <obnox at samba.org>
Date:   Thu Sep 18 04:19:10 2014 +0200

    s3:param: make lp_load() static
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 31392f6df693e6685dcf2d4cb0de3e4fb1e9276e
Author: Michael Adam <obnox at samba.org>
Date:   Thu Sep 18 04:16:56 2014 +0200

    vfstest: use lp_load_with_shares() in cmd_conf
    
    Note this calls lp_load slightly differently.
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 7af9d238b5f36a48a7f1fe42f18837af817f41bd
Author: Michael Adam <obnox at samba.org>
Date:   Thu Sep 18 00:29:28 2014 +0200

    s3:param: use lp_load_no_reinit() in lp_load_for_s4_ctx()
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 14c1e05165c19e5048b8905f293a635343f74e9c
Author: Michael Adam <obnox at samba.org>
Date:   Thu Sep 18 00:28:50 2014 +0200

    s3:param: add lp_load_no_reinit()
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 526e3764582374e67a57cf86dd8ac63df28914cb
Author: Michael Adam <obnox at samba.org>
Date:   Tue Sep 9 23:22:50 2014 +0200

    s3:torture:msg: use lp_load()-wrapper lp_load_global()
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 677fbce270d69c9095935dc9c85274c9255f9b31
Author: Michael Adam <obnox at samba.org>
Date:   Thu Jul 31 00:42:01 2014 +0200

    s4:torture:libnetapi: use lp_load_global() instead of lp_load()
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 1f60ceedb88b6ed2c86bcfc79607f3e0967ed56a
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jul 30 17:47:32 2014 +0200

    s3:param: remove "add_ipc" parameter from lp_load_with_registry_shares().
    
    This is not called from the server (which loads registry shares lazily),
    so add_ipc is always false...
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 97e87681b33a46f1309a200345e188a0e27388a7
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jul 30 17:30:22 2014 +0200

    s3:param: remove "global_only" parameter from lp_load_with_registry_shares().
    
    There is no point in choosing global_only when forcing to load
    all shares from registry at the same time...
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 696ce368bd2507bc7d6612063adbf4023a7d312e
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jul 30 17:00:36 2014 +0200

    s3:auth: use lp_load_with_shares() in auth3_check_password()
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit f1cdba23a8f4658406ab556aff851bf5dbc65217
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jul 30 16:59:50 2014 +0200

    s3:auth: use lp_load_with_shares() in auth3_generate_session_info_pac()
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit d892ce27506c4c36a64b6a97a0cbcd9af14aefd7
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jul 30 16:57:06 2014 +0200

    nsswitch/wins: use lp_load_global() wrapper of lp_load().
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 214ef25235eb51834675e0fd3ed0052aa171c40f
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jul 30 16:53:59 2014 +0200

    s3:smbd: use lp_load_with_shares() in reload_services().
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit df7677cf7dc4309548023cabc349f658c7903b72
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jul 30 16:52:06 2014 +0200

    s3:param: let lp_load_global_no_reinit() call lp_load() instead of lp_load_ex()
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 79f8fd94c55e5686f8e7d0897d1b15c8003b4ace
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jul 30 16:50:48 2014 +0200

    s3:param: add wrapper lp_load_with_shares().
    
    Most common pattern with shares, including IPC,
    but not forcing immediate loading of all registry shares.
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 8f2c5fd84fb8d30db7e9ffe7cbfd8f3e0c49c1fd
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jul 30 16:47:40 2014 +0200

    s3:param: let lp_load_global() call lp_load(), not lp_load_ex().
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit e197ddcfa62b4aa1e9930e65e1bc436ff5a467f7
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jul 30 16:43:05 2014 +0200

    s3:lsasd: use lp_load() wrapper lp_load_global()
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 2f889f7951b7ef1b60a826d42c9a113860e245a2
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jul 30 16:41:22 2014 +0200

    s3:spoolss: use lp_load() wrapper lp_load_global().
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/param/loadparm.c                  |   3 -
 nsswitch/wins.c                       |   2 +-
 source3/auth/auth_generic.c           |   2 +-
 source3/auth/auth_ntlmssp.c           |   2 +-
 source3/include/proto.h               |  13 +---
 source3/param/loadparm.c              | 123 ++++++++++++++++++++--------------
 source3/param/loadparm_ctx.c          |   2 +-
 source3/param/test_lp_load.c          |   7 +-
 source3/printing/spoolssd.c           |   2 +-
 source3/rpc_server/lsasd.c            |   4 +-
 source3/smbd/server_reload.c          |   6 +-
 source3/torture/msg_source.c          |   2 +-
 source3/torture/vfstest.c             |   2 +-
 source3/utils/sharesec.c              |   3 +-
 source3/utils/testparm.c              |   2 +-
 source4/torture/libnetapi/libnetapi.c |   2 +-
 16 files changed, 91 insertions(+), 86 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index ddb806a..34974d7 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -140,9 +140,6 @@ static const char *lpcfg_string(const char *s)
 /* this global context supports the lp_*() function varients */
 static struct loadparm_context *global_loadparm_context;
 
-#define lpcfg_default_service global_loadparm_context->sDefault
-#define lpcfg_global_service(i) global_loadparm_context->services[i]
-
 #define FN_GLOBAL_STRING(fn_name,var_name) \
  _PUBLIC_ char *lpcfg_ ## fn_name(struct loadparm_context *lp_ctx, TALLOC_CTX *ctx) {\
 	 if (lp_ctx == NULL) return NULL;				\
diff --git a/nsswitch/wins.c b/nsswitch/wins.c
index a0790cf..735a9a2 100644
--- a/nsswitch/wins.c
+++ b/nsswitch/wins.c
@@ -52,7 +52,7 @@ static void nss_wins_init(void)
 
 	TimeInit();
 	setup_logging("nss_wins",False);
-	lp_load(get_dyn_CONFIGFILE(),True,False,False,True);
+	lp_load_global(get_dyn_CONFIGFILE());
 	load_interfaces();
 }
 
diff --git a/source3/auth/auth_generic.c b/source3/auth/auth_generic.c
index 1da4961..584b52f 100644
--- a/source3/auth/auth_generic.c
+++ b/source3/auth/auth_generic.c
@@ -116,7 +116,7 @@ static NTSTATUS auth3_generate_session_info_pac(struct auth4_context *auth_ctx,
 	sub_set_smb_name(username);
 
 	/* reload services so that the new %U is taken into account */
-	lp_load(get_dyn_CONFIGFILE(), false, false, true, true);
+	lp_load_with_shares(get_dyn_CONFIGFILE());
 
 	status = make_session_info_krb5(mem_ctx,
 					ntuser, ntdomain, username, pw,
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c
index 14bce62..ef83451 100644
--- a/source3/auth/auth_ntlmssp.c
+++ b/source3/auth/auth_ntlmssp.c
@@ -155,7 +155,7 @@ NTSTATUS auth3_check_password(struct auth4_context *auth4_context,
 	/* sub_set_smb_name checks for weird internally */
 	sub_set_smb_name(user_info->client.account_name);
 
-	lp_load(get_dyn_CONFIGFILE(), false, false, true, true);
+	lp_load_with_shares(get_dyn_CONFIGFILE());
 
 	nt_status = make_user_info_map(talloc_tos(),
                                        &mapped_user_info,
diff --git a/source3/include/proto.h b/source3/include/proto.h
index c66283b..4acad41 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1056,21 +1056,14 @@ int load_usershare_service(const char *servicename);
 int load_usershare_shares(struct smbd_server_connection *sconn,
 			  bool (*snumused) (struct smbd_server_connection *, int));
 void gfree_loadparm(void);
-bool lp_load(const char *pszFname,
-	     bool global_only,
-	     bool save_defaults,
-	     bool add_ipc,
-	     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_no_reinit(const char *file_name);
 bool lp_load_client_no_reinit(const char *file_name);
-bool lp_load_with_registry_shares(const char *pszFname,
-				  bool global_only,
-				  bool save_defaults,
-				  bool add_ipc,
-				  bool initialize_globals);
+bool lp_load_with_registry_shares(const char *pszFname);
 int lp_numservices(void);
 void lp_dump(FILE *f, bool show_defaults, int maxtoprint);
 void lp_dump_one(FILE * f, bool show_defaults, int snum);
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index a6b3b45..b53cae2 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -3627,6 +3627,22 @@ static bool lp_is_in_client(void)
     return in_client;
 }
 
+static void lp_enforce_ad_dc_settings(void)
+{
+	lp_do_parameter(GLOBAL_SECTION_SNUM, "passdb backend", "samba_dsdb");
+	lp_do_parameter(GLOBAL_SECTION_SNUM,
+			"winbindd:use external pipes", "true");
+	lp_do_parameter(GLOBAL_SECTION_SNUM, "rpc_server:default", "external");
+	lp_do_parameter(GLOBAL_SECTION_SNUM, "rpc_server:svcctl", "embedded");
+	lp_do_parameter(GLOBAL_SECTION_SNUM, "rpc_server:srvsvc", "embedded");
+	lp_do_parameter(GLOBAL_SECTION_SNUM, "rpc_server:eventlog", "embedded");
+	lp_do_parameter(GLOBAL_SECTION_SNUM, "rpc_server:ntsvcs", "embedded");
+	lp_do_parameter(GLOBAL_SECTION_SNUM, "rpc_server:winreg", "embedded");
+	lp_do_parameter(GLOBAL_SECTION_SNUM, "rpc_server:spoolss", "embedded");
+	lp_do_parameter(GLOBAL_SECTION_SNUM, "rpc_daemon:spoolssd", "embedded");
+	lp_do_parameter(GLOBAL_SECTION_SNUM, "rpc_server:tcpip", "no");
+}
+
 /***************************************************************************
  Load the services array from the services file. Return true on success,
  false on failure.
@@ -3636,7 +3652,7 @@ static bool lp_load_ex(const char *pszFname,
 		       bool global_only,
 		       bool save_defaults,
 		       bool add_ipc,
-		       bool initialize_globals,
+		       bool reinit_globals,
 		       bool allow_include_registry,
 		       bool load_all_shares)
 {
@@ -3655,7 +3671,7 @@ static bool lp_load_ex(const char *pszFname,
 
 	lp_ctx = setup_lp_context(talloc_tos());
 
-	init_globals(lp_ctx, initialize_globals);
+	init_globals(lp_ctx, reinit_globals);
 
 	free_file_list();
 
@@ -3664,7 +3680,7 @@ static bool lp_load_ex(const char *pszFname,
 		lp_save_defaults();
 	}
 
-	if (!initialize_globals) {
+	if (!reinit_globals) {
 		free_param_opts(&Globals.param_opt);
 		apply_lp_set_cmdline();
 	}
@@ -3715,7 +3731,7 @@ static bool lp_load_ex(const char *pszFname,
 
 			lp_kill_all_services();
 			ok = lp_load_ex(pszFname, global_only, save_defaults,
-					add_ipc, initialize_globals,
+					add_ipc, reinit_globals,
 					allow_include_registry,
 					load_all_shares);
 			TALLOC_FREE(frame);
@@ -3774,23 +3790,11 @@ static bool lp_load_ex(const char *pszFname,
 	/*
 	 * We run this check once the whole smb.conf is parsed, to
 	 * force some settings for the standard way a AD DC is
-	 * operated.  We may changed these as our code evolves, which
+	 * operated.  We may change these as our code evolves, which
 	 * is why we force these settings.
 	 */
 	if (lp_server_role() == ROLE_ACTIVE_DIRECTORY_DC) {
-		lp_do_parameter(-1, "passdb backend", "samba_dsdb");
-
-		lp_do_parameter(-1, "winbindd:use external pipes", "true");
-
-		lp_do_parameter(-1, "rpc_server:default", "external");
-		lp_do_parameter(-1, "rpc_server:svcctl", "embedded");
-		lp_do_parameter(-1, "rpc_server:srvsvc", "embedded");
-		lp_do_parameter(-1, "rpc_server:eventlog", "embedded");
-		lp_do_parameter(-1, "rpc_server:ntsvcs", "embedded");
-		lp_do_parameter(-1, "rpc_server:winreg", "embedded");
-		lp_do_parameter(-1, "rpc_server:spoolss", "embedded");
-		lp_do_parameter(-1, "rpc_daemon:spoolssd", "embedded");
-		lp_do_parameter(-1, "rpc_server:tcpip", "no");
+		lp_enforce_ad_dc_settings();
 	}
 
 	bAllowIncludeRegistry = true;
@@ -3799,17 +3803,17 @@ static bool lp_load_ex(const char *pszFname,
 	return (bRetval);
 }
 
-bool lp_load(const char *pszFname,
-	     bool global_only,
-	     bool save_defaults,
-	     bool add_ipc,
-	     bool initialize_globals)
+static bool lp_load(const char *pszFname,
+		    bool global_only,
+		    bool save_defaults,
+		    bool add_ipc,
+		    bool reinit_globals)
 {
 	return lp_load_ex(pszFname,
 			  global_only,
 			  save_defaults,
 			  add_ipc,
-			  initialize_globals,
+			  reinit_globals,
 			  true,   /* allow_include_registry */
 			  false); /* load_all_shares*/
 }
@@ -3818,9 +3822,9 @@ bool lp_load_initial_only(const char *pszFname)
 {
 	return lp_load_ex(pszFname,
 			  true,   /* global only */
-			  false,  /* save_defaults */
+			  true,   /* save_defaults */
 			  false,  /* add_ipc */
-			  true,   /* initialize_globals */
+			  true,   /* reinit_globals */
 			  false,  /* allow_include_registry */
 			  false); /* load_all_shares*/
 }
@@ -3830,13 +3834,25 @@ bool lp_load_initial_only(const char *pszFname)
  */
 bool lp_load_global(const char *file_name)
 {
-	return lp_load_ex(file_name,
-			  true,   /* global_only */
-			  false,  /* save_defaults */
-			  false,  /* add_ipc */
-			  true,   /* initialize_globals */
-			  true,   /* allow_include_registry */
-			  false); /* load_all_shares*/
+	return lp_load(file_name,
+		       true,   /* global_only */
+		       false,  /* save_defaults */
+		       false,  /* add_ipc */
+		       true);  /* reinit_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);  /* reinit_globals */
 }
 
 /**
@@ -3856,15 +3872,28 @@ bool lp_load_client(const char *file_name)
  */
 bool lp_load_global_no_reinit(const char *file_name)
 {
-	return lp_load_ex(file_name,
-			  true,   /* global_only */
-			  false,  /* save_defaults */
-			  false,  /* add_ipc */
-			  false,  /* initialize_globals */
-			  true,   /* allow_include_registry */
-			  false); /* load_all_shares*/
+	return lp_load(file_name,
+		       true,   /* global_only */
+		       false,  /* save_defaults */
+		       false,  /* add_ipc */
+		       false); /* reinit_globals */
+}
+
+/**
+ * lp_load wrapper, loading globals and shares,
+ * intended for subsequent calls, i.e. not reinitializing
+ * the globals to default values.
+ */
+bool lp_load_no_reinit(const char *file_name)
+{
+	return lp_load(file_name,
+		       false,  /* global_only */
+		       false,  /* save_defaults */
+		       false,  /* add_ipc */
+		       false); /* reinit_globals */
 }
 
+
 /**
  * lp_load wrapper, especially for clients, no reinitialization
  */
@@ -3875,17 +3904,13 @@ bool lp_load_client_no_reinit(const char *file_name)
 	return lp_load_global_no_reinit(file_name);
 }
 
-bool lp_load_with_registry_shares(const char *pszFname,
-				  bool global_only,
-				  bool save_defaults,
-				  bool add_ipc,
-				  bool initialize_globals)
+bool lp_load_with_registry_shares(const char *pszFname)
 {
 	return lp_load_ex(pszFname,
-			  global_only,
-			  save_defaults,
-			  add_ipc,
-			  initialize_globals,
+			  false, /* global_only */
+			  true,  /* save_defaults */
+			  false, /* add_ipc */
+			  false, /* reinit_globals */
 			  true,  /* allow_include_registry */
 			  true); /* load_all_shares*/
 }
diff --git a/source3/param/loadparm_ctx.c b/source3/param/loadparm_ctx.c
index fdad041..645b787 100644
--- a/source3/param/loadparm_ctx.c
+++ b/source3/param/loadparm_ctx.c
@@ -50,7 +50,7 @@ static bool lp_load_for_s4_ctx(const char *filename)
 	bool status;
 
 	mem_ctx = talloc_stackframe();
-	status =  lp_load(filename, false, false, false, false);
+	status =  lp_load_no_reinit(filename);
 	talloc_free(mem_ctx);
 
 	return status;
diff --git a/source3/param/test_lp_load.c b/source3/param/test_lp_load.c
index 45427ce..fb3b95d 100644
--- a/source3/param/test_lp_load.c
+++ b/source3/param/test_lp_load.c
@@ -61,12 +61,7 @@ int main(int argc, const char **argv)
 
 	for (i=0; i < count; i++) {
 		printf("call lp_load() #%d: ", i+1);
-		if (!lp_load_with_registry_shares(config_file,
-						  False, /* global only */
-						  True,  /* save defaults */
-						  False, /*add_ipc */
-						  True)) /*init globals */
-		{
+		if (!lp_load_with_registry_shares(config_file)) {
 			printf("ERROR.\n");
 			ret = 1;
 			goto done;
diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c
index b850578..11bd82f 100644
--- a/source3/printing/spoolssd.c
+++ b/source3/printing/spoolssd.c
@@ -107,7 +107,7 @@ static void update_conf(struct tevent_context *ev,
 			struct messaging_context *msg)
 {
 	change_to_root_user();
-	lp_load(get_dyn_CONFIGFILE(), true, false, false, true);
+	lp_load_global(get_dyn_CONFIGFILE());
 	load_printers(ev, msg);
 
 	spoolss_reopen_logs(spoolss_child_id);
diff --git a/source3/rpc_server/lsasd.c b/source3/rpc_server/lsasd.c
index 375f409..42d91fd 100644
--- a/source3/rpc_server/lsasd.c
+++ b/source3/rpc_server/lsasd.c
@@ -116,7 +116,7 @@ static void lsasd_smb_conf_updated(struct messaging_context *msg,
 	ev_ctx = talloc_get_type_abort(private_data, struct tevent_context);
 
 	change_to_root_user();
-	lp_load(get_dyn_CONFIGFILE(), true, false, false, true);
+	lp_load_global(get_dyn_CONFIGFILE());
 
 	lsasd_reopen_logs(lsasd_child_id);
 	if (lsasd_child_id == 0) {
@@ -166,7 +166,7 @@ static void lsasd_sig_hup_handler(struct tevent_context *ev,
 {
 
 	change_to_root_user();
-	lp_load(get_dyn_CONFIGFILE(), true, false, false, true);
+	lp_load_global(get_dyn_CONFIGFILE());
 
 	lsasd_reopen_logs(lsasd_child_id);
 	pfh_daemon_config(DAEMON_NAME,
diff --git a/source3/smbd/server_reload.c b/source3/smbd/server_reload.c
index e1b62d1..c93c077 100644
--- a/source3/smbd/server_reload.c
+++ b/source3/smbd/server_reload.c
@@ -143,11 +143,7 @@ bool reload_services(struct smbd_server_connection *sconn,
 
 	lp_killunused(sconn, snumused);
 
-	ret = lp_load(get_dyn_CONFIGFILE(),
-		      false, /* global only */
-		      false, /* save defaults */
-		      true,  /* add_ipc */
-		      true); /* initialize globals */
+	ret = lp_load_with_shares(get_dyn_CONFIGFILE());
 
 	/* perhaps the config filename is now set */
 	if (!test) {
diff --git a/source3/torture/msg_source.c b/source3/torture/msg_source.c
index e1974c2..293b099 100644
--- a/source3/torture/msg_source.c
+++ b/source3/torture/msg_source.c
@@ -117,7 +117,7 @@ int main(int argc, const char *argv[])
 		return -1;
 	}
 
-	lp_load(get_dyn_CONFIGFILE(), true, false, false, true);
+	lp_load_global(get_dyn_CONFIGFILE());
 
 	ev = tevent_context_init(frame);
 	if (ev == NULL) {
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c
index 2cca2a4..b6ef2f2 100644
--- a/source3/torture/vfstest.c
+++ b/source3/torture/vfstest.c
@@ -127,7 +127,7 @@ static NTSTATUS cmd_conf(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
 		return NT_STATUS_OK;
 	}
 
-	if (!lp_load(argv[1], False, True, False, True)) {
+	if (!lp_load_with_shares(argv[1])) {
 		printf("Error loading \"%s\"\n", argv[1]);
 		return NT_STATUS_OK;
 	}
diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c
index ff5400e..132ca7e 100644
--- a/source3/utils/sharesec.c
+++ b/source3/utils/sharesec.c
@@ -599,8 +599,7 @@ int main(int argc, const char *argv[])
 
 	setlinebuf(stdout);
 
-	lp_load_with_registry_shares( get_dyn_CONFIGFILE(), False, False, False,
-				      True );
+	lp_load_with_registry_shares(get_dyn_CONFIGFILE());
 
 	/* check for initializing secrets.tdb first */
 
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index 9499f86..7850b43 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -491,7 +491,7 @@ static void do_per_share_checks(int s)
 
 	fprintf(stderr,"Load smb config files from %s\n",config_file);
 
-	if (!lp_load_with_registry_shares(config_file,False,True,False,True)) {
+	if (!lp_load_with_registry_shares(config_file)) {
 		fprintf(stderr,"Error loading services.\n");
 		ret = 1;
 		goto done;
diff --git a/source4/torture/libnetapi/libnetapi.c b/source4/torture/libnetapi/libnetapi.c
index 431b531..2a443ec 100644
--- a/source4/torture/libnetapi/libnetapi.c
+++ b/source4/torture/libnetapi/libnetapi.c
@@ -33,7 +33,7 @@ bool torture_libnetapi_init_context(struct torture_context *tctx,
 	struct libnetapi_ctx *ctx;
 	TALLOC_CTX *frame = talloc_stackframe();
 
-	if (!lp_load(lpcfg_configfile(tctx->lp_ctx), true, false, false, true)) {
+	if (!lp_load_global(lpcfg_configfile(tctx->lp_ctx))) {
 		fprintf(stderr, "error loading %s\n", lpcfg_configfile(tctx->lp_ctx));
 		talloc_free(frame);
 		return W_ERROR_V(WERR_GENERAL_FAILURE);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list