From slow at samba.org Tue Jul 1 07:53:17 2025 From: slow at samba.org (=?UTF-8?Q?Ralph_B=C3=B6hme?=) Date: Tue, 01 Jul 2025 07:53:17 +0000 Subject: [SCM] Samba Website Repository - branch master updated Message-ID: The branch, master has been updated via ec77184 docs: remove links ti old and crufted translations via 18dfd18 docs: add a link to our Youtube channel via 66f414a support/germany: rework SerNet entry from 1ea5065 support: fix link to global support https://git.samba.org/?p=samba-web.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit ec77184499f2d4bca1fff49d774e1d03c052f94b Author: Ralph Boehme Date: Tue Jul 1 09:52:46 2025 +0200 docs: remove links ti old and crufted translations commit 18dfd18f983547710afdf86f0e22bff7be04dada Author: Ralph Boehme Date: Tue Jul 1 09:52:30 2025 +0200 docs: add a link to our Youtube channel commit 66f414aff93ff256c62f1207080965d223598f76 Author: Ralph Boehme Date: Tue Jul 1 09:30:29 2025 +0200 support/germany: rework SerNet entry ----------------------------------------------------------------------- Summary of changes: docs/index.html | 12 +++------- support/germany.html | 68 ++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 51 insertions(+), 29 deletions(-) Changeset truncated at 500 lines: diff --git a/docs/index.html b/docs/index.html index ce6445b..43447e5 100755 --- a/docs/index.html +++ b/docs/index.html @@ -12,7 +12,9 @@ earlier version of Samba then you may find some differences.

-

Translations

- -

Contributing

Contributions are always welcome to Samba documentation. Like everything else concerning Samba, these docs are maintained by members of the Samba diff --git a/support/germany.html b/support/germany.html index 5426929..be909e5 100644 --- a/support/germany.html +++ b/support/germany.html @@ -11,35 +11,34 @@ -

SerNet ist eine der führenden Anbieterinnen von Dienstleistungen -und Produkten rund um Samba, Linux und Open-Source-Software.

+

SerNet ist eine der international f??hrenden Dienstleisterinnen f??r +Samba, Linux und OpenSource-Themen und bietet Support, Beratung und +Entwicklung f??r Samba. SerNet hat au??erdem SLAs mit weltweiter +Abdeckung, 24/7-Verf??gbarkeit und verschiedenen Servicelevels im +Portfolio.

-

SerNet bietet Support für Samba auf Basis -von SLAs (Service Level -Agreements) weltweit an.

+

Mit SAMBA+ +bietet SerNet eigene und immer aktuelle Samba-Pakete f??r alle +wichtigen Linux-Systeme und IBM AIX an - f??r alle Plattformen aus der +gleichen Quelle, mit gleicher Konfiguration und damit weitgehend +identischem Verhalten. Alle wichtigen ActiveDirectory-Optionen und +verschiedene Cluster-File-Systeme wie IBMs GPFS werden +unterst??tzt.

-

Mit SAMBA+ bietet -SerNet eigene und immer aktuelle Samba-Pakete für alle wichtigen -Linux-Systeme und IBM -AIX an - für alle Plattformen aus der gleichen Quelle und mit -gleicher Konfiguration und damit weitgehend identischem Verhalten. -Alle wichtigen ActiveDirectory-Optionen und verschiedene -Cluster-File-Systeme wie IBMs GPFS werden unterstützt.

+

Mit der sambaXP veranstaltet +SerNet seit 2002 j??hrlich die einzige internationale Entwickler:innen- +und Anwender:innen-Konferenz zu Samba.

-

SerNet veranstaltet mit -der sambaXP die einzige -internationale Entwickler:innen- und Anwender:innen-Konferenz zu Samba -jedes Jahr im Mai seit 2002.

- -

Es werden regelm????ig verschiedene Webinare zu Samba angeboten, an -denen die Teilnahme kostenlos ist.

+

Regelm????ig finden +verschiedene Webinare zu +Samba-Themen statt. Die Teilnahme ist kostenlos

Mitglieder aus dem internationalen samba.TEAM arbeiten bei SerNet:

  • Jule Anger ist die Release-Managerin des Samba-Teams.
  • Björn Baumbach ist Maintainer von SAMBA+ und behebt diverse Samba-Bugs.
  • -
  • Ralph Böhme ist arbeitet haupts??chlich am Fileserver und ist Teamleiter des SerNet Samba Teams.
  • +
  • Ralph Böhme arbeitet haupts??chlich am Fileserver und ist Teamleiter des SerNet Samba Teams.
  • Björn Jacke integriert Samba in Netzwerke aller Größenordnungen.
  • Volker Lendecke war eines der ersten Mitglieder im Sambateam und Mitgründer der SerNet.
  • Stefan Metzmacher ist AD- und Sicherheitsspezialist und einer der Hauptautoren von Samba 4.
  • @@ -52,6 +51,35 @@ Weitere Informationen über SerNet finden Sie unter:
    SAMBA.plus

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    SerNet GmbH
    Bahnhofsallee 1b +
    37081 Göttingen
    Germany +
    +https://www.sernet.de/ +
    phone: +49-551-370000-0 +
    mail: samba at sernet.de +
    +
    +
    +

    itsystems Deutschland AG

    
    
    
    -- 
    Samba Website Repository
    
    
    From slow at samba.org  Mon Jul  7 10:45:02 2025
    From: slow at samba.org (=?UTF-8?Q?Ralph_B=C3=B6hme?=)
    Date: Mon, 07 Jul 2025 10:45:02 +0000
    Subject: [SCM] Samba Shared Repository - branch master updated
    Message-ID: 
    
    The branch, master has been updated
           via  2560c9b3224 s3-winbindd: Fix internal winbind dsgetdcname calls w.r.t. domain name
           via  f86a4bf6848 s3:winbindd: avoid using any netlogon call to get a dc name
          from  d0be58d4c21 rpc registry: add ProductType for AD DC
    
    https://git.samba.org/?p=samba.git;a=shortlog;h=master
    
    
    - Log -----------------------------------------------------------------
    commit 2560c9b3224816ffd371a62103f65b3aca301ad5
    Author: G?nther Deschner 
    Date:   Wed Jul 2 21:59:48 2025 +0200
    
        s3-winbindd: Fix internal winbind dsgetdcname calls w.r.t. domain name
        
        when winbind calls to dsgetdcname internally, make sure to
        prefer the DNS domain name if we have it. Makes DNS lookups much more
        likely to succeed.
        
        BUG: https://bugzilla.samba.org/show_bug.cgi?id=15876
        
        Guenther
        
        Signed-off-by: Guenther Deschner 
        Reviewed-by: Andreas Schneider 
        Reviewed-by: Ralph Boehme 
        
        Autobuild-User(master): Ralph B?hme 
        Autobuild-Date(master): Mon Jul  7 10:44:37 UTC 2025 on atb-devel-224
    
    commit f86a4bf6848ade2db7229d182576db3320c3ece7
    Author: Stefan Metzmacher 
    Date:   Fri May 9 09:38:41 2025 +0200
    
        s3:winbindd: avoid using any netlogon call to get a dc name
        
        BUG: https://bugzilla.samba.org/show_bug.cgi?id=15876
        
        Signed-off-by: Stefan Metzmacher 
        Reviewed-by: Guenther Deschner 
        Reviewed-by: Andreas Schneider 
        Reviewed-by: Ralph Boehme 
    
    -----------------------------------------------------------------------
    
    Summary of changes:
     source3/winbindd/wb_queryuser.c      |  17 +++-
     source3/winbindd/wb_sids2xids.c      |  17 +++-
     source3/winbindd/wb_xids2sids.c      |  12 ++-
     source3/winbindd/winbindd_cm.c       | 150 -----------------------------------
     source3/winbindd/winbindd_dual.c     |   6 +-
     source3/winbindd/winbindd_dual_srv.c | 105 ++----------------------
     source3/winbindd/winbindd_proto.h    |   1 +
     source3/winbindd/winbindd_util.c     |  19 +++++
     8 files changed, 65 insertions(+), 262 deletions(-)
    
    
    Changeset truncated at 500 lines:
    
    diff --git a/source3/winbindd/wb_queryuser.c b/source3/winbindd/wb_queryuser.c
    index c2758f1b76a..db8e946ba71 100644
    --- a/source3/winbindd/wb_queryuser.c
    +++ b/source3/winbindd/wb_queryuser.c
    @@ -289,10 +289,19 @@ static void wb_queryuser_done(struct tevent_req *subreq)
     
     	if (NT_STATUS_EQUAL(result, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND) &&
     	    !state->tried_dclookup) {
    -		D_DEBUG("GetNssInfo got DOMAIN_CONTROLLER_NOT_FOUND, calling wb_dsgetdcname_send()\n");
    -		subreq = wb_dsgetdcname_send(
    -			state, state->ev, state->info->domain_name, NULL, NULL,
    -			DS_RETURN_DNS_NAME);
    +		const char *domain_name = find_dns_domain_name(
    +			state->info->domain_name);
    +
    +		D_DEBUG("GetNssInfo got DOMAIN_CONTROLLER_NOT_FOUND, calling "
    +			"wb_dsgetdcname_send(%s)\n",
    +			domain_name);
    +
    +		subreq = wb_dsgetdcname_send(state,
    +					     state->ev,
    +					     domain_name,
    +					     NULL,
    +					     NULL,
    +					     DS_RETURN_DNS_NAME);
     		if (tevent_req_nomem(subreq, req)) {
     			return;
     		}
    diff --git a/source3/winbindd/wb_sids2xids.c b/source3/winbindd/wb_sids2xids.c
    index f0f6c23fc20..03e5e7e0258 100644
    --- a/source3/winbindd/wb_sids2xids.c
    +++ b/source3/winbindd/wb_sids2xids.c
    @@ -612,13 +612,22 @@ static void wb_sids2xids_done(struct tevent_req *subreq)
     	    !state->tried_dclookup) {
     
     		struct lsa_DomainInfo *d;
    +		const char *domain_name = NULL;
     
    -		D_DEBUG("Domain controller not found. Calling wb_dsgetdcname_send() to get it.\n");
     		d = &state->idmap_doms.domains[state->dom_index];
     
    -		subreq = wb_dsgetdcname_send(
    -			state, state->ev, d->name.string, NULL, NULL,
    -			DS_RETURN_DNS_NAME);
    +		domain_name = find_dns_domain_name(d->name.string);
    +
    +		D_DEBUG("Domain controller not found. Calling "
    +			"wb_dsgetdcname_send(%s) to get it.\n",
    +			domain_name);
    +
    +		subreq = wb_dsgetdcname_send(state,
    +					     state->ev,
    +					     domain_name,
    +					     NULL,
    +					     NULL,
    +					     DS_RETURN_DNS_NAME);
     		if (tevent_req_nomem(subreq, req)) {
     			return;
     		}
    diff --git a/source3/winbindd/wb_xids2sids.c b/source3/winbindd/wb_xids2sids.c
    index 86bd7f9deab..6fcf524d94f 100644
    --- a/source3/winbindd/wb_xids2sids.c
    +++ b/source3/winbindd/wb_xids2sids.c
    @@ -143,9 +143,15 @@ static void wb_xids2sids_dom_done(struct tevent_req *subreq)
     	if (NT_STATUS_EQUAL(result, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND) &&
     	    !state->tried_dclookup) {
     
    -		subreq = wb_dsgetdcname_send(
    -			state, state->ev, state->dom_map->name, NULL, NULL,
    -			DS_RETURN_DNS_NAME);
    +		const char *domain_name = find_dns_domain_name(
    +			state->dom_map->name);
    +
    +		subreq = wb_dsgetdcname_send(state,
    +					     state->ev,
    +					     domain_name,
    +					     NULL,
    +					     NULL,
    +					     DS_RETURN_DNS_NAME);
     		if (tevent_req_nomem(subreq, req)) {
     			return;
     		}
    diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
    index cc0b47b0600..15a2f60c532 100644
    --- a/source3/winbindd/winbindd_cm.c
    +++ b/source3/winbindd/winbindd_cm.c
    @@ -477,140 +477,6 @@ static bool cm_is_ipc_credentials(struct cli_credentials *creds)
     	return ret;
     }
     
    -static bool get_dc_name_via_netlogon(struct winbindd_domain *domain,
    -				     fstring dcname,
    -				     struct sockaddr_storage *dc_ss,
    -				     uint32_t request_flags)
    -{
    -	struct winbindd_domain *our_domain = NULL;
    -	struct rpc_pipe_client *netlogon_pipe = NULL;
    -	NTSTATUS result;
    -	WERROR werr;
    -	TALLOC_CTX *mem_ctx;
    -	unsigned int orig_timeout;
    -	const char *tmp = NULL;
    -	const char *p;
    -	struct dcerpc_binding_handle *b;
    -
    -	/* Hmmmm. We can only open one connection to the NETLOGON pipe at the
    -	 * moment.... */
    -
    -	if (IS_DC) {
    -		return False;
    -	}
    -
    -	if (domain->primary) {
    -		return False;
    -	}
    -
    -	our_domain = find_our_domain();
    -
    -	if ((mem_ctx = talloc_init("get_dc_name_via_netlogon")) == NULL) {
    -		return False;
    -	}
    -
    -	result = cm_connect_netlogon(our_domain, &netlogon_pipe);
    -	if (!NT_STATUS_IS_OK(result)) {
    -		talloc_destroy(mem_ctx);
    -		return False;
    -	}
    -
    -	b = netlogon_pipe->binding_handle;
    -
    -	/* This call can take a long time - allow the server to time out.
    -	   35 seconds should do it. */
    -
    -	orig_timeout = rpccli_set_timeout(netlogon_pipe, 35000);
    -
    -	if (our_domain->active_directory) {
    -		struct netr_DsRGetDCNameInfo *domain_info = NULL;
    -
    -		/*
    -		 * TODO request flags are not respected in the server
    -		 * (and in some cases, like REQUIRE_PDC, causes an error)
    -		 */
    -		result = dcerpc_netr_DsRGetDCName(b,
    -						  mem_ctx,
    -						  our_domain->dcname,
    -						  domain->name,
    -						  NULL,
    -						  NULL,
    -						  request_flags|DS_RETURN_DNS_NAME,
    -						  &domain_info,
    -						  &werr);
    -		if (NT_STATUS_IS_OK(result) && W_ERROR_IS_OK(werr)) {
    -			tmp = talloc_strdup(
    -				mem_ctx, domain_info->dc_unc);
    -			if (tmp == NULL) {
    -				DBG_ERR("talloc_strdup failed for dc_unc[%s]\n",
    -					domain_info->dc_unc);
    -				talloc_destroy(mem_ctx);
    -				return false;
    -			}
    -			if (domain->alt_name == NULL) {
    -				domain->alt_name = talloc_strdup(domain,
    -								 domain_info->domain_name);
    -				if (domain->alt_name == NULL) {
    -					DBG_ERR("talloc_strdup failed for "
    -						"domain_info->domain_name[%s]\n",
    -						domain_info->domain_name);
    -					talloc_destroy(mem_ctx);
    -					return false;
    -				}
    -			}
    -			if (domain->forest_name == NULL) {
    -				domain->forest_name = talloc_strdup(domain,
    -								    domain_info->forest_name);
    -				if (domain->forest_name == NULL) {
    -					DBG_ERR("talloc_strdup failed for "
    -						"domain_info->forest_name[%s]\n",
    -						domain_info->forest_name);
    -					talloc_destroy(mem_ctx);
    -					return false;
    -				}
    -			}
    -		}
    -	} else {
    -		result = dcerpc_netr_GetAnyDCName(b, mem_ctx,
    -						  our_domain->dcname,
    -						  domain->name,
    -						  &tmp,
    -						  &werr);
    -	}
    -
    -	/* And restore our original timeout. */
    -	rpccli_set_timeout(netlogon_pipe, orig_timeout);
    -
    -	if (!NT_STATUS_IS_OK(result)) {
    -		DEBUG(10,("dcerpc_netr_GetAnyDCName failed: %s\n",
    -			nt_errstr(result)));
    -		talloc_destroy(mem_ctx);
    -		return false;
    -	}
    -
    -	if (!W_ERROR_IS_OK(werr)) {
    -		DEBUG(10,("dcerpc_netr_GetAnyDCName failed: %s\n",
    -			   win_errstr(werr)));
    -		talloc_destroy(mem_ctx);
    -		return false;
    -	}
    -
    -	/* dcerpc_netr_GetAnyDCName gives us a name with \\ */
    -	p = strip_hostname(tmp);
    -
    -	fstrcpy(dcname, p);
    -
    -	talloc_destroy(mem_ctx);
    -
    -	DEBUG(10,("dcerpc_netr_GetAnyDCName returned %s\n", dcname));
    -
    -	if (!resolve_name(dcname, dc_ss, 0x20, true)) {
    -		return False;
    -	}
    -
    -	return True;
    -}
    -
     /**
      * Helper function to assemble trust password and account name
      */
    @@ -1297,24 +1163,8 @@ static bool get_dcs(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
     	struct  samba_sockaddr *sa_list = NULL;
     	size_t     salist_size = 0;
     	size_t     i;
    -	bool    is_our_domain;
     	enum security_types sec = (enum security_types)lp_security();
     
    -	is_our_domain = strequal(domain->name, lp_workgroup());
    -
    -	/* If not our domain, get the preferred DC, by asking our primary DC */
    -	if ( !is_our_domain
    -		&& get_dc_name_via_netlogon(domain, dcname, &ss, request_flags)
    -		&& add_one_dc_unique(mem_ctx, domain->name, dcname, &ss, dcs,
    -		       num_dcs) )
    -	{
    -		char addr[INET6_ADDRSTRLEN];
    -		print_sockaddr(addr, sizeof(addr), &ss);
    -		DEBUG(10, ("Retrieved DC %s at %s via netlogon\n",
    -			   dcname, addr));
    -		return True;
    -	}
    -
     	if ((sec == SEC_ADS) && (domain->alt_name != NULL)) {
     		char *sitename = NULL;
     
    diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
    index 57e76884416..ccea44acf18 100644
    --- a/source3/winbindd/winbindd_dual.c
    +++ b/source3/winbindd/winbindd_dual.c
    @@ -548,6 +548,7 @@ static void wb_domain_request_trigger(struct tevent_req *req,
     	struct wb_domain_request_state *state = tevent_req_data(
     		req, struct wb_domain_request_state);
     	struct winbindd_domain *domain = state->domain;
    +	const char *domain_name = NULL;
     	struct tevent_req *subreq = NULL;
     	size_t shortest_queue_length;
     
    @@ -623,8 +624,11 @@ static void wb_domain_request_trigger(struct tevent_req *req,
     	 * which is indicated by DS_RETURN_DNS_NAME.
     	 * For NT4 domains we still get the netbios name.
     	 */
    +
    +	domain_name = find_dns_domain_name(state->domain->name);
    +
     	subreq = wb_dsgetdcname_send(state, state->ev,
    -				     state->domain->name,
    +				     domain_name,
     				     NULL, /* domain_guid */
     				     NULL, /* site_name */
     				     DS_RETURN_DNS_NAME); /* flags */
    diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c
    index b1809809b13..c48ca15dd2b 100644
    --- a/source3/winbindd/winbindd_dual_srv.c
    +++ b/source3/winbindd/winbindd_dual_srv.c
    @@ -661,106 +661,11 @@ NTSTATUS _wbint_QueryUserRidList(struct pipes_struct *p,
     
     NTSTATUS _wbint_DsGetDcName(struct pipes_struct *p, struct wbint_DsGetDcName *r)
     {
    -	struct winbindd_domain *domain = wb_child_domain();
    -	struct rpc_pipe_client *netlogon_pipe;
    -	struct netr_DsRGetDCNameInfo *dc_info;
    -	NTSTATUS status;
    -	WERROR werr;
    -	unsigned int orig_timeout;
    -	struct dcerpc_binding_handle *b;
    -	bool retry = false;
    -	bool try_dsrgetdcname = false;
    -
    -	if (domain == NULL) {
    -		return dsgetdcname(p->mem_ctx, global_messaging_context(),
    -				   r->in.domain_name, r->in.domain_guid,
    -				   r->in.site_name ? r->in.site_name : "",
    -				   r->in.flags,
    -				   r->out.dc_info);
    -	}
    -
    -	if (domain->active_directory) {
    -		try_dsrgetdcname = true;
    -	}
    -
    -reconnect:
    -	status = cm_connect_netlogon(domain, &netlogon_pipe);
    -
    -	reset_cm_connection_on_error(domain, NULL, status);
    -	if (!NT_STATUS_IS_OK(status)) {
    -		DEBUG(10, ("Can't contact the NETLOGON pipe\n"));
    -		return status;
    -	}
    -
    -	b = netlogon_pipe->binding_handle;
    -
    -	/* This call can take a long time - allow the server to time out.
    -	   35 seconds should do it. */
    -
    -	orig_timeout = rpccli_set_timeout(netlogon_pipe, 35000);
    -
    -	if (try_dsrgetdcname) {
    -		status = dcerpc_netr_DsRGetDCName(b,
    -			p->mem_ctx, domain->dcname,
    -			r->in.domain_name, NULL, r->in.domain_guid,
    -			r->in.flags, r->out.dc_info, &werr);
    -		if (NT_STATUS_IS_OK(status) && W_ERROR_IS_OK(werr)) {
    -			goto done;
    -		}
    -		if (!retry &&
    -		    reset_cm_connection_on_error(domain, NULL, status))
    -		{
    -			retry = true;
    -			goto reconnect;
    -		}
    -		try_dsrgetdcname = false;
    -		retry = false;
    -	}
    -
    -	/*
    -	 * Fallback to less capable methods
    -	 */
    -
    -	dc_info = talloc_zero(r->out.dc_info, struct netr_DsRGetDCNameInfo);
    -	if (dc_info == NULL) {
    -		status = NT_STATUS_NO_MEMORY;
    -		goto done;
    -	}
    -
    -	if (r->in.flags & DS_PDC_REQUIRED) {
    -		status = dcerpc_netr_GetDcName(b,
    -			p->mem_ctx, domain->dcname,
    -			r->in.domain_name, &dc_info->dc_unc, &werr);
    -	} else {
    -		status = dcerpc_netr_GetAnyDCName(b,
    -			p->mem_ctx, domain->dcname,
    -			r->in.domain_name, &dc_info->dc_unc, &werr);
    -	}
    -
    -	if (!retry && reset_cm_connection_on_error(domain, b, status)) {
    -		retry = true;
    -		goto reconnect;
    -	}
    -	if (!NT_STATUS_IS_OK(status)) {
    -		DEBUG(10, ("dcerpc_netr_Get[Any]DCName failed: %s\n",
    -			   nt_errstr(status)));
    -		goto done;
    -	}
    -	if (!W_ERROR_IS_OK(werr)) {
    -		DEBUG(10, ("dcerpc_netr_Get[Any]DCName failed: %s\n",
    -			   win_errstr(werr)));
    -		status = werror_to_ntstatus(werr);
    -		goto done;
    -	}
    -
    -	*r->out.dc_info = dc_info;
    -	status = NT_STATUS_OK;
    -
    -done:
    -	/* And restore our original timeout. */
    -	rpccli_set_timeout(netlogon_pipe, orig_timeout);
    -
    -	return status;
    +	return dsgetdcname(p->mem_ctx, global_messaging_context(),
    +			   r->in.domain_name, r->in.domain_guid,
    +			   r->in.site_name ? r->in.site_name : "",
    +			   r->in.flags,
    +			   r->out.dc_info);
     }
     
     NTSTATUS _wbint_LookupRids(struct pipes_struct *p, struct wbint_LookupRids *r)
    diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
    index 6d11a41d815..3734ab49086 100644
    --- a/source3/winbindd/winbindd_proto.h
    +++ b/source3/winbindd/winbindd_proto.h
    @@ -608,6 +608,7 @@ bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
     		   struct dom_sid **sids, uint32_t *num_sids);
     bool parse_xidlist(TALLOC_CTX *mem_ctx, const char *xidstr,
     		   struct unixid **pxids, uint32_t *pnum_xids);
    +const char *find_dns_domain_name(const char *domain_name);
     
     /* The following definitions come from winbindd/winbindd_wins.c  */
     
    diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c
    index 05466177600..954d01928b2 100644
    --- a/source3/winbindd/winbindd_util.c
    +++ b/source3/winbindd/winbindd_util.c
    @@ -2673,3 +2673,22 @@ fail:
     	TALLOC_FREE(xids);
     	return false;
     }
    +
    +/**
    + * Helper to extract the DNS Domain Name from a struct winbindd_domain
    + */
    +const char *find_dns_domain_name(const char *domain_name)
    +{
    +	struct winbindd_domain *wbdom = NULL;
    +
    +	wbdom = find_domain_from_name(domain_name);
    +	if (wbdom == NULL) {
    +		return domain_name;
    +	}
    +
    +	if (wbdom->active_directory && wbdom->alt_name != NULL) {
    +		return wbdom->alt_name;
    +	}
    +
    +	return wbdom->name;
    +}
    
    
    -- 
    Samba Shared Repository
    
    
    From janger at samba.org  Mon Jul  7 15:43:01 2025
    From: janger at samba.org (Jule Anger)
    Date: Mon, 07 Jul 2025 15:43:01 +0000
    Subject: [SCM] Samba Shared Repository - branch v4-21-test updated
    Message-ID: 
    
    The branch, v4-21-test has been updated
           via  1967ce81998 s3-winbindd: Fix internal winbind dsgetdcname calls w.r.t. domain name
           via  fc13e0918fd s3:winbindd: avoid using any netlogon call to get a dc name
          from  3490e76342a lib:util: Disable logging to syslog for startup messages
    
    https://git.samba.org/?p=samba.git;a=shortlog;h=v4-21-test
    
    
    - Log -----------------------------------------------------------------
    commit 1967ce819985be2e223c258284d5153713549108
    Author: G?nther Deschner 
    Date:   Wed Jul 2 21:59:48 2025 +0200
    
        s3-winbindd: Fix internal winbind dsgetdcname calls w.r.t. domain name
        
        when winbind calls to dsgetdcname internally, make sure to
        prefer the DNS domain name if we have it. Makes DNS lookups much more
        likely to succeed.
        
        BUG: https://bugzilla.samba.org/show_bug.cgi?id=15876
        
        Guenther
        
        Signed-off-by: Guenther Deschner 
        Reviewed-by: Andreas Schneider 
        Reviewed-by: Ralph Boehme 
        
        Autobuild-User(master): Ralph B?hme 
        Autobuild-Date(master): Mon Jul  7 10:44:37 UTC 2025 on atb-devel-224
        
        (cherry picked from commit 2560c9b3224816ffd371a62103f65b3aca301ad5)
        
        Autobuild-User(v4-21-test): Jule Anger 
        Autobuild-Date(v4-21-test): Mon Jul  7 15:42:19 UTC 2025 on atb-devel-224
    
    commit fc13e0918fddac18800790926a71a9e60f8b95df
    Author: Stefan Metzmacher 
    Date:   Fri May 9 09:38:41 2025 +0200
    
        s3:winbindd: avoid using any netlogon call to get a dc name
        
        BUG: https://bugzilla.samba.org/show_bug.cgi?id=15876
        
        Signed-off-by: Stefan Metzmacher 
        Reviewed-by: Guenther Deschner 
        Reviewed-by: Andreas Schneider 
        Reviewed-by: Ralph Boehme 
        (cherry picked from commit f86a4bf6848ade2db7229d182576db3320c3ece7)
    
    -----------------------------------------------------------------------
    
    Summary of changes:
     source3/winbindd/wb_queryuser.c      |  17 +++-
     source3/winbindd/wb_sids2xids.c      |  17 +++-
     source3/winbindd/wb_xids2sids.c      |  12 ++-
     source3/winbindd/winbindd_cm.c       | 150 -----------------------------------
     source3/winbindd/winbindd_dual.c     |   6 +-
     source3/winbindd/winbindd_dual_srv.c | 105 ++----------------------
     source3/winbindd/winbindd_proto.h    |   1 +
     source3/winbindd/winbindd_util.c     |  19 +++++
     8 files changed, 65 insertions(+), 262 deletions(-)
    
    
    Changeset truncated at 500 lines:
    
    diff --git a/source3/winbindd/wb_queryuser.c b/source3/winbindd/wb_queryuser.c
    index c2758f1b76a..db8e946ba71 100644
    --- a/source3/winbindd/wb_queryuser.c
    +++ b/source3/winbindd/wb_queryuser.c
    @@ -289,10 +289,19 @@ static void wb_queryuser_done(struct tevent_req *subreq)
     
     	if (NT_STATUS_EQUAL(result, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND) &&
     	    !state->tried_dclookup) {
    -		D_DEBUG("GetNssInfo got DOMAIN_CONTROLLER_NOT_FOUND, calling wb_dsgetdcname_send()\n");
    -		subreq = wb_dsgetdcname_send(
    -			state, state->ev, state->info->domain_name, NULL, NULL,
    -			DS_RETURN_DNS_NAME);
    +		const char *domain_name = find_dns_domain_name(
    +			state->info->domain_name);
    +
    +		D_DEBUG("GetNssInfo got DOMAIN_CONTROLLER_NOT_FOUND, calling "
    +			"wb_dsgetdcname_send(%s)\n",
    +			domain_name);
    +
    +		subreq = wb_dsgetdcname_send(state,
    +					     state->ev,
    +					     domain_name,
    +					     NULL,
    +					     NULL,
    +					     DS_RETURN_DNS_NAME);
     		if (tevent_req_nomem(subreq, req)) {
     			return;
     		}
    diff --git a/source3/winbindd/wb_sids2xids.c b/source3/winbindd/wb_sids2xids.c
    index f0f6c23fc20..03e5e7e0258 100644
    --- a/source3/winbindd/wb_sids2xids.c
    +++ b/source3/winbindd/wb_sids2xids.c
    @@ -612,13 +612,22 @@ static void wb_sids2xids_done(struct tevent_req *subreq)
     	    !state->tried_dclookup) {
     
     		struct lsa_DomainInfo *d;
    +		const char *domain_name = NULL;
     
    -		D_DEBUG("Domain controller not found. Calling wb_dsgetdcname_send() to get it.\n");
     		d = &state->idmap_doms.domains[state->dom_index];
     
    -		subreq = wb_dsgetdcname_send(
    -			state, state->ev, d->name.string, NULL, NULL,
    -			DS_RETURN_DNS_NAME);
    +		domain_name = find_dns_domain_name(d->name.string);
    +
    +		D_DEBUG("Domain controller not found. Calling "
    +			"wb_dsgetdcname_send(%s) to get it.\n",
    +			domain_name);
    +
    +		subreq = wb_dsgetdcname_send(state,
    +					     state->ev,
    +					     domain_name,
    +					     NULL,
    +					     NULL,
    +					     DS_RETURN_DNS_NAME);
     		if (tevent_req_nomem(subreq, req)) {
     			return;
     		}
    diff --git a/source3/winbindd/wb_xids2sids.c b/source3/winbindd/wb_xids2sids.c
    index 86bd7f9deab..6fcf524d94f 100644
    --- a/source3/winbindd/wb_xids2sids.c
    +++ b/source3/winbindd/wb_xids2sids.c
    @@ -143,9 +143,15 @@ static void wb_xids2sids_dom_done(struct tevent_req *subreq)
     	if (NT_STATUS_EQUAL(result, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND) &&
     	    !state->tried_dclookup) {
     
    -		subreq = wb_dsgetdcname_send(
    -			state, state->ev, state->dom_map->name, NULL, NULL,
    -			DS_RETURN_DNS_NAME);
    +		const char *domain_name = find_dns_domain_name(
    +			state->dom_map->name);
    +
    +		subreq = wb_dsgetdcname_send(state,
    +					     state->ev,
    +					     domain_name,
    +					     NULL,
    +					     NULL,
    +					     DS_RETURN_DNS_NAME);
     		if (tevent_req_nomem(subreq, req)) {
     			return;
     		}
    diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
    index 24616980af3..9e51ee2acfe 100644
    --- a/source3/winbindd/winbindd_cm.c
    +++ b/source3/winbindd/winbindd_cm.c
    @@ -475,140 +475,6 @@ static bool cm_is_ipc_credentials(struct cli_credentials *creds)
     	return ret;
     }
     
    -static bool get_dc_name_via_netlogon(struct winbindd_domain *domain,
    -				     fstring dcname,
    -				     struct sockaddr_storage *dc_ss,
    -				     uint32_t request_flags)
    -{
    -	struct winbindd_domain *our_domain = NULL;
    -	struct rpc_pipe_client *netlogon_pipe = NULL;
    -	NTSTATUS result;
    -	WERROR werr;
    -	TALLOC_CTX *mem_ctx;
    -	unsigned int orig_timeout;
    -	const char *tmp = NULL;
    -	const char *p;
    -	struct dcerpc_binding_handle *b;
    -
    -	/* Hmmmm. We can only open one connection to the NETLOGON pipe at the
    -	 * moment.... */
    -
    -	if (IS_DC) {
    -		return False;
    -	}
    -
    -	if (domain->primary) {
    -		return False;
    -	}
    -
    -	our_domain = find_our_domain();
    -
    -	if ((mem_ctx = talloc_init("get_dc_name_via_netlogon")) == NULL) {
    -		return False;
    -	}
    -
    -	result = cm_connect_netlogon(our_domain, &netlogon_pipe);
    -	if (!NT_STATUS_IS_OK(result)) {
    -		talloc_destroy(mem_ctx);
    -		return False;
    -	}
    -
    -	b = netlogon_pipe->binding_handle;
    -
    -	/* This call can take a long time - allow the server to time out.
    -	   35 seconds should do it. */
    -
    -	orig_timeout = rpccli_set_timeout(netlogon_pipe, 35000);
    -
    -	if (our_domain->active_directory) {
    -		struct netr_DsRGetDCNameInfo *domain_info = NULL;
    -
    -		/*
    -		 * TODO request flags are not respected in the server
    -		 * (and in some cases, like REQUIRE_PDC, causes an error)
    -		 */
    -		result = dcerpc_netr_DsRGetDCName(b,
    -						  mem_ctx,
    -						  our_domain->dcname,
    -						  domain->name,
    -						  NULL,
    -						  NULL,
    -						  request_flags|DS_RETURN_DNS_NAME,
    -						  &domain_info,
    -						  &werr);
    -		if (NT_STATUS_IS_OK(result) && W_ERROR_IS_OK(werr)) {
    -			tmp = talloc_strdup(
    -				mem_ctx, domain_info->dc_unc);
    -			if (tmp == NULL) {
    -				DBG_ERR("talloc_strdup failed for dc_unc[%s]\n",
    -					domain_info->dc_unc);
    -				talloc_destroy(mem_ctx);
    -				return false;
    -			}
    -			if (domain->alt_name == NULL) {
    -				domain->alt_name = talloc_strdup(domain,
    -								 domain_info->domain_name);
    -				if (domain->alt_name == NULL) {
    -					DBG_ERR("talloc_strdup failed for "
    -						"domain_info->domain_name[%s]\n",
    -						domain_info->domain_name);
    -					talloc_destroy(mem_ctx);
    -					return false;
    -				}
    -			}
    -			if (domain->forest_name == NULL) {
    -				domain->forest_name = talloc_strdup(domain,
    -								    domain_info->forest_name);
    -				if (domain->forest_name == NULL) {
    -					DBG_ERR("talloc_strdup failed for "
    -						"domain_info->forest_name[%s]\n",
    -						domain_info->forest_name);
    -					talloc_destroy(mem_ctx);
    -					return false;
    -				}
    -			}
    -		}
    -	} else {
    -		result = dcerpc_netr_GetAnyDCName(b, mem_ctx,
    -						  our_domain->dcname,
    -						  domain->name,
    -						  &tmp,
    -						  &werr);
    -	}
    -
    -	/* And restore our original timeout. */
    -	rpccli_set_timeout(netlogon_pipe, orig_timeout);
    -
    -	if (!NT_STATUS_IS_OK(result)) {
    -		DEBUG(10,("dcerpc_netr_GetAnyDCName failed: %s\n",
    -			nt_errstr(result)));
    -		talloc_destroy(mem_ctx);
    -		return false;
    -	}
    -
    -	if (!W_ERROR_IS_OK(werr)) {
    -		DEBUG(10,("dcerpc_netr_GetAnyDCName failed: %s\n",
    -			   win_errstr(werr)));
    -		talloc_destroy(mem_ctx);
    -		return false;
    -	}
    -
    -	/* dcerpc_netr_GetAnyDCName gives us a name with \\ */
    -	p = strip_hostname(tmp);
    -
    -	fstrcpy(dcname, p);
    -
    -	talloc_destroy(mem_ctx);
    -
    -	DEBUG(10,("dcerpc_netr_GetAnyDCName returned %s\n", dcname));
    -
    -	if (!resolve_name(dcname, dc_ss, 0x20, true)) {
    -		return False;
    -	}
    -
    -	return True;
    -}
    -
     /**
      * Helper function to assemble trust password and account name
      */
    @@ -1298,24 +1164,8 @@ static bool get_dcs(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
     	struct  samba_sockaddr *sa_list = NULL;
     	size_t     salist_size = 0;
     	size_t     i;
    -	bool    is_our_domain;
     	enum security_types sec = (enum security_types)lp_security();
     
    -	is_our_domain = strequal(domain->name, lp_workgroup());
    -
    -	/* If not our domain, get the preferred DC, by asking our primary DC */
    -	if ( !is_our_domain
    -		&& get_dc_name_via_netlogon(domain, dcname, &ss, request_flags)
    -		&& add_one_dc_unique(mem_ctx, domain->name, dcname, &ss, dcs,
    -		       num_dcs) )
    -	{
    -		char addr[INET6_ADDRSTRLEN];
    -		print_sockaddr(addr, sizeof(addr), &ss);
    -		DEBUG(10, ("Retrieved DC %s at %s via netlogon\n",
    -			   dcname, addr));
    -		return True;
    -	}
    -
     	if ((sec == SEC_ADS) && (domain->alt_name != NULL)) {
     		char *sitename = NULL;
     
    diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
    index c27fa2653f2..6570c3dec23 100644
    --- a/source3/winbindd/winbindd_dual.c
    +++ b/source3/winbindd/winbindd_dual.c
    @@ -532,6 +532,7 @@ static void wb_domain_request_trigger(struct tevent_req *req,
     	struct wb_domain_request_state *state = tevent_req_data(
     		req, struct wb_domain_request_state);
     	struct winbindd_domain *domain = state->domain;
    +	const char *domain_name = NULL;
     	struct tevent_req *subreq = NULL;
     	size_t shortest_queue_length;
     
    @@ -604,8 +605,11 @@ static void wb_domain_request_trigger(struct tevent_req *req,
     	 * which is indicated by DS_RETURN_DNS_NAME.
     	 * For NT4 domains we still get the netbios name.
     	 */
    +
    +	domain_name = find_dns_domain_name(state->domain->name);
    +
     	subreq = wb_dsgetdcname_send(state, state->ev,
    -				     state->domain->name,
    +				     domain_name,
     				     NULL, /* domain_guid */
     				     NULL, /* site_name */
     				     DS_RETURN_DNS_NAME); /* flags */
    diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c
    index 0c7e9dd5491..4f855d424e5 100644
    --- a/source3/winbindd/winbindd_dual_srv.c
    +++ b/source3/winbindd/winbindd_dual_srv.c
    @@ -662,106 +662,11 @@ NTSTATUS _wbint_QueryUserRidList(struct pipes_struct *p,
     
     NTSTATUS _wbint_DsGetDcName(struct pipes_struct *p, struct wbint_DsGetDcName *r)
     {
    -	struct winbindd_domain *domain = wb_child_domain();
    -	struct rpc_pipe_client *netlogon_pipe;
    -	struct netr_DsRGetDCNameInfo *dc_info;
    -	NTSTATUS status;
    -	WERROR werr;
    -	unsigned int orig_timeout;
    -	struct dcerpc_binding_handle *b;
    -	bool retry = false;
    -	bool try_dsrgetdcname = false;
    -
    -	if (domain == NULL) {
    -		return dsgetdcname(p->mem_ctx, global_messaging_context(),
    -				   r->in.domain_name, r->in.domain_guid,
    -				   r->in.site_name ? r->in.site_name : "",
    -				   r->in.flags,
    -				   r->out.dc_info);
    -	}
    -
    -	if (domain->active_directory) {
    -		try_dsrgetdcname = true;
    -	}
    -
    -reconnect:
    -	status = cm_connect_netlogon(domain, &netlogon_pipe);
    -
    -	reset_cm_connection_on_error(domain, NULL, status);
    -	if (!NT_STATUS_IS_OK(status)) {
    -		DEBUG(10, ("Can't contact the NETLOGON pipe\n"));
    -		return status;
    -	}
    -
    -	b = netlogon_pipe->binding_handle;
    -
    -	/* This call can take a long time - allow the server to time out.
    -	   35 seconds should do it. */
    -
    -	orig_timeout = rpccli_set_timeout(netlogon_pipe, 35000);
    -
    -	if (try_dsrgetdcname) {
    -		status = dcerpc_netr_DsRGetDCName(b,
    -			p->mem_ctx, domain->dcname,
    -			r->in.domain_name, NULL, r->in.domain_guid,
    -			r->in.flags, r->out.dc_info, &werr);
    -		if (NT_STATUS_IS_OK(status) && W_ERROR_IS_OK(werr)) {
    -			goto done;
    -		}
    -		if (!retry &&
    -		    reset_cm_connection_on_error(domain, NULL, status))
    -		{
    -			retry = true;
    -			goto reconnect;
    -		}
    -		try_dsrgetdcname = false;
    -		retry = false;
    -	}
    -
    -	/*
    -	 * Fallback to less capable methods
    -	 */
    -
    -	dc_info = talloc_zero(r->out.dc_info, struct netr_DsRGetDCNameInfo);
    -	if (dc_info == NULL) {
    -		status = NT_STATUS_NO_MEMORY;
    -		goto done;
    -	}
    -
    -	if (r->in.flags & DS_PDC_REQUIRED) {
    -		status = dcerpc_netr_GetDcName(b,
    -			p->mem_ctx, domain->dcname,
    -			r->in.domain_name, &dc_info->dc_unc, &werr);
    -	} else {
    -		status = dcerpc_netr_GetAnyDCName(b,
    -			p->mem_ctx, domain->dcname,
    -			r->in.domain_name, &dc_info->dc_unc, &werr);
    -	}
    -
    -	if (!retry && reset_cm_connection_on_error(domain, b, status)) {
    -		retry = true;
    -		goto reconnect;
    -	}
    -	if (!NT_STATUS_IS_OK(status)) {
    -		DEBUG(10, ("dcerpc_netr_Get[Any]DCName failed: %s\n",
    -			   nt_errstr(status)));
    -		goto done;
    -	}
    -	if (!W_ERROR_IS_OK(werr)) {
    -		DEBUG(10, ("dcerpc_netr_Get[Any]DCName failed: %s\n",
    -			   win_errstr(werr)));
    -		status = werror_to_ntstatus(werr);
    -		goto done;
    -	}
    -
    -	*r->out.dc_info = dc_info;
    -	status = NT_STATUS_OK;
    -
    -done:
    -	/* And restore our original timeout. */
    -	rpccli_set_timeout(netlogon_pipe, orig_timeout);
    -
    -	return status;
    +	return dsgetdcname(p->mem_ctx, global_messaging_context(),
    +			   r->in.domain_name, r->in.domain_guid,
    +			   r->in.site_name ? r->in.site_name : "",
    +			   r->in.flags,
    +			   r->out.dc_info);
     }
     
     NTSTATUS _wbint_LookupRids(struct pipes_struct *p, struct wbint_LookupRids *r)
    diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
    index 5b90a7a731f..e318911d192 100644
    --- a/source3/winbindd/winbindd_proto.h
    +++ b/source3/winbindd/winbindd_proto.h
    @@ -610,6 +610,7 @@ bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
     		   struct dom_sid **sids, uint32_t *num_sids);
     bool parse_xidlist(TALLOC_CTX *mem_ctx, const char *xidstr,
     		   struct unixid **pxids, uint32_t *pnum_xids);
    +const char *find_dns_domain_name(const char *domain_name);
     
     /* The following definitions come from winbindd/winbindd_wins.c  */
     
    diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c
    index 2234efeed54..c94d313e9fd 100644
    --- a/source3/winbindd/winbindd_util.c
    +++ b/source3/winbindd/winbindd_util.c
    @@ -2241,3 +2241,22 @@ fail:
     	TALLOC_FREE(xids);
     	return false;
     }
    +
    +/**
    + * Helper to extract the DNS Domain Name from a struct winbindd_domain
    + */
    +const char *find_dns_domain_name(const char *domain_name)
    +{
    +	struct winbindd_domain *wbdom = NULL;
    +
    +	wbdom = find_domain_from_name(domain_name);
    +	if (wbdom == NULL) {
    +		return domain_name;
    +	}
    +
    +	if (wbdom->active_directory && wbdom->alt_name != NULL) {
    +		return wbdom->alt_name;
    +	}
    +
    +	return wbdom->name;
    +}
    
    
    -- 
    Samba Shared Repository
    
    
    From janger at samba.org  Mon Jul  7 15:44:01 2025
    From: janger at samba.org (Jule Anger)
    Date: Mon, 07 Jul 2025 15:44:01 +0000
    Subject: [SCM] Samba Shared Repository - branch v4-22-test updated
    Message-ID: 
    
    The branch, v4-22-test has been updated
           via  78d69a9eebe s3-winbindd: Fix internal winbind dsgetdcname calls w.r.t. domain name
           via  b197ce8c6f1 s3:winbindd: avoid using any netlogon call to get a dc name
          from  7501696d552 lib:util: Disable logging to syslog for startup messages
    
    https://git.samba.org/?p=samba.git;a=shortlog;h=v4-22-test
    
    
    - Log -----------------------------------------------------------------
    commit 78d69a9eebe080aa2bcdf62be8360b581dd1e5f0
    Author: G?nther Deschner 
    Date:   Wed Jul 2 21:59:48 2025 +0200
    
        s3-winbindd: Fix internal winbind dsgetdcname calls w.r.t. domain name
        
        when winbind calls to dsgetdcname internally, make sure to
        prefer the DNS domain name if we have it. Makes DNS lookups much more
        likely to succeed.
        
        BUG: https://bugzilla.samba.org/show_bug.cgi?id=15876
        
        Guenther
        
        Signed-off-by: Guenther Deschner 
        Reviewed-by: Andreas Schneider 
        Reviewed-by: Ralph Boehme 
        
        Autobuild-User(master): Ralph B?hme 
        Autobuild-Date(master): Mon Jul  7 10:44:37 UTC 2025 on atb-devel-224
        
        (cherry picked from commit 2560c9b3224816ffd371a62103f65b3aca301ad5)
        
        Autobuild-User(v4-22-test): Jule Anger 
        Autobuild-Date(v4-22-test): Mon Jul  7 15:43:22 UTC 2025 on atb-devel-224
    
    commit b197ce8c6f155e7d7dd3bd7a9b77172553eb78f7
    Author: Stefan Metzmacher 
    Date:   Fri May 9 09:38:41 2025 +0200
    
        s3:winbindd: avoid using any netlogon call to get a dc name
        
        BUG: https://bugzilla.samba.org/show_bug.cgi?id=15876
        
        Signed-off-by: Stefan Metzmacher 
        Reviewed-by: Guenther Deschner 
        Reviewed-by: Andreas Schneider 
        Reviewed-by: Ralph Boehme 
        (cherry picked from commit f86a4bf6848ade2db7229d182576db3320c3ece7)
    
    -----------------------------------------------------------------------
    
    Summary of changes:
     source3/winbindd/wb_queryuser.c      |  17 +++-
     source3/winbindd/wb_sids2xids.c      |  17 +++-
     source3/winbindd/wb_xids2sids.c      |  12 ++-
     source3/winbindd/winbindd_cm.c       | 150 -----------------------------------
     source3/winbindd/winbindd_dual.c     |   6 +-
     source3/winbindd/winbindd_dual_srv.c | 105 ++----------------------
     source3/winbindd/winbindd_proto.h    |   1 +
     source3/winbindd/winbindd_util.c     |  19 +++++
     8 files changed, 65 insertions(+), 262 deletions(-)
    
    
    Changeset truncated at 500 lines:
    
    diff --git a/source3/winbindd/wb_queryuser.c b/source3/winbindd/wb_queryuser.c
    index c2758f1b76a..db8e946ba71 100644
    --- a/source3/winbindd/wb_queryuser.c
    +++ b/source3/winbindd/wb_queryuser.c
    @@ -289,10 +289,19 @@ static void wb_queryuser_done(struct tevent_req *subreq)
     
     	if (NT_STATUS_EQUAL(result, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND) &&
     	    !state->tried_dclookup) {
    -		D_DEBUG("GetNssInfo got DOMAIN_CONTROLLER_NOT_FOUND, calling wb_dsgetdcname_send()\n");
    -		subreq = wb_dsgetdcname_send(
    -			state, state->ev, state->info->domain_name, NULL, NULL,
    -			DS_RETURN_DNS_NAME);
    +		const char *domain_name = find_dns_domain_name(
    +			state->info->domain_name);
    +
    +		D_DEBUG("GetNssInfo got DOMAIN_CONTROLLER_NOT_FOUND, calling "
    +			"wb_dsgetdcname_send(%s)\n",
    +			domain_name);
    +
    +		subreq = wb_dsgetdcname_send(state,
    +					     state->ev,
    +					     domain_name,
    +					     NULL,
    +					     NULL,
    +					     DS_RETURN_DNS_NAME);
     		if (tevent_req_nomem(subreq, req)) {
     			return;
     		}
    diff --git a/source3/winbindd/wb_sids2xids.c b/source3/winbindd/wb_sids2xids.c
    index f0f6c23fc20..03e5e7e0258 100644
    --- a/source3/winbindd/wb_sids2xids.c
    +++ b/source3/winbindd/wb_sids2xids.c
    @@ -612,13 +612,22 @@ static void wb_sids2xids_done(struct tevent_req *subreq)
     	    !state->tried_dclookup) {
     
     		struct lsa_DomainInfo *d;
    +		const char *domain_name = NULL;
     
    -		D_DEBUG("Domain controller not found. Calling wb_dsgetdcname_send() to get it.\n");
     		d = &state->idmap_doms.domains[state->dom_index];
     
    -		subreq = wb_dsgetdcname_send(
    -			state, state->ev, d->name.string, NULL, NULL,
    -			DS_RETURN_DNS_NAME);
    +		domain_name = find_dns_domain_name(d->name.string);
    +
    +		D_DEBUG("Domain controller not found. Calling "
    +			"wb_dsgetdcname_send(%s) to get it.\n",
    +			domain_name);
    +
    +		subreq = wb_dsgetdcname_send(state,
    +					     state->ev,
    +					     domain_name,
    +					     NULL,
    +					     NULL,
    +					     DS_RETURN_DNS_NAME);
     		if (tevent_req_nomem(subreq, req)) {
     			return;
     		}
    diff --git a/source3/winbindd/wb_xids2sids.c b/source3/winbindd/wb_xids2sids.c
    index 86bd7f9deab..6fcf524d94f 100644
    --- a/source3/winbindd/wb_xids2sids.c
    +++ b/source3/winbindd/wb_xids2sids.c
    @@ -143,9 +143,15 @@ static void wb_xids2sids_dom_done(struct tevent_req *subreq)
     	if (NT_STATUS_EQUAL(result, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND) &&
     	    !state->tried_dclookup) {
     
    -		subreq = wb_dsgetdcname_send(
    -			state, state->ev, state->dom_map->name, NULL, NULL,
    -			DS_RETURN_DNS_NAME);
    +		const char *domain_name = find_dns_domain_name(
    +			state->dom_map->name);
    +
    +		subreq = wb_dsgetdcname_send(state,
    +					     state->ev,
    +					     domain_name,
    +					     NULL,
    +					     NULL,
    +					     DS_RETURN_DNS_NAME);
     		if (tevent_req_nomem(subreq, req)) {
     			return;
     		}
    diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
    index 420ea961876..741761f606b 100644
    --- a/source3/winbindd/winbindd_cm.c
    +++ b/source3/winbindd/winbindd_cm.c
    @@ -475,140 +475,6 @@ static bool cm_is_ipc_credentials(struct cli_credentials *creds)
     	return ret;
     }
     
    -static bool get_dc_name_via_netlogon(struct winbindd_domain *domain,
    -				     fstring dcname,
    -				     struct sockaddr_storage *dc_ss,
    -				     uint32_t request_flags)
    -{
    -	struct winbindd_domain *our_domain = NULL;
    -	struct rpc_pipe_client *netlogon_pipe = NULL;
    -	NTSTATUS result;
    -	WERROR werr;
    -	TALLOC_CTX *mem_ctx;
    -	unsigned int orig_timeout;
    -	const char *tmp = NULL;
    -	const char *p;
    -	struct dcerpc_binding_handle *b;
    -
    -	/* Hmmmm. We can only open one connection to the NETLOGON pipe at the
    -	 * moment.... */
    -
    -	if (IS_DC) {
    -		return False;
    -	}
    -
    -	if (domain->primary) {
    -		return False;
    -	}
    -
    -	our_domain = find_our_domain();
    -
    -	if ((mem_ctx = talloc_init("get_dc_name_via_netlogon")) == NULL) {
    -		return False;
    -	}
    -
    -	result = cm_connect_netlogon(our_domain, &netlogon_pipe);
    -	if (!NT_STATUS_IS_OK(result)) {
    -		talloc_destroy(mem_ctx);
    -		return False;
    -	}
    -
    -	b = netlogon_pipe->binding_handle;
    -
    -	/* This call can take a long time - allow the server to time out.
    -	   35 seconds should do it. */
    -
    -	orig_timeout = rpccli_set_timeout(netlogon_pipe, 35000);
    -
    -	if (our_domain->active_directory) {
    -		struct netr_DsRGetDCNameInfo *domain_info = NULL;
    -
    -		/*
    -		 * TODO request flags are not respected in the server
    -		 * (and in some cases, like REQUIRE_PDC, causes an error)
    -		 */
    -		result = dcerpc_netr_DsRGetDCName(b,
    -						  mem_ctx,
    -						  our_domain->dcname,
    -						  domain->name,
    -						  NULL,
    -						  NULL,
    -						  request_flags|DS_RETURN_DNS_NAME,
    -						  &domain_info,
    -						  &werr);
    -		if (NT_STATUS_IS_OK(result) && W_ERROR_IS_OK(werr)) {
    -			tmp = talloc_strdup(
    -				mem_ctx, domain_info->dc_unc);
    -			if (tmp == NULL) {
    -				DBG_ERR("talloc_strdup failed for dc_unc[%s]\n",
    -					domain_info->dc_unc);
    -				talloc_destroy(mem_ctx);
    -				return false;
    -			}
    -			if (domain->alt_name == NULL) {
    -				domain->alt_name = talloc_strdup(domain,
    -								 domain_info->domain_name);
    -				if (domain->alt_name == NULL) {
    -					DBG_ERR("talloc_strdup failed for "
    -						"domain_info->domain_name[%s]\n",
    -						domain_info->domain_name);
    -					talloc_destroy(mem_ctx);
    -					return false;
    -				}
    -			}
    -			if (domain->forest_name == NULL) {
    -				domain->forest_name = talloc_strdup(domain,
    -								    domain_info->forest_name);
    -				if (domain->forest_name == NULL) {
    -					DBG_ERR("talloc_strdup failed for "
    -						"domain_info->forest_name[%s]\n",
    -						domain_info->forest_name);
    -					talloc_destroy(mem_ctx);
    -					return false;
    -				}
    -			}
    -		}
    -	} else {
    -		result = dcerpc_netr_GetAnyDCName(b, mem_ctx,
    -						  our_domain->dcname,
    -						  domain->name,
    -						  &tmp,
    -						  &werr);
    -	}
    -
    -	/* And restore our original timeout. */
    -	rpccli_set_timeout(netlogon_pipe, orig_timeout);
    -
    -	if (!NT_STATUS_IS_OK(result)) {
    -		DEBUG(10,("dcerpc_netr_GetAnyDCName failed: %s\n",
    -			nt_errstr(result)));
    -		talloc_destroy(mem_ctx);
    -		return false;
    -	}
    -
    -	if (!W_ERROR_IS_OK(werr)) {
    -		DEBUG(10,("dcerpc_netr_GetAnyDCName failed: %s\n",
    -			   win_errstr(werr)));
    -		talloc_destroy(mem_ctx);
    -		return false;
    -	}
    -
    -	/* dcerpc_netr_GetAnyDCName gives us a name with \\ */
    -	p = strip_hostname(tmp);
    -
    -	fstrcpy(dcname, p);
    -
    -	talloc_destroy(mem_ctx);
    -
    -	DEBUG(10,("dcerpc_netr_GetAnyDCName returned %s\n", dcname));
    -
    -	if (!resolve_name(dcname, dc_ss, 0x20, true)) {
    -		return False;
    -	}
    -
    -	return True;
    -}
    -
     /**
      * Helper function to assemble trust password and account name
      */
    @@ -1307,24 +1173,8 @@ static bool get_dcs(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
     	struct  samba_sockaddr *sa_list = NULL;
     	size_t     salist_size = 0;
     	size_t     i;
    -	bool    is_our_domain;
     	enum security_types sec = (enum security_types)lp_security();
     
    -	is_our_domain = strequal(domain->name, lp_workgroup());
    -
    -	/* If not our domain, get the preferred DC, by asking our primary DC */
    -	if ( !is_our_domain
    -		&& get_dc_name_via_netlogon(domain, dcname, &ss, request_flags)
    -		&& add_one_dc_unique(mem_ctx, domain->name, dcname, &ss, dcs,
    -		       num_dcs) )
    -	{
    -		char addr[INET6_ADDRSTRLEN];
    -		print_sockaddr(addr, sizeof(addr), &ss);
    -		DEBUG(10, ("Retrieved DC %s at %s via netlogon\n",
    -			   dcname, addr));
    -		return True;
    -	}
    -
     	if ((sec == SEC_ADS) && (domain->alt_name != NULL)) {
     		char *sitename = NULL;
     
    diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
    index 614727aceb9..622d50c2b91 100644
    --- a/source3/winbindd/winbindd_dual.c
    +++ b/source3/winbindd/winbindd_dual.c
    @@ -532,6 +532,7 @@ static void wb_domain_request_trigger(struct tevent_req *req,
     	struct wb_domain_request_state *state = tevent_req_data(
     		req, struct wb_domain_request_state);
     	struct winbindd_domain *domain = state->domain;
    +	const char *domain_name = NULL;
     	struct tevent_req *subreq = NULL;
     	size_t shortest_queue_length;
     
    @@ -604,8 +605,11 @@ static void wb_domain_request_trigger(struct tevent_req *req,
     	 * which is indicated by DS_RETURN_DNS_NAME.
     	 * For NT4 domains we still get the netbios name.
     	 */
    +
    +	domain_name = find_dns_domain_name(state->domain->name);
    +
     	subreq = wb_dsgetdcname_send(state, state->ev,
    -				     state->domain->name,
    +				     domain_name,
     				     NULL, /* domain_guid */
     				     NULL, /* site_name */
     				     DS_RETURN_DNS_NAME); /* flags */
    diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c
    index 2572588f6d1..e59c42dbcda 100644
    --- a/source3/winbindd/winbindd_dual_srv.c
    +++ b/source3/winbindd/winbindd_dual_srv.c
    @@ -660,106 +660,11 @@ NTSTATUS _wbint_QueryUserRidList(struct pipes_struct *p,
     
     NTSTATUS _wbint_DsGetDcName(struct pipes_struct *p, struct wbint_DsGetDcName *r)
     {
    -	struct winbindd_domain *domain = wb_child_domain();
    -	struct rpc_pipe_client *netlogon_pipe;
    -	struct netr_DsRGetDCNameInfo *dc_info;
    -	NTSTATUS status;
    -	WERROR werr;
    -	unsigned int orig_timeout;
    -	struct dcerpc_binding_handle *b;
    -	bool retry = false;
    -	bool try_dsrgetdcname = false;
    -
    -	if (domain == NULL) {
    -		return dsgetdcname(p->mem_ctx, global_messaging_context(),
    -				   r->in.domain_name, r->in.domain_guid,
    -				   r->in.site_name ? r->in.site_name : "",
    -				   r->in.flags,
    -				   r->out.dc_info);
    -	}
    -
    -	if (domain->active_directory) {
    -		try_dsrgetdcname = true;
    -	}
    -
    -reconnect:
    -	status = cm_connect_netlogon(domain, &netlogon_pipe);
    -
    -	reset_cm_connection_on_error(domain, NULL, status);
    -	if (!NT_STATUS_IS_OK(status)) {
    -		DEBUG(10, ("Can't contact the NETLOGON pipe\n"));
    -		return status;
    -	}
    -
    -	b = netlogon_pipe->binding_handle;
    -
    -	/* This call can take a long time - allow the server to time out.
    -	   35 seconds should do it. */
    -
    -	orig_timeout = rpccli_set_timeout(netlogon_pipe, 35000);
    -
    -	if (try_dsrgetdcname) {
    -		status = dcerpc_netr_DsRGetDCName(b,
    -			p->mem_ctx, domain->dcname,
    -			r->in.domain_name, NULL, r->in.domain_guid,
    -			r->in.flags, r->out.dc_info, &werr);
    -		if (NT_STATUS_IS_OK(status) && W_ERROR_IS_OK(werr)) {
    -			goto done;
    -		}
    -		if (!retry &&
    -		    reset_cm_connection_on_error(domain, NULL, status))
    -		{
    -			retry = true;
    -			goto reconnect;
    -		}
    -		try_dsrgetdcname = false;
    -		retry = false;
    -	}
    -
    -	/*
    -	 * Fallback to less capable methods
    -	 */
    -
    -	dc_info = talloc_zero(r->out.dc_info, struct netr_DsRGetDCNameInfo);
    -	if (dc_info == NULL) {
    -		status = NT_STATUS_NO_MEMORY;
    -		goto done;
    -	}
    -
    -	if (r->in.flags & DS_PDC_REQUIRED) {
    -		status = dcerpc_netr_GetDcName(b,
    -			p->mem_ctx, domain->dcname,
    -			r->in.domain_name, &dc_info->dc_unc, &werr);
    -	} else {
    -		status = dcerpc_netr_GetAnyDCName(b,
    -			p->mem_ctx, domain->dcname,
    -			r->in.domain_name, &dc_info->dc_unc, &werr);
    -	}
    -
    -	if (!retry && reset_cm_connection_on_error(domain, b, status)) {
    -		retry = true;
    -		goto reconnect;
    -	}
    -	if (!NT_STATUS_IS_OK(status)) {
    -		DEBUG(10, ("dcerpc_netr_Get[Any]DCName failed: %s\n",
    -			   nt_errstr(status)));
    -		goto done;
    -	}
    -	if (!W_ERROR_IS_OK(werr)) {
    -		DEBUG(10, ("dcerpc_netr_Get[Any]DCName failed: %s\n",
    -			   win_errstr(werr)));
    -		status = werror_to_ntstatus(werr);
    -		goto done;
    -	}
    -
    -	*r->out.dc_info = dc_info;
    -	status = NT_STATUS_OK;
    -
    -done:
    -	/* And restore our original timeout. */
    -	rpccli_set_timeout(netlogon_pipe, orig_timeout);
    -
    -	return status;
    +	return dsgetdcname(p->mem_ctx, global_messaging_context(),
    +			   r->in.domain_name, r->in.domain_guid,
    +			   r->in.site_name ? r->in.site_name : "",
    +			   r->in.flags,
    +			   r->out.dc_info);
     }
     
     NTSTATUS _wbint_LookupRids(struct pipes_struct *p, struct wbint_LookupRids *r)
    diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
    index 5d428ef2845..08e1c11f29b 100644
    --- a/source3/winbindd/winbindd_proto.h
    +++ b/source3/winbindd/winbindd_proto.h
    @@ -608,6 +608,7 @@ bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
     		   struct dom_sid **sids, uint32_t *num_sids);
     bool parse_xidlist(TALLOC_CTX *mem_ctx, const char *xidstr,
     		   struct unixid **pxids, uint32_t *pnum_xids);
    +const char *find_dns_domain_name(const char *domain_name);
     
     /* The following definitions come from winbindd/winbindd_wins.c  */
     
    diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c
    index 48f4c9a67cb..ceb6a3136fb 100644
    --- a/source3/winbindd/winbindd_util.c
    +++ b/source3/winbindd/winbindd_util.c
    @@ -2230,3 +2230,22 @@ fail:
     	TALLOC_FREE(xids);
     	return false;
     }
    +
    +/**
    + * Helper to extract the DNS Domain Name from a struct winbindd_domain
    + */
    +const char *find_dns_domain_name(const char *domain_name)
    +{
    +	struct winbindd_domain *wbdom = NULL;
    +
    +	wbdom = find_domain_from_name(domain_name);
    +	if (wbdom == NULL) {
    +		return domain_name;
    +	}
    +
    +	if (wbdom->active_directory && wbdom->alt_name != NULL) {
    +		return wbdom->alt_name;
    +	}
    +
    +	return wbdom->name;
    +}
    
    
    -- 
    Samba Shared Repository
    
    
    From janger at samba.org  Mon Jul  7 16:08:59 2025
    From: janger at samba.org (Jule Anger)
    Date: Mon, 07 Jul 2025 16:08:59 +0000
    Subject: [SCM] Samba Shared Repository - branch v4-21-test updated
    Message-ID: 
    
    The branch, v4-21-test has been updated
           via  693e4eaf28b VERSION: Bump version up to Samba 4.21.8...
           via  5da3e988292 VERSION: Disable GIT_SNAPSHOT for the 4.21.7 release.
           via  19f7837e498 WHATSNEW: Add release notes for Samba 4.21.7.
          from  1967ce81998 s3-winbindd: Fix internal winbind dsgetdcname calls w.r.t. domain name
    
    https://git.samba.org/?p=samba.git;a=shortlog;h=v4-21-test
    
    
    - Log -----------------------------------------------------------------
    commit 693e4eaf28b9ef0a52bd10eb686ce13150db20f2
    Author: Jule Anger 
    Date:   Mon Jul 7 18:06:15 2025 +0200
    
        VERSION: Bump version up to Samba 4.21.8...
        
        and re-enable GIT_SNAPSHOT.
        
        Signed-off-by: Jule Anger 
    
    commit 5da3e988292b70c9fe6e9aaae7e34c215fe3d6c0
    Author: Jule Anger 
    Date:   Mon Jul 7 18:05:48 2025 +0200
    
        VERSION: Disable GIT_SNAPSHOT for the 4.21.7 release.
        
        Signed-off-by: Jule Anger 
    
    commit 19f7837e4989e64ebe713976942ed229a7de09fe
    Author: Jule Anger 
    Date:   Mon Jul 7 18:05:10 2025 +0200
    
        WHATSNEW: Add release notes for Samba 4.21.7.
        
        Signed-off-by: Jule Anger 
    
    -----------------------------------------------------------------------
    
    Summary of changes:
     VERSION      |  2 +-
     WHATSNEW.txt | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
     2 files changed, 84 insertions(+), 3 deletions(-)
    
    
    Changeset truncated at 500 lines:
    
    diff --git a/VERSION b/VERSION
    index dede2e3c958..bade3afb096 100644
    --- a/VERSION
    +++ b/VERSION
    @@ -27,7 +27,7 @@ SAMBA_COPYRIGHT_STRING="Copyright Andrew Tridgell and the Samba Team 1992-2024"
     ########################################################
     SAMBA_VERSION_MAJOR=4
     SAMBA_VERSION_MINOR=21
    -SAMBA_VERSION_RELEASE=7
    +SAMBA_VERSION_RELEASE=8
     
     ########################################################
     # If a official release has a serious bug              #
    diff --git a/WHATSNEW.txt b/WHATSNEW.txt
    index b8967d54c82..127fd8a3811 100644
    --- a/WHATSNEW.txt
    +++ b/WHATSNEW.txt
    @@ -1,3 +1,85 @@
    +                   ==============================
    +                   Release Notes for Samba 4.21.7
    +                           July 07, 2025
    +                   ==============================
    +
    +
    +This is the latest stable release of the Samba 4.21 release series.
    +
    +
    +Important Change in Upcoming Microsoft Update
    +---------------------------------------------
    +
    +On 8th of July, Microsoft will release an important security update for
    +Active Directory Domain Controllers for Windows Server versions prior to
    +2025.
    +
    +This update includes a change to the Microsoft RPC Netlogon protocol,
    +which improves security by tightening access checks for a set of RPC
    +requests. Samba running as domain members in these environments will be
    +impacted by this change if a specific configuration is used, see below
    +for which configuration is affected.
    +
    +Windows Server version 2025 is already equipped with these specific
    +security hardenings, and Microsoft is now planning to deploy them to all
    +supported Windows Server versions down to Windows Server 2008.
    +
    +
    +Who is affected?
    +
    +Samba installations acting as member servers in Windows AD domains will
    +be affected if they are configured to use the 'ad' idmapping backend.
    +Samba servers not using this configuration will not be affected by the
    +change ? at least to our current knowledge and understanding of the
    +change ? and no further action is required.
    +
    +Current versions of Samba with the affected configuration will no longer
    +function correctly once the Microsoft update has been applied. Users
    +will not be able to connect to the SMB service provided by Samba for any
    +domain configured to use the 'ad' idmapping backend.
    +
    +See https://bugzilla.samba.org/show_bug.cgi?id=15876.
    +
    +Changes since 4.21.6
    +--------------------
    +
    +o  G?nther Deschner 
    +   * BUG 15876: Windows security hardening locks out schannel'ed netlogon dc
    +     calls like netr_DsRGetDCName.
    +
    +o  Stefan Metzmacher 
    +   * BUG 15680: Trust domains are not created.
    +   * BUG 15876: Windows security hardening locks out schannel'ed netlogon dc
    +     calls like netr_DsRGetDCName.
    +
    +o  Andreas Schneider 
    +   * BUG 15680: Trust domains are not created.
    +   * BUG 15869: Startup messages of rpc deamons fills /var/log/messages.
    +
    +
    +#######################################
    +Reporting bugs & Development Discussion
    +#######################################
    +
    +Please discuss this release on the samba-technical mailing list or by
    +joining the #samba-technical:matrix.org matrix room, or
    +#samba-technical IRC channel on irc.libera.chat.
    +
    +If you do report problems then please try to send high quality
    +feedback. If you don't provide vital information to help us track down
    +the problem then you will probably be ignored.  All bug reports should
    +be filed under the Samba 4.1 and newer product in the project's Bugzilla
    +database (https://bugzilla.samba.org/).
    +
    +
    +======================================================================
    +== Our Code, Our Bugs, Our Responsibility.
    +== The Samba Team
    +======================================================================
    +
    +
    +Release notes for older releases follow:
    +----------------------------------------
                        ==============================
                        Release Notes for Samba 4.21.6
                                June 03, 2025
    @@ -92,8 +174,7 @@ database (https://bugzilla.samba.org/).
     ======================================================================
     
     
    -Release notes for older releases follow:
    -----------------------------------------
    +----------------------------------------------------------------------
                        ==============================
                        Release Notes for Samba 4.21.5
                                March 31, 2025
    
    
    -- 
    Samba Shared Repository
    
    
    From janger at samba.org  Mon Jul  7 16:12:52 2025
    From: janger at samba.org (Jule Anger)
    Date: Mon, 07 Jul 2025 16:12:52 +0000
    Subject: [SCM] Samba Shared Repository - annotated tag samba-4.21.7 created
    Message-ID: 
    
    The annotated tag, samba-4.21.7 has been created
            at  e1c081f5754ec2e131b516844ecf1a74055bd172 (tag)
       tagging  5da3e988292b70c9fe6e9aaae7e34c215fe3d6c0 (commit)
      replaces  samba-4.21.6
     tagged by  Jule Anger
            on  Mon Jul 7 18:11:05 2025 +0200
    
    - Log -----------------------------------------------------------------
    samba: tag release samba-4.21.7
    -----BEGIN PGP SIGNATURE-----
    
    iQIzBAABCgAdFiEEgfXigyvSVFoYl7cTqplEL7aAtiAFAmhr8ZoACgkQqplEL7aA
    tiDhrA/6AwMXY3OXNDhZZy2Rw3HFCMtPpNkh3wNEWQD9Mmm8tWQJ2YT1MLWcoGQX
    NQR0QT/K/ySnIiId19k/aVo2lXxh0AcTDJ0tp55fbt1aGJ5W8C1bvoX3uA5ktyAQ
    7HeMYsZxJgL1deluSe+o3mq/xE0uRsrGPTSIHmUEnXvBXPi/UFfADxqP+NQenfXj
    9qJJ2nfM6Uez9jmkM9t3JQ4szYiuwVf7zAOPfMo3vPAH/9wSGWJ459CrrDF/4/PH
    mKIdIbPJ5rQOPd4T3WDc69uo42y9+Tl33eCpHFV+mp6dPBWOZRBfGRci1Xn0xMEN
    euSmdfdYxKdRpjfLD6YXWT1D2Gv/2/uORHBdWfs44CRvlp5xYYoVS8ko9JqI+xll
    kvAG+s3RJuQfWA+LMeH7yp+5gsTl46XDpyQFct7lIGx1pWzxvD2T8/otEb7ipXEs
    3OLmUiTpdHeg1PCJzjxwDI6JLfdvz7mVyD7Q3bcBVitMsG3Jr9ECYem/6aB3Epsy
    1XFP/TvTh9FkgZc03MvAcOx4r+Lc5wmoHDAk+ljgdfHorCepeUcZcXYpc9yQyNxL
    wHl+X8z6gEeMBRM8Yxih2wJjhjnbEAdr3cOMkWNT3EzbD4qWEJHt9h639I8pcHyn
    j1ABYi6d4dmgmed0Hq5Qj/3TWK2IpSVcp8ojae1V4QH5uNN8VRA=
    =q0Lk
    -----END PGP SIGNATURE-----
    
    Andreas Schneider (3):
          pidl: Update documentation for DCERPC interface connections
          python:lsa_utils: Don't use optional arguments for OpenPolicyFallback()
          lib:util: Disable logging to syslog for startup messages
    
    G?nther Deschner (1):
          s3-winbindd: Fix internal winbind dsgetdcname calls w.r.t. domain name
    
    Jule Anger (3):
          VERSION: Bump version up to Samba 4.21.7...
          WHATSNEW: Add release notes for Samba 4.21.7.
          VERSION: Disable GIT_SNAPSHOT for the 4.21.7 release.
    
    Stefan Metzmacher (79):
          librpc/rpc: map DCERPC_NCA_S_SERVER_TOO_BUSY to NT_STATUS_RPC_SERVER_TOO_BUSY
          librpc/rpc: map DCERPC_NCA_S_UNSUPPORTED_TYPE to NT_STATUS_RPC_UNSUPPORTED_TYPE
          s4:torture/rpc: avoid checking p->last_fault_code in iremotewinspool*
          s4:torture/rpc: remove useless usage of DCERPC_SIGN, DCERPC_SEAL
          s4:torture/rpc: avoid using DCERPC_NDR_REF_ALLOC in fsrvp.c
          librpc/rpc: add dcerpc_binding_handle_transport_{encrypted,session_key}()
          s4:librpc/rpc: add dcerpc_bh_transport_{encrypted,session_key}()
          s3:rpc_client: add rpccli_bh_transport_session_key()
          s4:pyrpc: let py_iface_transport_encrypted() use dcerpc_binding_handle_transport_encrypted()
          s4:librpc/rpc: remove unused dcerpc_transport_encrypted()
          s4:libnet: add struct dcerpc_binding_handle helper variables in libnet_passwd.c
          s4:libnet: make use of dcerpc_binding_handle_transport_session_key() in libnet_passwd.c
          xss4:pyrpc: make use of dcerpc_binding_handle_transport_session_key()
          s4:torture/rpc: make use of dcerpc_binding_handle_transport_session_key()
          s4:librpc/rpc: remove unused dcerpc_fetch_session_key()
          librpc/rpc: add dcerpc_binding_handle_auth_session_key()
          s4:librpc/rpc: add dcerpc_bh_auth_session_key()
          s3:rpc_client: add rpccli_bh_auth_session_key()
          s4:drepl: make use of dcerpc_binding_handle_auth_session_key()
          s4:libnet: make use of dcerpc_binding_handle_auth_session_key() in libnet_become_dc.c
          s4:py_net: make use of dcerpc_binding_handle_auth_session_key()
          s4:pyrpc: make use of dcerpc_binding_handle_auth_session_key()
          s4:torture/drs: make use of dcerpc_binding_handle_auth_session_key()
          s3:lib/netapi: make use of dcerpc_binding_handle_transport_session_key()
          s3:libnet_join: make use of dcerpc_binding_handle_transport_session_key()
          s3:utils/net_rpc: make use of dcerpc_binding_handle_transport_session_key()
          s3:rpc_client: make use of dcerpc_binding_handle_transport_session_key()
          s3:libnet_dssync: make use of dcerpc_binding_handle_auth_session_key()
          s3:rpcclient/cli_drsuapi: make use of dcerpc_binding_handle_auth_session_key()
          s3:rpc_client: remove unused cli_get_session_key()
          s3:rpc_client: the transport_session_key is per connection!
          s3:rpcclient: make use of dcerpc_binding_handle_auth_info()
          s3:winbindd: cm_connect_lsa_tcp() doesn't need to check for NCACN_IP_TCP or LEVEL_INTEGRITY
          s3:rpc_client: make use of struct samba_sockaddr in rpc_pipe_open_ncalrpc()
          s3:rpc_client: header signing is negotiated per transport connection
          librpc/rpc: add get_binding() to dcerpc_binding_handle_ops
          libcli/tstream_binding_handle: implement get_binding()
          s4:lib/messaging: implement irpc_bh_get_binding()
          s3:winbindd: implement wbint_bh_get_binding() in winbindd_dual_ndr.c
          s4:librpc/rpc: call dcerpc_binding_set_abstract_syntax after bind or alter context
          s4:librpc/rpc: implement dcerpc_bh_get_binding()
          s3:rpc_client: implement rpccli_bh_get_binding()
          librpc/rpc: add dcerpc_binding_handle_get_binding()
          librpc/rpc: add dcerpc_binding_handle_get_transport() helper function
          librpc/rpc: un-const dcerpc_default_transport_endpoint()
          s4:libnet: make use of dcerpc_binding_handle_get_binding()
          s4:libnet: make use of dcerpc_binding_handle_get_transport()
          s4:torture/rpc: make use of dcerpc_binding_handle_get_binding() and dcerpc_binding_get_flags()
          s4:tortore/rpc: make use of dcerpc_binding_get_abstract_syntax() and dcerpc_binding_get_flags()
          s4:torture/rpc: make use of dcerpc_binding_handle_get_transport()
          s4:librpc: make all but dcerpc_pipe->binding_handle internal struct members
          s3:rpc_client: remember rpc_pipe_client->print_username
          s3:rpc_client: remove references to rpc_pipe_client from wsp_cli.c
          s3:winbindd: make use of dcerpc_binding_handle_get_transport()
          s3:rpcclient: make use of dcerpc_binding_handle_get_transport()
          s3:lib/netapi: make use of dcerpc_binding_get_abstract_syntax()
          s3:libsmb: make use of dcerpc_binding_get_abstract_syntax()
          s3:librpc/rpc: split out dcerpc_internal.h for struct pipe_auth_data
          s3:rpc_client: make most of rpc_pipe_client internal struct members
          s3:rpc_client: only pass the pipe_name to rpc_transport_np_init_send()
          s3:rpc_client: add struct rpc_client_{association,connection} and helpers
          s3:rpc_client: convert rpc_pipe_open_ncalrpc() to rpc_client_{association,connection}
          s3:rpc_client: convert rpc_pipe_open_local_np() to rpc_client_{association,connection}
          s3:rpc_client: convert rpc_pipe_open_tcp_port() to rpc_client_{association,connection}
          s3:rpc_client: convert rpc_pipe_open_np() to rpc_client_{association,connection}
          s3:rpc_client: let cli_rpc_pipe_open() use rpc_client_connection_np()
          s3:rpc_client: make real use of rpc_client_{association,connection}
          s3:rpc_client: add cli_rpc_pipe_client_prepare_alter() helper
          s3:rpc_client: split out cli_rpc_pipe_client_auth_schannel()
          s3:rpc_client: add missing TALLOC_FREE(frame) in cli_rpc_pipe_open()
          s3:rpc_client: remember the local/remote ipv4 or ipv6 addresses
          s3:cli_pipe: pass target_service to cli_rpc_pipe_open_with_creds()
          s3:rpc_client: Add cli_rpc_pipe_reopen_np_noauth()
          s3:rpc_cerver: Use dcerpc_lsa_open_policy3() for internal RPC
          s3:rpc_client: Use cli_rpc_pipe_reopen_np_noauth() for OpenPolicy fallback
          dcesrv_core: Make dcesrv_call_disconnect_after() public
          librpc:pyrpc: Allow new authenticated rpc connection on the same transport as the basis_connection
          python:lsa_utils: Fix fallback to OpenPolicy2
          s3:winbindd: avoid using any netlogon call to get a dc name
    
    -----------------------------------------------------------------------
    
    
    -- 
    Samba Shared Repository
    
    
    From janger at samba.org  Mon Jul  7 16:13:31 2025
    From: janger at samba.org (Jule Anger)
    Date: Mon, 07 Jul 2025 16:13:31 +0000
    Subject: [SCM] Samba Shared Repository - branch v4-21-stable updated
    Message-ID: 
    
    The branch, v4-21-stable has been updated
           via  5da3e988292 VERSION: Disable GIT_SNAPSHOT for the 4.21.7 release.
           via  19f7837e498 WHATSNEW: Add release notes for Samba 4.21.7.
           via  1967ce81998 s3-winbindd: Fix internal winbind dsgetdcname calls w.r.t. domain name
           via  fc13e0918fd s3:winbindd: avoid using any netlogon call to get a dc name
           via  3490e76342a lib:util: Disable logging to syslog for startup messages
           via  ccb5e9694e3 python:lsa_utils: Fix fallback to OpenPolicy2
           via  b106c7d77ae python:lsa_utils: Don't use optional arguments for OpenPolicyFallback()
           via  e8e6b68539b pidl: Update documentation for DCERPC interface connections
           via  0a0d87f4093 librpc:pyrpc: Allow new authenticated rpc connection on the same transport as the basis_connection
           via  30b077b6781 dcesrv_core: Make dcesrv_call_disconnect_after() public
           via  1cbbe56266b s3:rpc_client: Use cli_rpc_pipe_reopen_np_noauth() for OpenPolicy fallback
           via  4ae32d6faa0 s3:rpc_cerver: Use dcerpc_lsa_open_policy3() for internal RPC
           via  fe5b8928443 s3:rpc_client: Add cli_rpc_pipe_reopen_np_noauth()
           via  1ba2acc9fc9 s3:cli_pipe: pass target_service to cli_rpc_pipe_open_with_creds()
           via  22900d278cb s3:rpc_client: remember the local/remote ipv4 or ipv6 addresses
           via  e568b119340 s3:rpc_client: add missing TALLOC_FREE(frame) in cli_rpc_pipe_open()
           via  4ead8424471 s3:rpc_client: split out cli_rpc_pipe_client_auth_schannel()
           via  bf717ca5c4d s3:rpc_client: add cli_rpc_pipe_client_prepare_alter() helper
           via  75e1c18d912 s3:rpc_client: make real use of rpc_client_{association,connection}
           via  cb3e074ec54 s3:rpc_client: let cli_rpc_pipe_open() use rpc_client_connection_np()
           via  4b1f27c3202 s3:rpc_client: convert rpc_pipe_open_np() to rpc_client_{association,connection}
           via  f019fa98dbf s3:rpc_client: convert rpc_pipe_open_tcp_port() to rpc_client_{association,connection}
           via  f81ee3b6d0f s3:rpc_client: convert rpc_pipe_open_local_np() to rpc_client_{association,connection}
           via  6f67e05fb70 s3:rpc_client: convert rpc_pipe_open_ncalrpc() to rpc_client_{association,connection}
           via  8dc83405eeb s3:rpc_client: add struct rpc_client_{association,connection} and helpers
           via  e42835a2f5f s3:rpc_client: only pass the pipe_name to rpc_transport_np_init_send()
           via  7e02cf063ac s3:rpc_client: make most of rpc_pipe_client internal struct members
           via  6c43234a06b s3:librpc/rpc: split out dcerpc_internal.h for struct pipe_auth_data
           via  6af9f50396d s3:libsmb: make use of dcerpc_binding_get_abstract_syntax()
           via  33b0b4bfe5f s3:lib/netapi: make use of dcerpc_binding_get_abstract_syntax()
           via  61a5a72a3cd s3:rpcclient: make use of dcerpc_binding_handle_get_transport()
           via  523484d1882 s3:winbindd: make use of dcerpc_binding_handle_get_transport()
           via  86e27e94b2b s3:rpc_client: remove references to rpc_pipe_client from wsp_cli.c
           via  2f753ed81ce s3:rpc_client: remember rpc_pipe_client->print_username
           via  91e8d63c638 s4:librpc: make all but dcerpc_pipe->binding_handle internal struct members
           via  ba777ee0532 s4:torture/rpc: make use of dcerpc_binding_handle_get_transport()
           via  a57ec7313cd s4:tortore/rpc: make use of dcerpc_binding_get_abstract_syntax() and dcerpc_binding_get_flags()
           via  087ccbdd863 s4:torture/rpc: make use of dcerpc_binding_handle_get_binding() and dcerpc_binding_get_flags()
           via  2ca22d00411 s4:libnet: make use of dcerpc_binding_handle_get_transport()
           via  5e2606c5ea3 s4:libnet: make use of dcerpc_binding_handle_get_binding()
           via  2edaf617e86 librpc/rpc: un-const dcerpc_default_transport_endpoint()
           via  57d161d54f0 librpc/rpc: add dcerpc_binding_handle_get_transport() helper function
           via  e94025e1a8e librpc/rpc: add dcerpc_binding_handle_get_binding()
           via  bac9282844a s3:rpc_client: implement rpccli_bh_get_binding()
           via  1ed6f5c6692 s4:librpc/rpc: implement dcerpc_bh_get_binding()
           via  d2d951bddd4 s4:librpc/rpc: call dcerpc_binding_set_abstract_syntax after bind or alter context
           via  a89c2664f68 s3:winbindd: implement wbint_bh_get_binding() in winbindd_dual_ndr.c
           via  296b5cd0665 s4:lib/messaging: implement irpc_bh_get_binding()
           via  51dc661d261 libcli/tstream_binding_handle: implement get_binding()
           via  20a42d2ca1b librpc/rpc: add get_binding() to dcerpc_binding_handle_ops
           via  3731bbfdc4a s3:rpc_client: header signing is negotiated per transport connection
           via  daefb7b2436 s3:rpc_client: make use of struct samba_sockaddr in rpc_pipe_open_ncalrpc()
           via  3db4cfe8a33 s3:winbindd: cm_connect_lsa_tcp() doesn't need to check for NCACN_IP_TCP or LEVEL_INTEGRITY
           via  1ff49833b6e s3:rpcclient: make use of dcerpc_binding_handle_auth_info()
           via  277f9ff99a8 s3:rpc_client: the transport_session_key is per connection!
           via  b640002afd6 s3:rpc_client: remove unused cli_get_session_key()
           via  95f7152911a s3:rpcclient/cli_drsuapi: make use of dcerpc_binding_handle_auth_session_key()
           via  3200bd21d4d s3:libnet_dssync: make use of dcerpc_binding_handle_auth_session_key()
           via  8c695f13b6b s3:rpc_client: make use of dcerpc_binding_handle_transport_session_key()
           via  5f1f651d0e5 s3:utils/net_rpc: make use of dcerpc_binding_handle_transport_session_key()
           via  505775ba876 s3:libnet_join: make use of dcerpc_binding_handle_transport_session_key()
           via  7092b9abf1d s3:lib/netapi: make use of dcerpc_binding_handle_transport_session_key()
           via  c924b4420de s4:torture/drs: make use of dcerpc_binding_handle_auth_session_key()
           via  c1875485f4b s4:pyrpc: make use of dcerpc_binding_handle_auth_session_key()
           via  dd0c6b46880 s4:py_net: make use of dcerpc_binding_handle_auth_session_key()
           via  37768515a52 s4:libnet: make use of dcerpc_binding_handle_auth_session_key() in libnet_become_dc.c
           via  7fae08c9dcd s4:drepl: make use of dcerpc_binding_handle_auth_session_key()
           via  2b7ae6f61af s3:rpc_client: add rpccli_bh_auth_session_key()
           via  0c0f83127cb s4:librpc/rpc: add dcerpc_bh_auth_session_key()
           via  ece818eb50c librpc/rpc: add dcerpc_binding_handle_auth_session_key()
           via  a835a9b2f58 s4:librpc/rpc: remove unused dcerpc_fetch_session_key()
           via  21882daef2e s4:torture/rpc: make use of dcerpc_binding_handle_transport_session_key()
           via  1fe021a0c41 xss4:pyrpc: make use of dcerpc_binding_handle_transport_session_key()
           via  9aa2be36397 s4:libnet: make use of dcerpc_binding_handle_transport_session_key() in libnet_passwd.c
           via  0b5624e50d3 s4:libnet: add struct dcerpc_binding_handle helper variables in libnet_passwd.c
           via  b1be2bb12d9 s4:librpc/rpc: remove unused dcerpc_transport_encrypted()
           via  7e5ac988114 s4:pyrpc: let py_iface_transport_encrypted() use dcerpc_binding_handle_transport_encrypted()
           via  30134801b6d s3:rpc_client: add rpccli_bh_transport_session_key()
           via  f596c49585f s4:librpc/rpc: add dcerpc_bh_transport_{encrypted,session_key}()
           via  c4990ed56f7 librpc/rpc: add dcerpc_binding_handle_transport_{encrypted,session_key}()
           via  b7cd9cf02aa s4:torture/rpc: avoid using DCERPC_NDR_REF_ALLOC in fsrvp.c
           via  5047e9863b9 s4:torture/rpc: remove useless usage of DCERPC_SIGN, DCERPC_SEAL
           via  59c5354117c s4:torture/rpc: avoid checking p->last_fault_code in iremotewinspool*
           via  a91f4b27c18 librpc/rpc: map DCERPC_NCA_S_UNSUPPORTED_TYPE to NT_STATUS_RPC_UNSUPPORTED_TYPE
           via  27b0b2c2dde librpc/rpc: map DCERPC_NCA_S_SERVER_TOO_BUSY to NT_STATUS_RPC_SERVER_TOO_BUSY
           via  a3e57f9df27 VERSION: Bump version up to Samba 4.21.7...
          from  b901f39a1d0 VERSION: Disable GIT_SNAPSHOT for the 4.21.6 release.
    
    https://git.samba.org/?p=samba.git;a=shortlog;h=v4-21-stable
    
    
    - Log -----------------------------------------------------------------
    -----------------------------------------------------------------------
    
    Summary of changes:
     VERSION                                            |    2 +-
     WHATSNEW.txt                                       |   85 +-
     lib/util/debug.c                                   |   15 +
     lib/util/debug.h                                   |    9 +
     .../tstream_binding_handle.c                       |   19 +
     librpc/rpc/binding_handle.c                        |   44 +
     librpc/rpc/dcerpc_error.c                          |    4 +-
     librpc/rpc/dcerpc_util.c                           |    8 +-
     librpc/rpc/dcerpc_util.h                           |    6 +-
     librpc/rpc/dcesrv_core.c                           |    4 +-
     librpc/rpc/dcesrv_core.h                           |    3 +
     librpc/rpc/rpc_common.h                            |   26 +
     pidl/lib/Parse/Pidl/Samba4/Python.pm               |   29 +-
     python/samba/lsa_utils.py                          |   67 +-
     python/samba/netcmd/domain/trust.py                |   93 +-
     python/samba/tests/dcerpc/lsa_utils.py             |   51 +-
     source3/lib/netapi/cm.c                            |   15 +-
     source3/lib/netapi/joindomain.c                    |   12 +-
     source3/lib/netapi/localgroup.c                    |    2 +-
     source3/lib/netapi/user.c                          |    6 +-
     source3/libnet/libnet_dssync.c                     |   17 +-
     source3/libnet/libnet_join.c                       |    3 +-
     source3/librpc/rpc/dcerpc.h                        |   17 +-
     source3/librpc/rpc/dcerpc_helpers.c                |    1 +
     .../librpc/rpc/dcerpc_internal.h                   |   22 +-
     source3/libsmb/libsmb_xattr.c                      |   10 +-
     source3/libsmb/passchange.c                        |    1 +
     source3/rpc_client/cli_lsarpc.c                    |   15 +-
     source3/rpc_client/cli_lsarpc.h                    |    4 +-
     source3/rpc_client/cli_pipe.c                      | 1781 +++++++++++++++-----
     source3/rpc_client/cli_pipe.h                      |   21 +-
     source3/rpc_client/cli_spoolss.c                   |    6 +-
     source3/rpc_client/rpc_client.h                    |   39 +-
     source3/rpc_client/rpc_transport.h                 |    2 +-
     source3/rpc_client/rpc_transport_np.c              |    5 +-
     source3/rpc_client/wsp_cli.c                       |   71 +-
     source3/rpc_server/netlogon/srv_netlog_nt.c        |    2 +-
     source3/rpcclient/cmd_drsuapi.c                    |   15 +-
     source3/rpcclient/cmd_iremotewinspool.c            |    3 +-
     source3/rpcclient/cmd_lsarpc.c                     |   75 +-
     source3/rpcclient/cmd_samr.c                       |    3 +-
     source3/rpcclient/rpcclient.c                      |   26 +-
     source3/utils/net_rpc.c                            |   13 +-
     source3/utils/net_rpc_printer.c                    |    3 +-
     source3/utils/net_rpc_rights.c                     |    4 +-
     source3/utils/net_rpc_trust.c                      |    5 +-
     source3/winbindd/wb_queryuser.c                    |   17 +-
     source3/winbindd/wb_sids2xids.c                    |   17 +-
     source3/winbindd/wb_xids2sids.c                    |   12 +-
     source3/winbindd/winbindd_cm.c                     |  158 +-
     source3/winbindd/winbindd_dual.c                   |    6 +-
     source3/winbindd/winbindd_dual_ndr.c               |   47 +-
     source3/winbindd/winbindd_dual_srv.c               |  105 +-
     source3/winbindd/winbindd_msrpc.c                  |    4 +-
     source3/winbindd/winbindd_proto.h                  |    1 +
     source3/winbindd/winbindd_rpc.c                    |    7 +-
     source3/winbindd/winbindd_util.c                   |   19 +
     source3/wscript_build                              |    2 +-
     source4/dsdb/repl/drepl_out_helpers.c              |    7 +-
     source4/lib/messaging/messaging.c                  |   44 +-
     source4/libnet/libnet_become_dc.c                  |   29 +-
     source4/libnet/libnet_join.c                       |    3 +-
     source4/libnet/libnet_passwd.c                     |   55 +-
     source4/libnet/libnet_rpc.c                        |   27 +-
     source4/libnet/py_net.c                            |   12 +-
     source4/librpc/rpc/dcerpc.c                        |  121 ++
     source4/librpc/rpc/dcerpc.h                        |   22 +-
     source4/librpc/rpc/dcerpc_auth.c                   |    2 +
     source4/librpc/rpc/dcerpc_connect.c                |    1 +
     source4/librpc/rpc/dcerpc_roh.c                    |    2 +
     source4/librpc/rpc/dcerpc_schannel.c               |    2 +
     source4/librpc/rpc/dcerpc_secondary.c              |    1 +
     source4/librpc/rpc/dcerpc_smb.c                    |    2 +
     source4/librpc/rpc/dcerpc_sock.c                   |    2 +
     source4/librpc/rpc/dcerpc_util.c                   |   34 +-
     source4/librpc/rpc/pyrpc.c                         |   50 +-
     source4/librpc/rpc/pyrpc_util.c                    |   80 +-
     source4/rpc_server/remote/dcesrv_remote.c          |    2 +
     source4/torture/drs/rpc/dssync.c                   |    5 +-
     source4/torture/drs/rpc/msds_intid.c               |    5 +-
     source4/torture/rpc/alter_context.c                |   36 +-
     source4/torture/rpc/backupkey.c                    |    9 +-
     source4/torture/rpc/bind.c                         |    4 +-
     source4/torture/rpc/drsuapi.c                      |    5 +-
     source4/torture/rpc/dsgetinfo.c                    |    4 +-
     source4/torture/rpc/echo.c                         |   17 +-
     source4/torture/rpc/forest_trust.c                 |    5 +-
     source4/torture/rpc/fsrvp.c                        |   72 +-
     source4/torture/rpc/handles.c                      |   28 +-
     source4/torture/rpc/iremotewinspool.c              |   22 +-
     source4/torture/rpc/iremotewinspool_common.c       |    4 -
     source4/torture/rpc/iremotewinspool_common.h       |    1 -
     source4/torture/rpc/lsa.c                          |   22 +-
     source4/torture/rpc/lsa_lookup.c                   |    5 +-
     source4/torture/rpc/netlogon.c                     |   30 +-
     source4/torture/rpc/samba3rpc.c                    |   19 +-
     source4/torture/rpc/samr.c                         |   24 +-
     source4/torture/rpc/samsync.c                      |    6 +-
     source4/torture/rpc/session_key.c                  |    4 +-
     source4/torture/rpc/spoolss.c                      |    4 +-
     source4/torture/rpc/testjoin.c                     |    2 +-
     source4/torture/rpc/winreg.c                       |    8 +-
     source4/torture/rpc/wkssvc.c                       |    4 +-
     103 files changed, 2649 insertions(+), 1253 deletions(-)
     copy source4/echo_server/echo_server.h => source3/librpc/rpc/dcerpc_internal.h (64%)
    
    
    Changeset truncated at 500 lines:
    
    diff --git a/VERSION b/VERSION
    index 68f898ae004..4fff7d5eb09 100644
    --- a/VERSION
    +++ b/VERSION
    @@ -27,7 +27,7 @@ SAMBA_COPYRIGHT_STRING="Copyright Andrew Tridgell and the Samba Team 1992-2024"
     ########################################################
     SAMBA_VERSION_MAJOR=4
     SAMBA_VERSION_MINOR=21
    -SAMBA_VERSION_RELEASE=6
    +SAMBA_VERSION_RELEASE=7
     
     ########################################################
     # If a official release has a serious bug              #
    diff --git a/WHATSNEW.txt b/WHATSNEW.txt
    index b8967d54c82..127fd8a3811 100644
    --- a/WHATSNEW.txt
    +++ b/WHATSNEW.txt
    @@ -1,3 +1,85 @@
    +                   ==============================
    +                   Release Notes for Samba 4.21.7
    +                           July 07, 2025
    +                   ==============================
    +
    +
    +This is the latest stable release of the Samba 4.21 release series.
    +
    +
    +Important Change in Upcoming Microsoft Update
    +---------------------------------------------
    +
    +On 8th of July, Microsoft will release an important security update for
    +Active Directory Domain Controllers for Windows Server versions prior to
    +2025.
    +
    +This update includes a change to the Microsoft RPC Netlogon protocol,
    +which improves security by tightening access checks for a set of RPC
    +requests. Samba running as domain members in these environments will be
    +impacted by this change if a specific configuration is used, see below
    +for which configuration is affected.
    +
    +Windows Server version 2025 is already equipped with these specific
    +security hardenings, and Microsoft is now planning to deploy them to all
    +supported Windows Server versions down to Windows Server 2008.
    +
    +
    +Who is affected?
    +
    +Samba installations acting as member servers in Windows AD domains will
    +be affected if they are configured to use the 'ad' idmapping backend.
    +Samba servers not using this configuration will not be affected by the
    +change ? at least to our current knowledge and understanding of the
    +change ? and no further action is required.
    +
    +Current versions of Samba with the affected configuration will no longer
    +function correctly once the Microsoft update has been applied. Users
    +will not be able to connect to the SMB service provided by Samba for any
    +domain configured to use the 'ad' idmapping backend.
    +
    +See https://bugzilla.samba.org/show_bug.cgi?id=15876.
    +
    +Changes since 4.21.6
    +--------------------
    +
    +o  G?nther Deschner 
    +   * BUG 15876: Windows security hardening locks out schannel'ed netlogon dc
    +     calls like netr_DsRGetDCName.
    +
    +o  Stefan Metzmacher 
    +   * BUG 15680: Trust domains are not created.
    +   * BUG 15876: Windows security hardening locks out schannel'ed netlogon dc
    +     calls like netr_DsRGetDCName.
    +
    +o  Andreas Schneider 
    +   * BUG 15680: Trust domains are not created.
    +   * BUG 15869: Startup messages of rpc deamons fills /var/log/messages.
    +
    +
    +#######################################
    +Reporting bugs & Development Discussion
    +#######################################
    +
    +Please discuss this release on the samba-technical mailing list or by
    +joining the #samba-technical:matrix.org matrix room, or
    +#samba-technical IRC channel on irc.libera.chat.
    +
    +If you do report problems then please try to send high quality
    +feedback. If you don't provide vital information to help us track down
    +the problem then you will probably be ignored.  All bug reports should
    +be filed under the Samba 4.1 and newer product in the project's Bugzilla
    +database (https://bugzilla.samba.org/).
    +
    +
    +======================================================================
    +== Our Code, Our Bugs, Our Responsibility.
    +== The Samba Team
    +======================================================================
    +
    +
    +Release notes for older releases follow:
    +----------------------------------------
                        ==============================
                        Release Notes for Samba 4.21.6
                                June 03, 2025
    @@ -92,8 +174,7 @@ database (https://bugzilla.samba.org/).
     ======================================================================
     
     
    -Release notes for older releases follow:
    -----------------------------------------
    +----------------------------------------------------------------------
                        ==============================
                        Release Notes for Samba 4.21.5
                                March 31, 2025
    diff --git a/lib/util/debug.c b/lib/util/debug.c
    index 86f13f181cf..f79b8811a4b 100644
    --- a/lib/util/debug.c
    +++ b/lib/util/debug.c
    @@ -95,6 +95,7 @@ static struct {
     	bool reopening_logs;
     	bool schedule_reopen_logs;
     	int forced_log_priority;
    +	bool disable_syslog;
     
     	struct debug_settings settings;
     	debug_callback_fn callback;
    @@ -302,6 +303,10 @@ static void debug_syslog_log(int msg_level, const char *msg, size_t msg_len)
     {
     	int priority;
     
    +	if (state.disable_syslog) {
    +		return;
    +	}
    +
     	priority = debug_level_to_priority(msg_level);
     
     	/*
    @@ -1124,6 +1129,16 @@ void debug_set_forced_log_priority(int forced_log_priority)
     	state.forced_log_priority = forced_log_priority;
     }
     
    +void debug_disable_syslog(void)
    +{
    +	state.disable_syslog = true;
    +}
    +
    +void debug_enable_syslog(void)
    +{
    +	state.disable_syslog = false;
    +}
    +
     /**
      * Ensure debug logs are initialised.
      *
    diff --git a/lib/util/debug.h b/lib/util/debug.h
    index a4ad56048ff..5dc36369558 100644
    --- a/lib/util/debug.h
    +++ b/lib/util/debug.h
    @@ -276,9 +276,16 @@ void debuglevel_set_class(size_t idx, int level);
     #define DBGLVL_INFO	 5	/* informational message */
     #define DBGLVL_DEBUG	10	/* debug-level message */
     
    +/*
    + * Logging to syslog will be disabled as messages on debug level 0 are always
    + * reported to syslog too. We don't want to clutter the syslog with startup
    + * messages from rpc on demand daemons.
    + */
     #define DBG_STARTUP_NOTICE(...) do { \
     	debug_set_forced_log_priority(DBGLVL_NOTICE); \
    +	debug_disable_syslog(); \
     	D_ERR(__VA_ARGS__); \
    +	debug_enable_syslog(); \
     	debug_set_forced_log_priority(-1); \
     } while(0)
     
    @@ -362,6 +369,8 @@ void debug_set_settings(struct debug_settings *settings,
     			int syslog_level, bool syslog_only);
     void debug_set_hostname(const char *name);
     void debug_set_forced_log_priority(int forced_log_priority);
    +void debug_disable_syslog(void);
    +void debug_enable_syslog(void);
     bool reopen_logs_internal( void );
     void force_check_log_size( void );
     bool need_to_check_log_size( void );
    diff --git a/libcli/tstream_binding_handle/tstream_binding_handle.c b/libcli/tstream_binding_handle/tstream_binding_handle.c
    index 76f54a7f338..672fd3b89c6 100644
    --- a/libcli/tstream_binding_handle/tstream_binding_handle.c
    +++ b/libcli/tstream_binding_handle/tstream_binding_handle.c
    @@ -35,8 +35,17 @@ struct tstream_bh_state {
     	size_t call_initial_read_size;
     	tstream_read_pdu_blob_full_fn_t *complete_pdu_fn;
     	void *complete_pdu_fn_private;
    +	const struct dcerpc_binding *binding;
     };
     
    +static const struct dcerpc_binding *tstream_bh_get_binding(struct dcerpc_binding_handle *h)
    +{
    +	struct tstream_bh_state *hs = dcerpc_binding_handle_data(
    +		h, struct tstream_bh_state);
    +
    +	return hs->binding;
    +}
    +
     static bool tstream_bh_is_connected(struct dcerpc_binding_handle *h)
     {
     	struct tstream_bh_state *hs = dcerpc_binding_handle_data(
    @@ -290,6 +299,7 @@ static NTSTATUS tstream_bh_call_recv(struct tevent_req *req,
     
     static const struct dcerpc_binding_handle_ops tstream_bh_ops = {
     	.name			= "tstream_binding_handle",
    +	.get_binding		= tstream_bh_get_binding,
     	.is_connected		= tstream_bh_is_connected,
     	.set_timeout		= tstream_bh_set_timeout,
     	.raw_call_send		= tstream_bh_call_send,
    @@ -309,6 +319,8 @@ struct dcerpc_binding_handle *tstream_binding_handle_create(
     {
     	struct dcerpc_binding_handle *h = NULL;
     	struct tstream_bh_state *hs = NULL;
    +	struct dcerpc_binding *b = NULL;
    +	NTSTATUS status;
     
     	h = dcerpc_binding_handle_create(mem_ctx,
     					 &tstream_bh_ops,
    @@ -333,6 +345,13 @@ struct dcerpc_binding_handle *tstream_binding_handle_create(
     		return NULL;
     	}
     
    +	status = dcerpc_parse_binding(hs, "", &b);
    +	if (!NT_STATUS_IS_OK(status)) {
    +		TALLOC_FREE(h);
    +		return NULL;
    +	}
    +	hs->binding = b;
    +
     	if (max_data > 0) {
     		tstream_smbXcli_np_set_max_data(hs->stream, max_data);
     	}
    diff --git a/librpc/rpc/binding_handle.c b/librpc/rpc/binding_handle.c
    index 41675e10360..8ace6722a43 100644
    --- a/librpc/rpc/binding_handle.c
    +++ b/librpc/rpc/binding_handle.c
    @@ -87,6 +87,17 @@ void dcerpc_binding_handle_set_sync_ev(struct dcerpc_binding_handle *h,
     	h->sync_ev = ev;
     }
     
    +const struct dcerpc_binding *dcerpc_binding_handle_get_binding(struct dcerpc_binding_handle *h)
    +{
    +	return h->ops->get_binding(h);
    +}
    +
    +enum dcerpc_transport_t dcerpc_binding_handle_get_transport(struct dcerpc_binding_handle *h)
    +{
    +	const struct dcerpc_binding *b = dcerpc_binding_handle_get_binding(h);
    +	return dcerpc_binding_get_transport(b);
    +}
    +
     bool dcerpc_binding_handle_is_connected(struct dcerpc_binding_handle *h)
     {
     	return h->ops->is_connected(h);
    @@ -98,6 +109,27 @@ uint32_t dcerpc_binding_handle_set_timeout(struct dcerpc_binding_handle *h,
     	return h->ops->set_timeout(h, timeout);
     }
     
    +bool dcerpc_binding_handle_transport_encrypted(struct dcerpc_binding_handle *h)
    +{
    +	if (h->ops->transport_encrypted == NULL) {
    +		return false;
    +	}
    +
    +	return h->ops->transport_encrypted(h);
    +}
    +
    +NTSTATUS dcerpc_binding_handle_transport_session_key(
    +		struct dcerpc_binding_handle *h,
    +		TALLOC_CTX *mem_ctx,
    +		DATA_BLOB *session_key)
    +{
    +	if (h->ops->transport_session_key == NULL) {
    +		return NT_STATUS_NO_USER_SESSION_KEY;
    +	}
    +
    +	return h->ops->transport_session_key(h, mem_ctx, session_key);
    +}
    +
     void dcerpc_binding_handle_auth_info(struct dcerpc_binding_handle *h,
     				     enum dcerpc_AuthType *auth_type,
     				     enum dcerpc_AuthLevel *auth_level)
    @@ -123,6 +155,18 @@ void dcerpc_binding_handle_auth_info(struct dcerpc_binding_handle *h,
     	h->ops->auth_info(h, auth_type, auth_level);
     }
     
    +NTSTATUS dcerpc_binding_handle_auth_session_key(
    +		struct dcerpc_binding_handle *h,
    +		TALLOC_CTX *mem_ctx,
    +		DATA_BLOB *session_key)
    +{
    +	if (h->ops->auth_session_key == NULL) {
    +		return NT_STATUS_NO_USER_SESSION_KEY;
    +	}
    +
    +	return h->ops->auth_session_key(h, mem_ctx, session_key);
    +}
    +
     struct dcerpc_binding_handle_raw_call_state {
     	const struct dcerpc_binding_handle_ops *ops;
     	uint8_t *out_data;
    diff --git a/librpc/rpc/dcerpc_error.c b/librpc/rpc/dcerpc_error.c
    index d5b5b66ab6a..26c96336615 100644
    --- a/librpc/rpc/dcerpc_error.c
    +++ b/librpc/rpc/dcerpc_error.c
    @@ -40,9 +40,9 @@ static const struct dcerpc_fault_table dcerpc_faults[] =
     	_FAULT_STR_NO_NT_MAPPING(DCERPC_NCA_S_YOU_CRASHED),
     	_FAULT_STR(DCERPC_NCA_S_PROTO_ERROR, NT_STATUS_RPC_PROTOCOL_ERROR),
     	_FAULT_STR_NO_NT_MAPPING(DCERPC_NCA_S_OUT_ARGS_TOO_BIG),
    -	_FAULT_STR_NO_NT_MAPPING(DCERPC_NCA_S_SERVER_TOO_BUSY),
    +	_FAULT_STR(DCERPC_NCA_S_SERVER_TOO_BUSY, NT_STATUS_RPC_SERVER_TOO_BUSY),
     	_FAULT_STR_NO_NT_MAPPING(DCERPC_NCA_S_FAULT_STRING_TOO_LARGE),
    -	_FAULT_STR_NO_NT_MAPPING(DCERPC_NCA_S_UNSUPPORTED_TYPE),
    +	_FAULT_STR(DCERPC_NCA_S_UNSUPPORTED_TYPE, NT_STATUS_RPC_UNSUPPORTED_TYPE),
     	_FAULT_STR_NO_NT_MAPPING(DCERPC_NCA_S_FAULT_ADDR_ERROR),
     	_FAULT_STR(DCERPC_NCA_S_FAULT_FP_DIV_BY_ZERO, NT_STATUS_RPC_FP_DIV_ZERO),
     	_FAULT_STR(DCERPC_NCA_S_FAULT_FP_UNDERFLOW, NT_STATUS_RPC_FP_UNDERFLOW),
    diff --git a/librpc/rpc/dcerpc_util.c b/librpc/rpc/dcerpc_util.c
    index 51a8a11ac4a..e01391e6dcd 100644
    --- a/librpc/rpc/dcerpc_util.c
    +++ b/librpc/rpc/dcerpc_util.c
    @@ -647,13 +647,13 @@ NTSTATUS dcerpc_read_ncacn_packet_recv(struct tevent_req *req,
     	return NT_STATUS_OK;
     }
     
    -const char *dcerpc_default_transport_endpoint(TALLOC_CTX *mem_ctx,
    -					      enum dcerpc_transport_t transport,
    -					      const struct ndr_interface_table *table)
    +char *dcerpc_default_transport_endpoint(TALLOC_CTX *mem_ctx,
    +					enum dcerpc_transport_t transport,
    +					const struct ndr_interface_table *table)
     {
     	NTSTATUS status;
     	const char *p = NULL;
    -	const char *endpoint = NULL;
    +	char *endpoint = NULL;
     	uint32_t i;
     	struct dcerpc_binding *default_binding = NULL;
     	TALLOC_CTX *frame = talloc_stackframe();
    diff --git a/librpc/rpc/dcerpc_util.h b/librpc/rpc/dcerpc_util.h
    index 4e49e3e8572..86c254e539c 100644
    --- a/librpc/rpc/dcerpc_util.h
    +++ b/librpc/rpc/dcerpc_util.h
    @@ -36,9 +36,9 @@ uint8_t dcerpc_get_endian_flag(DATA_BLOB *blob);
     uint8_t dcerpc_get_auth_type(const DATA_BLOB *blob);
     uint8_t dcerpc_get_auth_level(const DATA_BLOB *blob);
     uint32_t dcerpc_get_auth_context_id(const DATA_BLOB *blob);
    -const char *dcerpc_default_transport_endpoint(TALLOC_CTX *mem_ctx,
    -					      enum dcerpc_transport_t transport,
    -					      const struct ndr_interface_table *table);
    +char *dcerpc_default_transport_endpoint(TALLOC_CTX *mem_ctx,
    +					enum dcerpc_transport_t transport,
    +					const struct ndr_interface_table *table);
     
     NTSTATUS dcerpc_pull_ncacn_packet(TALLOC_CTX *mem_ctx,
     				  const DATA_BLOB *blob,
    diff --git a/librpc/rpc/dcesrv_core.c b/librpc/rpc/dcesrv_core.c
    index 66478001640..7fb23d49d61 100644
    --- a/librpc/rpc/dcesrv_core.c
    +++ b/librpc/rpc/dcesrv_core.c
    @@ -783,8 +783,8 @@ static void dcesrv_call_set_list(struct dcesrv_call_state *call,
     	}
     }
     
    -static void dcesrv_call_disconnect_after(struct dcesrv_call_state *call,
    -					 const char *reason)
    +void dcesrv_call_disconnect_after(struct dcesrv_call_state *call,
    +				  const char *reason)
     {
     	struct dcesrv_auth *a = NULL;
     
    diff --git a/librpc/rpc/dcesrv_core.h b/librpc/rpc/dcesrv_core.h
    index 90f5bd21d64..0b69af575b2 100644
    --- a/librpc/rpc/dcesrv_core.h
    +++ b/librpc/rpc/dcesrv_core.h
    @@ -566,6 +566,9 @@ NTSTATUS dcesrv_auth_session_key(struct dcesrv_call_state *call,
     NTSTATUS dcesrv_transport_session_key(struct dcesrv_call_state *call,
     				      DATA_BLOB *session_key);
     
    +void dcesrv_call_disconnect_after(struct dcesrv_call_state *call,
    +				  const char *reason);
    +
     /* a useful macro for generating a RPC fault in the backend code */
     #define DCESRV_FAULT(code) do { \
     	dce_call->fault_code = code; \
    diff --git a/librpc/rpc/rpc_common.h b/librpc/rpc/rpc_common.h
    index 76557101dcd..493c3137126 100644
    --- a/librpc/rpc/rpc_common.h
    +++ b/librpc/rpc/rpc_common.h
    @@ -172,13 +172,23 @@ enum dcerpc_transport_t dcerpc_transport_by_tower(const struct epm_tower *tower)
     struct dcerpc_binding_handle_ops {
     	const char *name;
     
    +	const struct dcerpc_binding *(*get_binding)(struct dcerpc_binding_handle *h);
    +
     	bool (*is_connected)(struct dcerpc_binding_handle *h);
     	uint32_t (*set_timeout)(struct dcerpc_binding_handle *h,
     				uint32_t timeout);
     
    +	bool (*transport_encrypted)(struct dcerpc_binding_handle *h);
    +	NTSTATUS (*transport_session_key)(struct dcerpc_binding_handle *h,
    +					  TALLOC_CTX *mem_ctx,
    +					  DATA_BLOB *session_key);
    +
     	void (*auth_info)(struct dcerpc_binding_handle *h,
     			  enum dcerpc_AuthType *auth_type,
     			  enum dcerpc_AuthLevel *auth_level);
    +	NTSTATUS (*auth_session_key)(struct dcerpc_binding_handle *h,
    +				     TALLOC_CTX *mem_ctx,
    +				     DATA_BLOB *session_key);
     
     	struct tevent_req *(*raw_call_send)(TALLOC_CTX *mem_ctx,
     					    struct tevent_context *ev,
    @@ -245,15 +255,31 @@ void *_dcerpc_binding_handle_data(struct dcerpc_binding_handle *h);
     _DEPRECATED_ void dcerpc_binding_handle_set_sync_ev(struct dcerpc_binding_handle *h,
     						    struct tevent_context *ev);
     
    +const struct dcerpc_binding *dcerpc_binding_handle_get_binding(struct dcerpc_binding_handle *h);
    +
    +enum dcerpc_transport_t dcerpc_binding_handle_get_transport(struct dcerpc_binding_handle *h);
    +
     bool dcerpc_binding_handle_is_connected(struct dcerpc_binding_handle *h);
     
     uint32_t dcerpc_binding_handle_set_timeout(struct dcerpc_binding_handle *h,
     					   uint32_t timeout);
     
    +bool dcerpc_binding_handle_transport_encrypted(struct dcerpc_binding_handle *h);
    +
    +NTSTATUS dcerpc_binding_handle_transport_session_key(
    +		struct dcerpc_binding_handle *h,
    +		TALLOC_CTX *mem_ctx,
    +		DATA_BLOB *session_key);
    +
     void dcerpc_binding_handle_auth_info(struct dcerpc_binding_handle *h,
     				     enum dcerpc_AuthType *auth_type,
     				     enum dcerpc_AuthLevel *auth_level);
     
    +NTSTATUS dcerpc_binding_handle_auth_session_key(
    +		struct dcerpc_binding_handle *h,
    +		TALLOC_CTX *mem_ctx,
    +		DATA_BLOB *session_key);
    +
     struct tevent_req *dcerpc_binding_handle_raw_call_send(TALLOC_CTX *mem_ctx,
     						struct tevent_context *ev,
     						struct dcerpc_binding_handle *h,
    diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
    index 63f0f72605d..9bcdea3b15b 100644
    --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
    +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
    @@ -1547,11 +1547,30 @@ sub Interface($$$)
     		$self->pidl("");
     
     		my $signature =
    -"\"$interface->{NAME}(binding, lp_ctx=None, credentials=None) -> connection\\n\"
    -\"\\n\"
    -\"binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\\n\"
    -\"lp_ctx should be a path to a smb.conf file or a param.LoadParm object\\n\"
    -\"credentials should be a credentials.Credentials object.\\n\\n\"";
    +"\"$interface->{NAME}(binding, lp_ctx=None, credentials=None, basis_connection=None) -> connection\\n\"
    +\"\\n\\n\"
    +\"Parameters\\n\"
    +\"----------\\n\"
    +\"binding : str\\n\"
    +\"    A DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\\n\"
    +\"lp_ctx : param.LoadParm\\n\"
    +\"    Should be a path to a smb.conf file or a param.LoadParm object\\n\"
    +\"credentials : credentials.Credentials, optional\\n\"
    +\"    A credentials.Credentials object (default is None).\\n\"
    +\"basis_connection : samba.dcerpc.ClientConnection, optional\\n\"
    +\"    A $interface->{NAME} client connection object (default is None).\\n\"
    +\"\\n\\n\"
    +\"Returns\\n\"
    +\"-------\\n\"
    +\"samba.dcerpc.ClientConnection\\n\"
    +\"    A ClientConnection object\\n\"
    +\"\\n\\n\"
    +\"Raises\\n\"
    +\"------\\n\"
    +\"samba.NTSTATUSError\\n\"
    +\"    An NTSTATUS error\\n\"
    +\"\\n\"";
    +
     
     		my $docstring = $self->DocString($interface, $interface->{NAME});
     
    diff --git a/python/samba/lsa_utils.py b/python/samba/lsa_utils.py
    index 043e65f3341..506dc399c93 100644
    --- a/python/samba/lsa_utils.py
    +++ b/python/samba/lsa_utils.py
    @@ -20,24 +20,27 @@ from samba.dcerpc import lsa, drsblobs, misc
     from samba.ndr import ndr_pack
     from samba import (
         NTSTATUSError,
    +    ntstatus,
         aead_aes_256_cbc_hmac_sha512,
         arcfour_encrypt,
    
    
    -- 
    Samba Shared Repository
    
    
    From janger at samba.org  Mon Jul  7 16:18:22 2025
    From: janger at samba.org (Jule Anger)
    Date: Mon, 07 Jul 2025 16:18:22 +0000
    Subject: [SCM] Samba Shared Repository - branch v4-22-test updated
    Message-ID: 
    
    The branch, v4-22-test has been updated
           via  ef1a5896a11 VERSION: Bump version up to Samba 4.22.4...
           via  70eeb722062 VERSION: Disable GIT_SNAPSHOT for the 4.22.3 release.
           via  22a95d2aa77 WHATSNEW: Add release notes for Samba 4.22.3.
          from  78d69a9eebe s3-winbindd: Fix internal winbind dsgetdcname calls w.r.t. domain name
    
    https://git.samba.org/?p=samba.git;a=shortlog;h=v4-22-test
    
    
    - Log -----------------------------------------------------------------
    commit ef1a5896a1116468cf80aec251c23e84940a6785
    Author: Jule Anger 
    Date:   Mon Jul 7 18:16:50 2025 +0200
    
        VERSION: Bump version up to Samba 4.22.4...
        
        and re-enable GIT_SNAPSHOT.
        
        Signed-off-by: Jule Anger 
    
    commit 70eeb7220627eae6f6e0e76f1ec114a1ac965671
    Author: Jule Anger 
    Date:   Mon Jul 7 18:16:34 2025 +0200
    
        VERSION: Disable GIT_SNAPSHOT for the 4.22.3 release.
        
        Signed-off-by: Jule Anger 
    
    commit 22a95d2aa7726dcc7502d6693ab5a88e0d419d5a
    Author: Jule Anger 
    Date:   Mon Jul 7 18:16:05 2025 +0200
    
        WHATSNEW: Add release notes for Samba 4.22.3.
        
        Signed-off-by: Jule Anger 
    
    -----------------------------------------------------------------------
    
    Summary of changes:
     VERSION      |  2 +-
     WHATSNEW.txt | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
     2 files changed, 87 insertions(+), 3 deletions(-)
    
    
    Changeset truncated at 500 lines:
    
    diff --git a/VERSION b/VERSION
    index 401aa10d8bf..f139c253fa6 100644
    --- a/VERSION
    +++ b/VERSION
    @@ -27,7 +27,7 @@ SAMBA_COPYRIGHT_STRING="Copyright Andrew Tridgell and the Samba Team 1992-2025"
     ########################################################
     SAMBA_VERSION_MAJOR=4
     SAMBA_VERSION_MINOR=22
    -SAMBA_VERSION_RELEASE=3
    +SAMBA_VERSION_RELEASE=4
     
     ########################################################
     # If a official release has a serious bug              #
    diff --git a/WHATSNEW.txt b/WHATSNEW.txt
    index 8b98a91f28a..57d9133b43f 100644
    --- a/WHATSNEW.txt
    +++ b/WHATSNEW.txt
    @@ -1,3 +1,88 @@
    +                   ==============================
    +                   Release Notes for Samba 4.22.3
    +                           July 07, 2025
    +                   ==============================
    +
    +
    +This is the latest stable release of the Samba 4.22 release series.
    +
    +
    +Important Change in Upcoming Microsoft Update
    +---------------------------------------------
    +
    +On 8th of July, Microsoft will release an important security update for
    +Active Directory Domain Controllers for Windows Server versions prior to
    +2025.
    +
    +This update includes a change to the Microsoft RPC Netlogon protocol,
    +which improves security by tightening access checks for a set of RPC
    +requests. Samba running as domain members in these environments will be
    +impacted by this change if a specific configuration is used, see below
    +for which configuration is affected.
    +
    +Windows Server version 2025 is already equipped with these specific
    +security hardenings, and Microsoft is now planning to deploy them to all
    +supported Windows Server versions down to Windows Server 2008.
    +
    +
    +Who is affected?
    +
    +Samba installations acting as member servers in Windows AD domains will
    +be affected if they are configured to use the 'ad' idmapping backend.
    +Samba servers not using this configuration will not be affected by the
    +change ? at least to our current knowledge and understanding of the
    +change ? and no further action is required.
    +
    +Current versions of Samba with the affected configuration will no longer
    +function correctly once the Microsoft update has been applied. Users
    +will not be able to connect to the SMB service provided by Samba for any
    +domain configured to use the 'ad' idmapping backend.
    +
    +See https://bugzilla.samba.org/show_bug.cgi?id=15876.
    +
    +
    +Changes since 4.22.2
    +--------------------
    +
    +o  Douglas Bagnall 
    +   * BUG 15854: samba-tool cannot add user to group whose name is exactly 16
    +     characters long.
    +
    +o  G?nther Deschner 
    +   * BUG 15876: Windows security hardening locks out schannel'ed netlogon dc
    +     calls like netr_DsRGetDCName.
    +
    +o  Stefan Metzmacher 
    +   * BUG 15876: Windows security hardening locks out schannel'ed netlogon dc
    +     calls like netr_DsRGetDCName.
    +
    +o  Andreas Schneider 
    +   * BUG 15869: Startup messages of rpc deamons fills /var/log/messages.
    +
    +
    +#######################################
    +Reporting bugs & Development Discussion
    +#######################################
    +
    +Please discuss this release on the samba-technical mailing list or by
    +joining the #samba-technical:matrix.org matrix room, or
    +#samba-technical IRC channel on irc.libera.chat.
    +
    +If you do report problems then please try to send high quality
    +feedback. If you don't provide vital information to help us track down
    +the problem then you will probably be ignored.  All bug reports should
    +be filed under the Samba 4.1 and newer product in the project's Bugzilla
    +database (https://bugzilla.samba.org/).
    +
    +
    +======================================================================
    +== Our Code, Our Bugs, Our Responsibility.
    +== The Samba Team
    +======================================================================
    +
    +
    +Release notes for older releases follow:
    +----------------------------------------
                        ==============================
                        Release Notes for Samba 4.22.2
                                June 05, 2025
    @@ -80,8 +165,7 @@ database (https://bugzilla.samba.org/).
     ======================================================================
     
     
    -Release notes for older releases follow:
    -----------------------------------------
    +----------------------------------------------------------------------
                        ==============================
                        Release Notes for Samba 4.22.1
                                April 17, 2025
    
    
    -- 
    Samba Shared Repository
    
    
    From janger at samba.org  Mon Jul  7 16:20:03 2025
    From: janger at samba.org (Jule Anger)
    Date: Mon, 07 Jul 2025 16:20:03 +0000
    Subject: [SCM] Samba Shared Repository - annotated tag samba-4.22.3 created
    Message-ID: 
    
    The annotated tag, samba-4.22.3 has been created
            at  06e5a6c185150bca7cd283f92f873809ed68e4fa (tag)
       tagging  70eeb7220627eae6f6e0e76f1ec114a1ac965671 (commit)
      replaces  samba-4.22.2
     tagged by  Jule Anger
            on  Mon Jul 7 18:19:30 2025 +0200
    
    - Log -----------------------------------------------------------------
    samba: tag release samba-4.22.3
    -----BEGIN PGP SIGNATURE-----
    
    iQIzBAABCgAdFiEEgfXigyvSVFoYl7cTqplEL7aAtiAFAmhr85IACgkQqplEL7aA
    tiBpTA//exPL2PtWECN0gOZwoY8b2U+kSzeOkJcWjmYSyLSF1lOASyP/dBq3GhZ+
    QETqtCBfDNrQuPlKUINpaaS7gVzMMG+JOIjNWnGMJZuQTAAI7pZIN0HAdYWE9K3Q
    qbw2ykrG7t49dY6VJY5cnvU/OGenAs4IMLGCG0tPhZpwYLY5JuL04IPLsecYxr5G
    MYOTT/FesEoT9CKIrLzfco3WDPY/MK+v6YQnjIeYNKX22p9dbDtEXbQkjOg775BS
    qN6dlm+mHEwytfWQqQTCxFWsvlooy44RHtmhgJCvNpOK5nKK1rcOh3inMk3KF2ar
    VRA9oycQ4iNaXG71H5OmXgwhAVlEF124t5ICtV4Q1ZxysnOi/afZ7xN81vnTv7fa
    DmBKn4QW1T2AXMFp0AM5a4lCJD1KtmCZLwpYvqzXnN/Lj2ygMjJEdlQLyofuQBbf
    AVNNcLDIdGHtTwZLAu1HtyiXB70ypgAY2KfBMUe79TXyXGUZsi/weG2suikIRhUX
    S+DOMIeX8WO85uyWTUE+f22oqwlKRhb0AjskM/B+iagLRtvZNVd4cvl3xan2FW67
    5inVmuayZ/+JOlJDFFCCicfBAsaTVvLole4ETffCC5xab4FB2XX95bWqLYzuWxno
    keUGi00L8s6WSDgNNbzbeuECHgChDr0oN+zMjnY2ddHEj+c82lI=
    =S7my
    -----END PGP SIGNATURE-----
    
    Andreas Schneider (1):
          lib:util: Disable logging to syslog for startup messages
    
    Douglas Bagnall (3):
          pytest:samba-tool group: test addmembers
          pytest: samba-tool group: test with 16 character name
          python: Do not interpret 16 character group names as GUIDs
    
    G?nther Deschner (1):
          s3-winbindd: Fix internal winbind dsgetdcname calls w.r.t. domain name
    
    Jule Anger (3):
          VERSION: Bump version up to Samba 4.22.3...
          WHATSNEW: Add release notes for Samba 4.22.3.
          VERSION: Disable GIT_SNAPSHOT for the 4.22.3 release.
    
    Stefan Metzmacher (1):
          s3:winbindd: avoid using any netlogon call to get a dc name
    
    -----------------------------------------------------------------------
    
    
    -- 
    Samba Shared Repository
    
    
    From janger at samba.org  Mon Jul  7 16:21:19 2025
    From: janger at samba.org (Jule Anger)
    Date: Mon, 07 Jul 2025 16:21:19 +0000
    Subject: [SCM] Samba Shared Repository - branch v4-22-stable updated
    Message-ID: 
    
    The branch, v4-22-stable has been updated
           via  70eeb722062 VERSION: Disable GIT_SNAPSHOT for the 4.22.3 release.
           via  22a95d2aa77 WHATSNEW: Add release notes for Samba 4.22.3.
           via  78d69a9eebe s3-winbindd: Fix internal winbind dsgetdcname calls w.r.t. domain name
           via  b197ce8c6f1 s3:winbindd: avoid using any netlogon call to get a dc name
           via  7501696d552 lib:util: Disable logging to syslog for startup messages
           via  76d1b6b1807 python: Do not interpret 16 character group names as GUIDs
           via  de43d8e305d pytest: samba-tool group: test with 16 character name
           via  d80ff2e1e58 pytest:samba-tool group: test addmembers
           via  de600282aaf VERSION: Bump version up to Samba 4.22.3...
          from  64a23714e6d VERSION: Disable GIT_SNAPSHOT for the 4.22.2 release.
    
    https://git.samba.org/?p=samba.git;a=shortlog;h=v4-22-stable
    
    
    - Log -----------------------------------------------------------------
    -----------------------------------------------------------------------
    
    Summary of changes:
     VERSION                                |   2 +-
     WHATSNEW.txt                           |  88 ++++++++++++++++++-
     lib/util/debug.c                       |  15 ++++
     lib/util/debug.h                       |   9 ++
     python/samba/samdb.py                  |  10 ++-
     python/samba/tests/samba_tool/group.py |  17 +++-
     source3/winbindd/wb_queryuser.c        |  17 +++-
     source3/winbindd/wb_sids2xids.c        |  17 +++-
     source3/winbindd/wb_xids2sids.c        |  12 ++-
     source3/winbindd/winbindd_cm.c         | 150 ---------------------------------
     source3/winbindd/winbindd_dual.c       |   6 +-
     source3/winbindd/winbindd_dual_srv.c   | 105 ++---------------------
     source3/winbindd/winbindd_proto.h      |   1 +
     source3/winbindd/winbindd_util.c       |  19 +++++
     14 files changed, 201 insertions(+), 267 deletions(-)
    
    
    Changeset truncated at 500 lines:
    
    diff --git a/VERSION b/VERSION
    index 5b8bfb01ce6..171017d023a 100644
    --- a/VERSION
    +++ b/VERSION
    @@ -27,7 +27,7 @@ SAMBA_COPYRIGHT_STRING="Copyright Andrew Tridgell and the Samba Team 1992-2025"
     ########################################################
     SAMBA_VERSION_MAJOR=4
     SAMBA_VERSION_MINOR=22
    -SAMBA_VERSION_RELEASE=2
    +SAMBA_VERSION_RELEASE=3
     
     ########################################################
     # If a official release has a serious bug              #
    diff --git a/WHATSNEW.txt b/WHATSNEW.txt
    index 8b98a91f28a..57d9133b43f 100644
    --- a/WHATSNEW.txt
    +++ b/WHATSNEW.txt
    @@ -1,3 +1,88 @@
    +                   ==============================
    +                   Release Notes for Samba 4.22.3
    +                           July 07, 2025
    +                   ==============================
    +
    +
    +This is the latest stable release of the Samba 4.22 release series.
    +
    +
    +Important Change in Upcoming Microsoft Update
    +---------------------------------------------
    +
    +On 8th of July, Microsoft will release an important security update for
    +Active Directory Domain Controllers for Windows Server versions prior to
    +2025.
    +
    +This update includes a change to the Microsoft RPC Netlogon protocol,
    +which improves security by tightening access checks for a set of RPC
    +requests. Samba running as domain members in these environments will be
    +impacted by this change if a specific configuration is used, see below
    +for which configuration is affected.
    +
    +Windows Server version 2025 is already equipped with these specific
    +security hardenings, and Microsoft is now planning to deploy them to all
    +supported Windows Server versions down to Windows Server 2008.
    +
    +
    +Who is affected?
    +
    +Samba installations acting as member servers in Windows AD domains will
    +be affected if they are configured to use the 'ad' idmapping backend.
    +Samba servers not using this configuration will not be affected by the
    +change ? at least to our current knowledge and understanding of the
    +change ? and no further action is required.
    +
    +Current versions of Samba with the affected configuration will no longer
    +function correctly once the Microsoft update has been applied. Users
    +will not be able to connect to the SMB service provided by Samba for any
    +domain configured to use the 'ad' idmapping backend.
    +
    +See https://bugzilla.samba.org/show_bug.cgi?id=15876.
    +
    +
    +Changes since 4.22.2
    +--------------------
    +
    +o  Douglas Bagnall 
    +   * BUG 15854: samba-tool cannot add user to group whose name is exactly 16
    +     characters long.
    +
    +o  G?nther Deschner 
    +   * BUG 15876: Windows security hardening locks out schannel'ed netlogon dc
    +     calls like netr_DsRGetDCName.
    +
    +o  Stefan Metzmacher 
    +   * BUG 15876: Windows security hardening locks out schannel'ed netlogon dc
    +     calls like netr_DsRGetDCName.
    +
    +o  Andreas Schneider 
    +   * BUG 15869: Startup messages of rpc deamons fills /var/log/messages.
    +
    +
    +#######################################
    +Reporting bugs & Development Discussion
    +#######################################
    +
    +Please discuss this release on the samba-technical mailing list or by
    +joining the #samba-technical:matrix.org matrix room, or
    +#samba-technical IRC channel on irc.libera.chat.
    +
    +If you do report problems then please try to send high quality
    +feedback. If you don't provide vital information to help us track down
    +the problem then you will probably be ignored.  All bug reports should
    +be filed under the Samba 4.1 and newer product in the project's Bugzilla
    +database (https://bugzilla.samba.org/).
    +
    +
    +======================================================================
    +== Our Code, Our Bugs, Our Responsibility.
    +== The Samba Team
    +======================================================================
    +
    +
    +Release notes for older releases follow:
    +----------------------------------------
                        ==============================
                        Release Notes for Samba 4.22.2
                                June 05, 2025
    @@ -80,8 +165,7 @@ database (https://bugzilla.samba.org/).
     ======================================================================
     
     
    -Release notes for older releases follow:
    -----------------------------------------
    +----------------------------------------------------------------------
                        ==============================
                        Release Notes for Samba 4.22.1
                                April 17, 2025
    diff --git a/lib/util/debug.c b/lib/util/debug.c
    index 86f13f181cf..f79b8811a4b 100644
    --- a/lib/util/debug.c
    +++ b/lib/util/debug.c
    @@ -95,6 +95,7 @@ static struct {
     	bool reopening_logs;
     	bool schedule_reopen_logs;
     	int forced_log_priority;
    +	bool disable_syslog;
     
     	struct debug_settings settings;
     	debug_callback_fn callback;
    @@ -302,6 +303,10 @@ static void debug_syslog_log(int msg_level, const char *msg, size_t msg_len)
     {
     	int priority;
     
    +	if (state.disable_syslog) {
    +		return;
    +	}
    +
     	priority = debug_level_to_priority(msg_level);
     
     	/*
    @@ -1124,6 +1129,16 @@ void debug_set_forced_log_priority(int forced_log_priority)
     	state.forced_log_priority = forced_log_priority;
     }
     
    +void debug_disable_syslog(void)
    +{
    +	state.disable_syslog = true;
    +}
    +
    +void debug_enable_syslog(void)
    +{
    +	state.disable_syslog = false;
    +}
    +
     /**
      * Ensure debug logs are initialised.
      *
    diff --git a/lib/util/debug.h b/lib/util/debug.h
    index f188105c9f4..2a56c7d48fe 100644
    --- a/lib/util/debug.h
    +++ b/lib/util/debug.h
    @@ -276,9 +276,16 @@ void debuglevel_set_class(size_t idx, int level);
     #define DBGLVL_INFO	 5	/* informational message */
     #define DBGLVL_DEBUG	10	/* debug-level message */
     
    +/*
    + * Logging to syslog will be disabled as messages on debug level 0 are always
    + * reported to syslog too. We don't want to clutter the syslog with startup
    + * messages from rpc on demand daemons.
    + */
     #define DBG_STARTUP_NOTICE(...) do { \
     	debug_set_forced_log_priority(DBGLVL_NOTICE); \
    +	debug_disable_syslog(); \
     	D_ERR(__VA_ARGS__); \
    +	debug_enable_syslog(); \
     	debug_set_forced_log_priority(-1); \
     } while(0)
     
    @@ -362,6 +369,8 @@ void debug_set_settings(struct debug_settings *settings,
     			int syslog_level, bool syslog_only);
     void debug_set_hostname(const char *name);
     void debug_set_forced_log_priority(int forced_log_priority);
    +void debug_disable_syslog(void);
    +void debug_enable_syslog(void);
     bool reopen_logs_internal( void );
     void force_check_log_size( void );
     bool need_to_check_log_size( void );
    diff --git a/python/samba/samdb.py b/python/samba/samdb.py
    index 0545aed98eb..7a1cee1e108 100644
    --- a/python/samba/samdb.py
    +++ b/python/samba/samdb.py
    @@ -35,6 +35,7 @@ from samba.common import normalise_int32
     from samba.common import get_bytes, cmp
     from samba.dcerpc import security
     from samba import is_ad_dc_built
    +from samba import string_is_guid
     from samba import NTSTATUSError, ntstatus
     import binascii
     
    @@ -388,6 +389,13 @@ lockoutTime: 0
     
             partial_groupfilter = None
     
    +        # If  looks like a SID, GUID, or DN, we use it
    +        # accordingly, otherwise as a name.
    +        #
    +        # Because misc.GUID() will read any 16 byte sequence as a
    +        # binary guid, we need to be careful not to read 16 character
    +        # names as GUIDs.
    +
             group_sid = None
             try:
                 group_sid = security.dom_sid(group)
    @@ -397,7 +405,7 @@ lockoutTime: 0
                 partial_groupfilter = "(objectClass=*)"
     
             group_guid = None
    -        if partial_groupfilter is None:
    +        if partial_groupfilter is None and string_is_guid(group):
                 try:
                     group_guid = misc.GUID(group)
                 except NTSTATUSError as e:
    diff --git a/python/samba/tests/samba_tool/group.py b/python/samba/tests/samba_tool/group.py
    index e8c0960849f..1c5bc9690f9 100644
    --- a/python/samba/tests/samba_tool/group.py
    +++ b/python/samba/tests/samba_tool/group.py
    @@ -38,7 +38,8 @@ class GroupCmdTestCase(SambaToolCmdTest):
             self.groups.append(self._randomGroup({"name": "testgroup1"}))
             self.groups.append(self._randomGroup({"name": "testgroup2"}))
             self.groups.append(self._randomGroup({"name": "testgroup3"}))
    -        self.groups.append(self._randomGroup({"name": "testgroup4"}))
    +        self.groups.append(self._randomGroup(
    +            {"name": "16 character name for bug 15854"[:16]}))
             self.groups.append(self._randomGroup({"name": "testgroup5 (with brackets)"}))
             self.groups.append(self._randomPosixGroup({"name": "posixgroup1"}))
             self.groups.append(self._randomPosixGroup({"name": "posixgroup2"}))
    @@ -334,6 +335,20 @@ class GroupCmdTestCase(SambaToolCmdTest):
                 name = str(groupobj.get("dn", idx=0))
                 self.assertMatch(out, name, "group '%s' not found" % name)
     
    +    def test_addmember(self):
    +        groups = [g['name'] for g in self.groups]
    +        for parent, child in zip(groups, groups[1:]):
    +            (result, out, err) = self.runsubcmd(
    +                "group", "addmembers", parent, child)
    +            self.assertCmdSuccess(result, out, err)
    +
    +        (result, out, err) = self.runsubcmd(
    +            "group", "addmembers", groups[-1], ','.join(groups[:-1]))
    +        self.assertCmdSuccess(result, out, err)
    +
    +        (result, out, err) = self.runsubcmd(
    +            "group", "addmembers", groups[0], "alice,bob")
    +        self.assertCmdSuccess(result, out, err)
     
         def test_move(self):
             full_ou_dn = str(self.samdb.normalize_dn_in_domain("OU=movetest_grp"))
    diff --git a/source3/winbindd/wb_queryuser.c b/source3/winbindd/wb_queryuser.c
    index c2758f1b76a..db8e946ba71 100644
    --- a/source3/winbindd/wb_queryuser.c
    +++ b/source3/winbindd/wb_queryuser.c
    @@ -289,10 +289,19 @@ static void wb_queryuser_done(struct tevent_req *subreq)
     
     	if (NT_STATUS_EQUAL(result, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND) &&
     	    !state->tried_dclookup) {
    -		D_DEBUG("GetNssInfo got DOMAIN_CONTROLLER_NOT_FOUND, calling wb_dsgetdcname_send()\n");
    -		subreq = wb_dsgetdcname_send(
    -			state, state->ev, state->info->domain_name, NULL, NULL,
    -			DS_RETURN_DNS_NAME);
    +		const char *domain_name = find_dns_domain_name(
    +			state->info->domain_name);
    +
    +		D_DEBUG("GetNssInfo got DOMAIN_CONTROLLER_NOT_FOUND, calling "
    +			"wb_dsgetdcname_send(%s)\n",
    +			domain_name);
    +
    +		subreq = wb_dsgetdcname_send(state,
    +					     state->ev,
    +					     domain_name,
    +					     NULL,
    +					     NULL,
    +					     DS_RETURN_DNS_NAME);
     		if (tevent_req_nomem(subreq, req)) {
     			return;
     		}
    diff --git a/source3/winbindd/wb_sids2xids.c b/source3/winbindd/wb_sids2xids.c
    index f0f6c23fc20..03e5e7e0258 100644
    --- a/source3/winbindd/wb_sids2xids.c
    +++ b/source3/winbindd/wb_sids2xids.c
    @@ -612,13 +612,22 @@ static void wb_sids2xids_done(struct tevent_req *subreq)
     	    !state->tried_dclookup) {
     
     		struct lsa_DomainInfo *d;
    +		const char *domain_name = NULL;
     
    -		D_DEBUG("Domain controller not found. Calling wb_dsgetdcname_send() to get it.\n");
     		d = &state->idmap_doms.domains[state->dom_index];
     
    -		subreq = wb_dsgetdcname_send(
    -			state, state->ev, d->name.string, NULL, NULL,
    -			DS_RETURN_DNS_NAME);
    +		domain_name = find_dns_domain_name(d->name.string);
    +
    +		D_DEBUG("Domain controller not found. Calling "
    +			"wb_dsgetdcname_send(%s) to get it.\n",
    +			domain_name);
    +
    +		subreq = wb_dsgetdcname_send(state,
    +					     state->ev,
    +					     domain_name,
    +					     NULL,
    +					     NULL,
    +					     DS_RETURN_DNS_NAME);
     		if (tevent_req_nomem(subreq, req)) {
     			return;
     		}
    diff --git a/source3/winbindd/wb_xids2sids.c b/source3/winbindd/wb_xids2sids.c
    index 86bd7f9deab..6fcf524d94f 100644
    --- a/source3/winbindd/wb_xids2sids.c
    +++ b/source3/winbindd/wb_xids2sids.c
    @@ -143,9 +143,15 @@ static void wb_xids2sids_dom_done(struct tevent_req *subreq)
     	if (NT_STATUS_EQUAL(result, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND) &&
     	    !state->tried_dclookup) {
     
    -		subreq = wb_dsgetdcname_send(
    -			state, state->ev, state->dom_map->name, NULL, NULL,
    -			DS_RETURN_DNS_NAME);
    +		const char *domain_name = find_dns_domain_name(
    +			state->dom_map->name);
    +
    +		subreq = wb_dsgetdcname_send(state,
    +					     state->ev,
    +					     domain_name,
    +					     NULL,
    +					     NULL,
    +					     DS_RETURN_DNS_NAME);
     		if (tevent_req_nomem(subreq, req)) {
     			return;
     		}
    diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
    index 420ea961876..741761f606b 100644
    --- a/source3/winbindd/winbindd_cm.c
    +++ b/source3/winbindd/winbindd_cm.c
    @@ -475,140 +475,6 @@ static bool cm_is_ipc_credentials(struct cli_credentials *creds)
     	return ret;
     }
     
    -static bool get_dc_name_via_netlogon(struct winbindd_domain *domain,
    -				     fstring dcname,
    -				     struct sockaddr_storage *dc_ss,
    -				     uint32_t request_flags)
    -{
    -	struct winbindd_domain *our_domain = NULL;
    -	struct rpc_pipe_client *netlogon_pipe = NULL;
    -	NTSTATUS result;
    -	WERROR werr;
    -	TALLOC_CTX *mem_ctx;
    -	unsigned int orig_timeout;
    -	const char *tmp = NULL;
    -	const char *p;
    -	struct dcerpc_binding_handle *b;
    -
    -	/* Hmmmm. We can only open one connection to the NETLOGON pipe at the
    -	 * moment.... */
    -
    -	if (IS_DC) {
    -		return False;
    -	}
    -
    -	if (domain->primary) {
    -		return False;
    -	}
    -
    -	our_domain = find_our_domain();
    -
    -	if ((mem_ctx = talloc_init("get_dc_name_via_netlogon")) == NULL) {
    -		return False;
    -	}
    -
    -	result = cm_connect_netlogon(our_domain, &netlogon_pipe);
    -	if (!NT_STATUS_IS_OK(result)) {
    -		talloc_destroy(mem_ctx);
    -		return False;
    -	}
    -
    -	b = netlogon_pipe->binding_handle;
    -
    -	/* This call can take a long time - allow the server to time out.
    -	   35 seconds should do it. */
    -
    -	orig_timeout = rpccli_set_timeout(netlogon_pipe, 35000);
    -
    -	if (our_domain->active_directory) {
    -		struct netr_DsRGetDCNameInfo *domain_info = NULL;
    -
    -		/*
    -		 * TODO request flags are not respected in the server
    -		 * (and in some cases, like REQUIRE_PDC, causes an error)
    -		 */
    -		result = dcerpc_netr_DsRGetDCName(b,
    -						  mem_ctx,
    -						  our_domain->dcname,
    -						  domain->name,
    -						  NULL,
    -						  NULL,
    -						  request_flags|DS_RETURN_DNS_NAME,
    -						  &domain_info,
    -						  &werr);
    -		if (NT_STATUS_IS_OK(result) && W_ERROR_IS_OK(werr)) {
    -			tmp = talloc_strdup(
    -				mem_ctx, domain_info->dc_unc);
    -			if (tmp == NULL) {
    -				DBG_ERR("talloc_strdup failed for dc_unc[%s]\n",
    -					domain_info->dc_unc);
    -				talloc_destroy(mem_ctx);
    -				return false;
    -			}
    -			if (domain->alt_name == NULL) {
    -				domain->alt_name = talloc_strdup(domain,
    -								 domain_info->domain_name);
    -				if (domain->alt_name == NULL) {
    -					DBG_ERR("talloc_strdup failed for "
    -						"domain_info->domain_name[%s]\n",
    -						domain_info->domain_name);
    -					talloc_destroy(mem_ctx);
    -					return false;
    -				}
    -			}
    -			if (domain->forest_name == NULL) {
    -				domain->forest_name = talloc_strdup(domain,
    -								    domain_info->forest_name);
    -				if (domain->forest_name == NULL) {
    -					DBG_ERR("talloc_strdup failed for "
    -						"domain_info->forest_name[%s]\n",
    -						domain_info->forest_name);
    -					talloc_destroy(mem_ctx);
    -					return false;
    -				}
    -			}
    -		}
    -	} else {
    -		result = dcerpc_netr_GetAnyDCName(b, mem_ctx,
    -						  our_domain->dcname,
    -						  domain->name,
    -						  &tmp,
    -						  &werr);
    -	}
    -
    -	/* And restore our original timeout. */
    -	rpccli_set_timeout(netlogon_pipe, orig_timeout);
    -
    -	if (!NT_STATUS_IS_OK(result)) {
    -		DEBUG(10,("dcerpc_netr_GetAnyDCName failed: %s\n",
    -			nt_errstr(result)));
    -		talloc_destroy(mem_ctx);
    -		return false;
    -	}
    -
    -	if (!W_ERROR_IS_OK(werr)) {
    -		DEBUG(10,("dcerpc_netr_GetAnyDCName failed: %s\n",
    -			   win_errstr(werr)));
    -		talloc_destroy(mem_ctx);
    -		return false;
    -	}
    -
    -	/* dcerpc_netr_GetAnyDCName gives us a name with \\ */
    -	p = strip_hostname(tmp);
    -
    -	fstrcpy(dcname, p);
    -
    -	talloc_destroy(mem_ctx);
    -
    -	DEBUG(10,("dcerpc_netr_GetAnyDCName returned %s\n", dcname));
    -
    -	if (!resolve_name(dcname, dc_ss, 0x20, true)) {
    -		return False;
    -	}
    -
    -	return True;
    -}
    -
     /**
      * Helper function to assemble trust password and account name
      */
    @@ -1307,24 +1173,8 @@ static bool get_dcs(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
     	struct  samba_sockaddr *sa_list = NULL;
     	size_t     salist_size = 0;
     	size_t     i;
    -	bool    is_our_domain;
     	enum security_types sec = (enum security_types)lp_security();
     
    -	is_our_domain = strequal(domain->name, lp_workgroup());
    -
    -	/* If not our domain, get the preferred DC, by asking our primary DC */
    -	if ( !is_our_domain
    -		&& get_dc_name_via_netlogon(domain, dcname, &ss, request_flags)
    -		&& add_one_dc_unique(mem_ctx, domain->name, dcname, &ss, dcs,
    -		       num_dcs) )
    -	{
    -		char addr[INET6_ADDRSTRLEN];
    -		print_sockaddr(addr, sizeof(addr), &ss);
    
    
    -- 
    Samba Shared Repository
    
    
    From janger at samba.org  Mon Jul  7 16:29:17 2025
    From: janger at samba.org (Jule Anger)
    Date: Mon, 07 Jul 2025 16:29:17 +0000
    Subject: [SCM] Samba Website Repository - branch master updated
    Message-ID: 
    
    The branch, master has been updated
           via  d42b09c NEWS[4.21.7]: Samba 4.22.3 and 4.21.7 Available for Download
          from  ec77184 docs: remove links ti old and crufted translations
    
    https://git.samba.org/?p=samba-web.git;a=shortlog;h=master
    
    
    - Log -----------------------------------------------------------------
    commit d42b09cfcc134c457566c964967fe18435ff4f2a
    Author: Jule Anger 
    Date:   Mon Jul 7 18:11:45 2025 +0200
    
        NEWS[4.21.7]: Samba 4.22.3 and 4.21.7 Available for Download
        
        Signed-off-by: Jule Anger 
    
    -----------------------------------------------------------------------
    
    Summary of changes:
     history/header_history.html                      |  2 +
     history/samba-4.21.7.html                        | 81 +++++++++++++++++++++++
     history/samba-4.22.3.html                        | 84 ++++++++++++++++++++++++
     posted_news/20250707-161349.4.21.7.body.html     | 21 ++++++
     posted_news/20250707-161349.4.21.7.headline.html |  3 +
     5 files changed, 191 insertions(+)
     create mode 100644 history/samba-4.21.7.html
     create mode 100644 history/samba-4.22.3.html
     create mode 100644 posted_news/20250707-161349.4.21.7.body.html
     create mode 100644 posted_news/20250707-161349.4.21.7.headline.html
    
    
    Changeset truncated at 500 lines:
    
    diff --git a/history/header_history.html b/history/header_history.html
    index 9f73997..85ce85a 100755
    --- a/history/header_history.html
    +++ b/history/header_history.html
    @@ -9,9 +9,11 @@
     		
  • Release Notes