[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Thu Oct 22 00:31:03 UTC 2020


The branch, master has been updated
       via  7b52c2db264 s3:param:service - ensure registry shares loaded before home check
       via  3b2a9083f8e lib:util:loadparm - fix leak in lpcfg_dump_a_parameter
      from  d031391bed0 fuzzing: Fix the oss-fuzz coverage build

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


- Log -----------------------------------------------------------------
commit 7b52c2db264a92ea77bcb7e45e016ea03f699393
Author: Andrew Walker <awalker at ixsystems.com>
Date:   Wed Oct 21 05:38:45 2020 -0400

    s3:param:service - ensure registry shares loaded before home check
    
    Registry shares should be loaded and checked prior to checking home
    directories. This ensures that an explicitly defined service takes
    priority over home directories (same behavior as non-registry shares).
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14543
    
    Signed-off-by: Andrew Walker <awalker at ixsystems.com>
    Reviewed-by: Jeremy Alison <jra at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Oct 22 00:30:38 UTC 2020 on sn-devel-184

commit 3b2a9083f8ea7758ab545ff82578ba35e1f05679
Author: Andrew Walker <awalker at ixsystems.com>
Date:   Wed Oct 21 07:47:14 2020 -0400

    lib:util:loadparm - fix leak in lpcfg_dump_a_parameter
    
    This function calls talloc_strdup() for the parm_name passed into
    it so that we can check whether it's a parametric entry. It's
    allocated under the loadparm context passed into the function.
    Primary consumer of this is "testparm" and so context short-lived in
    typical use-case, but this is also exposed via pyparam and so the
    loadparm context may be somewhat longer-lived depending on how it is
    being used.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14544
    
    Signed-off-by: Andrew Walker <awalker at ixsystems.com>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>

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

Summary of changes:
 lib/param/loadparm.c    |  3 +++
 source3/param/service.c | 14 ++++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 5309561b398..eaf992f209b 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2408,11 +2408,14 @@ bool lpcfg_dump_a_parameter(struct loadparm_context *lp_ctx,
 				local_parm_name, parm_opt);
 			if (parm_opt_value) {
 				fprintf(f, "%s\n", parm_opt_value);
+				TALLOC_FREE(local_parm_name);
 				return true;
 			}
 		}
+		TALLOC_FREE(local_parm_name);
 		return false;
 	}
+	TALLOC_FREE(local_parm_name);
 
 	/* parameter is not parametric, search the table */
 	parm = lpcfg_parm_struct(lp_ctx, parm_name);
diff --git a/source3/param/service.c b/source3/param/service.c
index 09b8228daad..add6b40d619 100644
--- a/source3/param/service.c
+++ b/source3/param/service.c
@@ -129,6 +129,16 @@ int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out)
 
 	iService = lp_servicenumber(*p_service_out);
 
+	/*
+	 * check for whether the service is a registry share before
+	 * handling home directories. This is to ensure that
+	 * that in the case service name is identical to a user's
+	 * home directory, the explicit service is preferred.
+	 */
+	if (iService < 0) {
+		iService = load_registry_service(*p_service_out);
+	}
+
 	/* now handle the special case of a home directory */
 	if (iService < 0) {
 		char *phome_dir = get_user_home_dir(ctx, *p_service_out);
@@ -186,10 +196,6 @@ int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out)
 		}
 	}
 
-	if (iService < 0) {
-		iService = load_registry_service(*p_service_out);
-	}
-
 	/* Is it a usershare service ? */
 	if (iService < 0 && *lp_usershare_path(talloc_tos(), lp_sub)) {
 		/* Ensure the name is canonicalized. */


-- 
Samba Shared Repository



More information about the samba-cvs mailing list