[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Sat Dec 9 01:57:03 UTC 2017


The branch, master has been updated
       via  1cbbe18 s3-selftest: fix creation of large file
       via  25a4078 s3: test_smbclient_s3: Fix restore of TZ.
       via  ad0d275 s3:winbindd: Use a stackframe for memory management in _wbint_QueryGroupList
       via  18307f8 Add mdns name configuration option
      from  b8d0602 selftest: Rework samba.dsdb locking test to samba.dsdb_lock

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


- Log -----------------------------------------------------------------
commit 1cbbe18c417533c1edacac23ec98022dd29ef93d
Author: Jamie McClymont <jamiemcclymont at catalyst.net.nz>
Date:   Tue Dec 5 14:51:07 2017 +1300

    s3-selftest: fix creation of large file
    
    The dd command was skipping the first 20MB of /dev/zero then writing only one,
    while indending to create a 20MB sparse file.
    
    Signed-off-by: Jamie McClymont <jamiemcclymont at catalyst.net.nz>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Sat Dec  9 02:56:18 CET 2017 on sn-devel-144

commit 25a407828367d1c3d700dc64f0be64d87342ae7f
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Dec 5 08:58:24 2017 -0800

    s3: test_smbclient_s3: Fix restore of TZ.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>

commit ad0d2756daa7549934d993bf3bcfe57664679154
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Dec 6 18:48:47 2017 +0100

    s3:winbindd: Use a stackframe for memory management in _wbint_QueryGroupList
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 18307f87114b90258fb51222bfde4408e80dc596
Author: Kevin Anderson <andersonkw2 at gmail.com>
Date:   Sat Nov 25 23:03:59 2017 -0500

    Add mdns name configuration option
    
    Add the mdns name configuration variable to control the mdns hostname.
    The default is to use the NETBIOS name of the system to match previous
    versions which is typically the hostname in all capitals. A value of mdns
    can be provided to defer the hostname to the mdns library.
    
    With the recent patch to support time machine being merged this patch
    allows for a user to configure the server name that is advertised to
    be lower cased through Avahi advertisements.
    
    Signed-off-by: Kevin Anderson <andersonkw2 at gmail.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 WHATSNEW.txt                                      | 26 +++++++++++++-
 docs-xml/smbdotconf/base/mdnsname.xml             | 19 ++++++++++
 lib/param/loadparm.c                              |  2 ++
 lib/param/loadparm.h                              |  3 ++
 lib/param/param_table.c                           |  6 ++++
 source3/script/tests/test_smbclient_large_file.sh |  2 +-
 source3/script/tests/test_smbclient_s3.sh         |  4 +--
 source3/smbd/avahi_register.c                     | 18 ++++++++--
 source3/winbindd/winbindd_dual_srv.c              | 43 ++++++++++++-----------
 9 files changed, 96 insertions(+), 27 deletions(-)
 create mode 100644 docs-xml/smbdotconf/base/mdnsname.xml


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 8f5986e..007e5d9 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -29,6 +29,29 @@ policy. Can be applied automatically by setting
 
  'server services = +gpoupdate'.
 
+Time Machine Support with vfs_fruit
+===================================
+Samba can be configured as a Time Machine target for Apple Mac devices
+through the vfs_fruit module. When enabling a share for Time Machine
+support the relevant Avahi records to support discovery will be published
+for installations that have been built against the Avahi client library.
+
+Shares can be designated as a Time Machine share with the following setting:
+
+  'fruit:time machine = yes'
+
+Support for lower casing the MDNS Name
+======================================
+Allows the server name that is advertised through MDNS to be set to the
+hostname rather than the Samba NETBIOS name. This allows an administrator
+to make Samba registered MDNS records match the case of the hostname
+rather than being in all capitals.
+
+This can be set with the following settings:
+
+  'mdns name = mdns'
+
+
 smb.conf changes
 ================
 
@@ -38,7 +61,8 @@ smb.conf changes
   gpo update command		     New
   oplock contention limit            Removed
   prefork children		     New		     1
-
+  mdns name                          Added                   netbios
+  fruit:time machine                 Added                   false
 
 NT4-style replication based net commands removed
 ================================================
diff --git a/docs-xml/smbdotconf/base/mdnsname.xml b/docs-xml/smbdotconf/base/mdnsname.xml
new file mode 100644
index 0000000..fba90ff
--- /dev/null
+++ b/docs-xml/smbdotconf/base/mdnsname.xml
@@ -0,0 +1,19 @@
+<samba:parameter name="mdns name"
+                 type="enum"
+                 context="G"
+                 enumlist="enum_mdns_name_values"
+                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+
+<description>
+	<para>This parameter controls the name that multicast DNS
+	support advertises as its' hostname.</para>
+
+	<para>The default is to use the NETBIOS name which is typically
+	the hostname in all capital letters. </para>
+
+	<para>A setting of mdns will defer the hostname configuration
+	to the MDNS library that is used.</para>
+
+</description>
+<value type="default">netbios</value>
+</samba:parameter>
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index d788ffb..73b7901 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2906,6 +2906,8 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
 
 	lpcfg_do_global_parameter(lp_ctx, "client ldap sasl wrapping", "sign");
 
+	lpcfg_do_global_parameter(lp_ctx, "mdns name", "netbios");
+
 	lpcfg_do_global_parameter(lp_ctx, "ldap server require strong auth", "yes");
 
 	lpcfg_do_global_parameter(lp_ctx, "follow symlinks", "yes");
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h
index e3c8216..b5d79b9 100644
--- a/lib/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -223,6 +223,9 @@ enum ldap_server_require_strong_auth {
 /* DNS update settings */
 enum dns_update_settings {DNS_UPDATE_OFF, DNS_UPDATE_ON, DNS_UPDATE_SIGNED};
 
+/* MDNS name sources */
+enum mdns_name_values {MDNS_NAME_NETBIOS, MDNS_NAME_MDNS};
+
 /* LDAP SSL options */
 enum ldap_ssl_types {LDAP_SSL_OFF, LDAP_SSL_START_TLS};
 
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index f905230..f9d3b55 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -127,6 +127,12 @@ static const struct enum_list enum_smb_signing_vals[] = {
 	{-1, NULL}
 };
 
+static const struct enum_list enum_mdns_name_values[] = {
+	{MDNS_NAME_NETBIOS, "netbios"},
+	{MDNS_NAME_MDNS, "mdns"},
+	{-1, NULL}
+};
+
 static const struct enum_list enum_tls_verify_peer_vals[] = {
 	{TLS_VERIFY_PEER_NO_CHECK,
 	 TLS_VERIFY_PEER_NO_CHECK_STRING},
diff --git a/source3/script/tests/test_smbclient_large_file.sh b/source3/script/tests/test_smbclient_large_file.sh
index 0aee7af..23a2ffd 100755
--- a/source3/script/tests/test_smbclient_large_file.sh
+++ b/source3/script/tests/test_smbclient_large_file.sh
@@ -49,7 +49,7 @@ EOF
 }
 
 rm -f $PREFIX/largefile
-dd if=/dev/zero of=$PREFIX/largefile skip=$((20*1024*1024)) count=1 bs=1
+dd if=/dev/zero of=$PREFIX/largefile seek=$((20*1024*1024)) count=1 bs=1
 
 incdir=`dirname $0`/../../../testprogs/blackbox
 . $incdir/subunit.sh
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index 84f6ef5..8017d19 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -1437,8 +1437,8 @@ EOF
     out=`eval $cmd`
     ret=$?
 
-    if [ -n "$SAVED_TZ" ] ; then
-	export TZ="$SAVED_TZ"
+    if [ -n "$saved_TZ" ] ; then
+	export TZ="$saved_TZ"
     else
 	unset TZ
     fi
diff --git a/source3/smbd/avahi_register.c b/source3/smbd/avahi_register.c
index 91e8a43..50462b5 100644
--- a/source3/smbd/avahi_register.c
+++ b/source3/smbd/avahi_register.c
@@ -111,9 +111,23 @@ static void avahi_client_callback(AvahiClient *c, AvahiClientState status,
 		int dk = 0;
 		AvahiStringList *adisk = NULL;
 		AvahiStringList *adisk2 = NULL;
+		const char *hostname = NULL;
+		enum mdns_name_values mdns_name = lp_mdns_name();
 
 		DBG_DEBUG("AVAHI_CLIENT_S_RUNNING\n");
 
+		switch (mdns_name) {
+		case MDNS_NAME_MDNS:
+			hostname = avahi_client_get_host_name(c);
+			break;
+		case MDNS_NAME_NETBIOS:
+			hostname = lp_netbios_name();
+			break;
+		default:
+			DBG_ERR("Unhandled mdns_name %d\n", mdns_name);
+			return;
+		}
+
 		state->entry_group = avahi_entry_group_new(
 			c, avahi_entry_group_callback, state);
 		if (state->entry_group == NULL) {
@@ -125,7 +139,7 @@ static void avahi_client_callback(AvahiClient *c, AvahiClientState status,
 
 		error = avahi_entry_group_add_service(
 			    state->entry_group, AVAHI_IF_UNSPEC,
-			    AVAHI_PROTO_UNSPEC, 0, lp_netbios_name(),
+			    AVAHI_PROTO_UNSPEC, 0, hostname,
 			    "_smb._tcp", NULL, NULL, state->port, NULL);
 		if (error != AVAHI_OK) {
 			DBG_DEBUG("avahi_entry_group_add_service failed: %s\n",
@@ -169,7 +183,7 @@ static void avahi_client_callback(AvahiClient *c, AvahiClientState status,
 
 			error = avahi_entry_group_add_service_strlst(
 				    state->entry_group, AVAHI_IF_UNSPEC,
-				    AVAHI_PROTO_UNSPEC, 0, lp_netbios_name(),
+				    AVAHI_PROTO_UNSPEC, 0, hostname,
 				    "_adisk._tcp", NULL, NULL, 0, adisk);
 			avahi_string_list_free(adisk);
 			adisk = NULL;
diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c
index 797a9d9..81fcf85 100644
--- a/source3/winbindd/winbindd_dual_srv.c
+++ b/source3/winbindd/winbindd_dual_srv.c
@@ -380,6 +380,7 @@ NTSTATUS _wbint_LookupGroupMembers(struct pipes_struct *p,
 NTSTATUS _wbint_QueryGroupList(struct pipes_struct *p,
 			       struct wbint_QueryGroupList *r)
 {
+	TALLOC_CTX *frame = NULL;
 	struct winbindd_domain *domain = wb_child_domain();
 	uint32_t i;
 	uint32_t num_local_groups = 0;
@@ -389,13 +390,15 @@ NTSTATUS _wbint_QueryGroupList(struct pipes_struct *p,
 	uint32_t ti = 0;
 	uint64_t num_total = 0;
 	struct wbint_Principal *result;
-	NTSTATUS status;
+	NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
 	bool include_local_groups = false;
 
 	if (domain == NULL) {
 		return NT_STATUS_REQUEST_NOT_ACCEPTED;
 	}
 
+	frame = talloc_stackframe();
+
 	switch (lp_server_role()) {
 	case ROLE_ACTIVE_DIRECTORY_DC:
 		if (domain->internal) {
@@ -416,32 +419,33 @@ NTSTATUS _wbint_QueryGroupList(struct pipes_struct *p,
 	}
 
 	if (include_local_groups) {
-		status = wb_cache_enum_local_groups(domain, talloc_tos(),
+		status = wb_cache_enum_local_groups(domain, frame,
 						    &num_local_groups,
 						    &local_groups);
 		reset_cm_connection_on_error(domain, status);
 		if (!NT_STATUS_IS_OK(status)) {
-			return status;
+			goto out;
 		}
 	}
 
-	status = wb_cache_enum_dom_groups(domain, talloc_tos(),
+	status = wb_cache_enum_dom_groups(domain, frame,
 					  &num_dom_groups,
 					  &dom_groups);
 	reset_cm_connection_on_error(domain, status);
 	if (!NT_STATUS_IS_OK(status)) {
-		return status;
+		goto out;
 	}
 
 	num_total = num_local_groups + num_dom_groups;
 	if (num_total > UINT32_MAX) {
-		return NT_STATUS_INTERNAL_ERROR;
+		status = NT_STATUS_INTERNAL_ERROR;
+		goto out;
 	}
 
-	result = talloc_array(r->out.groups, struct wbint_Principal,
-			      num_total);
+	result = talloc_array(frame, struct wbint_Principal, num_total);
 	if (result == NULL) {
-		return NT_STATUS_NO_MEMORY;
+		status = NT_STATUS_NO_MEMORY;
+		goto out;
 	}
 
 	for (i = 0; i < num_local_groups; i++) {
@@ -452,14 +456,11 @@ NTSTATUS _wbint_QueryGroupList(struct pipes_struct *p,
 		rg->type = SID_NAME_ALIAS;
 		rg->name = talloc_strdup(result, lg->acct_name);
 		if (rg->name == NULL) {
-			TALLOC_FREE(result);
-			TALLOC_FREE(dom_groups);
-			TALLOC_FREE(local_groups);
-			return NT_STATUS_NO_MEMORY;
+			status = NT_STATUS_NO_MEMORY;
+			goto out;
 		}
 	}
 	num_local_groups = 0;
-	TALLOC_FREE(local_groups);
 
 	for (i = 0; i < num_dom_groups; i++) {
 		struct wb_acct_info *dg = &dom_groups[i];
@@ -469,19 +470,19 @@ NTSTATUS _wbint_QueryGroupList(struct pipes_struct *p,
 		rg->type = SID_NAME_DOM_GRP;
 		rg->name = talloc_strdup(result, dg->acct_name);
 		if (rg->name == NULL) {
-			TALLOC_FREE(result);
-			TALLOC_FREE(dom_groups);
-			TALLOC_FREE(local_groups);
-			return NT_STATUS_NO_MEMORY;
+			status = NT_STATUS_NO_MEMORY;
+			goto out;
 		}
 	}
 	num_dom_groups = 0;
-	TALLOC_FREE(dom_groups);
 
 	r->out.groups->num_principals = ti;
-	r->out.groups->principals = result;
+	r->out.groups->principals = talloc_move(r->out.groups, &result);
 
-	return NT_STATUS_OK;
+	status = NT_STATUS_OK;
+out:
+	TALLOC_FREE(frame);
+	return status;
 }
 
 NTSTATUS _wbint_QueryUserRidList(struct pipes_struct *p,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list