[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Thu Nov 15 19:34:03 MST 2012


The branch, master has been updated
       via  d7cab97 s3:param: make init_locals() static.
       via  3fc2c03 s3-param: Handle setting default AD DC per-share settings in init_locals()
      from  ace0909 s4:samba-tool: Fix samba-tool fsmo --role=schema

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


- Log -----------------------------------------------------------------
commit d7cab973fc3213ff777bff519eb001ae7d1c1bdc
Author: Michael Adam <obnox at samba.org>
Date:   Fri Nov 16 01:00:21 2012 +0100

    s3:param: make init_locals() static.
    
    it is only used in loadparm.c
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Fri Nov 16 03:33:34 CET 2012 on sn-devel-104

commit 3fc2c03ea3dcc36778e92115a0dbca42531bd4dd
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Nov 16 10:30:44 2012 +1100

    s3-param: Handle setting default AD DC per-share settings in init_locals()
    
    This function is helpfully called between when we finish processing
    the globals and when we start processing the individual shares.  This
    means that the "vfs objects" and other per-share settings we specify
    here become the defaults for (eg) [netlogon] and [sysvol] but the
    admin can override these on a per-share basis or (as we must in make
    test) for the whole server.
    
    This broke setting and fetching of group policy objects from Windows
    clients, since this setting was moved from fileserver.conf in
    8518dd6406c0132dfd8c44e084c2b39792974f2c, and wasn't found in 'make
    test' because we have to override the vfs objects to insert the
    xattr_tdb and fake_acl modules.
    
    Andrew Bartlett
    
    Reviewed-by: Michael Adam <obnox at samba.org>

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

Summary of changes:
 source3/include/proto.h  |    1 -
 source3/param/loadparm.c |   58 ++++++++++++++++++++++++++++++----------------
 2 files changed, 38 insertions(+), 21 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index 5f3d937..bcecde9 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1408,7 +1408,6 @@ void *lp_local_ptr_by_snum(int snum, struct parm_struct *parm);
 bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue);
 bool lp_set_cmdline(const char *pszParmName, const char *pszParmValue);
 bool lp_set_option(const char *option);
-void init_locals(void);
 bool lp_is_default(int snum, struct parm_struct *parm);
 bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal);
 struct parm_struct *lp_get_parameter(const char *param_name);
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 12cb8db..8ad0fc9 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -3469,12 +3469,41 @@ static bool equal_parameter(parm_type type, void *ptr1, void *ptr2)
 }
 
 /***************************************************************************
- Initialize any local varients in the sDefault table.
+ Initialize any local variables in the sDefault table, after parsing a
+ [globals] section.
 ***************************************************************************/
 
-void init_locals(void)
+static void init_locals(void)
 {
-	/* None as yet. */
+	/*
+	 * We run this check once the [globals] is parsed, to force
+	 * the VFS objects and other per-share settings we need for
+	 * the standard way a AD DC is operated.  We may change these
+	 * as our code evolves, which is why we force these settings.
+	 *
+	 * We can't do this at the end of lp_load_ex(), as by that
+	 * point the services have been loaded and they will already
+	 * have "" as their vfs objects.
+	 */
+	if (lp_server_role() == ROLE_ACTIVE_DIRECTORY_DC) {
+		const char **vfs_objects = lp_vfs_objects(-1);
+		if (!vfs_objects || !vfs_objects[0]) {
+			if (lp_parm_const_string(-1, "xattr_tdb", "file", NULL)) {
+				lp_do_parameter(-1, "vfs objects", "dfs_samba4 acl_xattr xattr_tdb");
+			} else if (lp_parm_const_string(-1, "posix", "eadb", NULL)) {
+				lp_do_parameter(-1, "vfs objects", "dfs_samba4 acl_xattr posix_eadb");
+			} else {
+				lp_do_parameter(-1, "vfs objects", "dfs_samba4 acl_xattr");
+			}
+		}
+
+		lp_do_parameter(-1, "map hidden", "no");
+		lp_do_parameter(-1, "map system", "no");
+		lp_do_parameter(-1, "map readonly", "no");
+		lp_do_parameter(-1, "store dos attributes", "yes");
+		lp_do_parameter(-1, "create mask", "0777");
+		lp_do_parameter(-1, "directory mask", "0777");
+	}
 }
 
 /***************************************************************************
@@ -4887,17 +4916,13 @@ static bool lp_load_ex(const char *pszFname,
 
 	fault_configure(smb_panic_s3);
 
+	/*
+	 * 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
+	 * is why we force these settings.
+	 */
 	if (lp_server_role() == ROLE_ACTIVE_DIRECTORY_DC) {
-		const char **vfs_objects = lp_vfs_objects(-1);
-		if (!vfs_objects || !vfs_objects[0]) {
-			if (lp_parm_const_string(-1, "xattr_tdb", "file", NULL)) {
-				lp_do_parameter(-1, "vfs objects", "dfs_samba4 acl_xattr xattr_tdb");
-			} else if (lp_parm_const_string(-1, "posix", "eadb", NULL)) {
-				lp_do_parameter(-1, "vfs objects", "dfs_samba4 acl_xattr posix_eadb");
-			} else {
-				lp_do_parameter(-1, "vfs objects", "dfs_samba4 acl_xattr");
-			}
-		}
 		lp_do_parameter(-1, "passdb backend", "samba_dsdb");
 
 		lp_do_parameter(-1, "rpc_server:default", "external");
@@ -4909,13 +4934,6 @@ static bool lp_load_ex(const char *pszFname,
 		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_do_parameter(-1, "map hidden", "no");
-		lp_do_parameter(-1, "map system", "no");
-		lp_do_parameter(-1, "map readonly", "no");
-		lp_do_parameter(-1, "store dos attributes", "yes");
-		lp_do_parameter(-1, "create mask", "0777");
-		lp_do_parameter(-1, "directory mask", "0777");
 	}
 
 	bAllowIncludeRegistry = true;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list