[SCM] Samba Shared Repository - branch v3-5-test updated

Karolin Seeger kseeger at samba.org
Thu Apr 1 07:22:15 MDT 2010


The branch, v3-5-test has been updated
       via  01b60b1... s3:winbindd: make sure we don't try rpc requests against unaccessable domains
      from  5567d48... WHATSNEW: Update changes since 3.5.1.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -----------------------------------------------------------------
commit 01b60b113869f526dcf3bb478d70df21dbb207c8
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Apr 1 09:29:38 2010 +0200

    s3:winbindd: make sure we don't try rpc requests against unaccessable domains
    
    This makes sure we don't crash while trying to dereference domain->conn.cli->foo
    while trying to establish a rpc connection to the server.
    
    This fixes bug #7316.
    
    metze
    (cherry picked from commit d930904b997d310aeff781bde1e7e3ce47dde8a1)

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

Summary of changes:
 source3/winbindd/winbindd_cm.c |   33 ++++++++++++++++++++++++++++-----
 1 files changed, 28 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index e8677bb..62466f8 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1631,7 +1631,13 @@ static NTSTATUS init_dc_connection_network(struct winbindd_domain *domain)
 	NTSTATUS result;
 
 	/* Internal connections never use the network. */
-	if (domain->internal || !winbindd_can_contact_domain(domain)) {
+	if (domain->internal) {
+		domain->initialized = True;
+		return NT_STATUS_OK;
+	}
+
+	if (!winbindd_can_contact_domain(domain)) {
+		invalidate_cm_connection(&domain->conn);
 		domain->initialized = True;
 		return NT_STATUS_OK;
 	}
@@ -1664,6 +1670,23 @@ NTSTATUS init_dc_connection(struct winbindd_domain *domain)
 	return init_dc_connection_network(domain);
 }
 
+static NTSTATUS init_dc_connection_rpc(struct winbindd_domain *domain)
+{
+	NTSTATUS status;
+
+	status = init_dc_connection(domain);
+	if (!NT_STATUS_IS_OK(status)) {
+		return status;
+	}
+
+	if (!domain->internal && domain->conn.cli == NULL) {
+		/* happens for trusted domains without inbound trust */
+		return NT_STATUS_TRUSTED_DOMAIN_FAILURE;
+	}
+
+	return NT_STATUS_OK;
+}
+
 /******************************************************************************
  Set the trust flags (direction and forest location) for a domain
 ******************************************************************************/
@@ -2010,7 +2033,7 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 	char *machine_account = NULL;
 	char *domain_name = NULL;
 
-	result = init_dc_connection(domain);
+	result = init_dc_connection_rpc(domain);
 	if (!NT_STATUS_IS_OK(result)) {
 		return result;
 	}
@@ -2193,7 +2216,7 @@ NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain,
 
 	DEBUG(10,("cm_connect_lsa_tcp\n"));
 
-	status = init_dc_connection(domain);
+	status = init_dc_connection_rpc(domain);
 	if (!NT_STATUS_IS_OK(status)) {
 		return status;
 	}
@@ -2239,7 +2262,7 @@ NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 	NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
 	struct netlogon_creds_CredentialState *p_creds;
 
-	result = init_dc_connection(domain);
+	result = init_dc_connection_rpc(domain);
 	if (!NT_STATUS_IS_OK(result))
 		return result;
 
@@ -2371,7 +2394,7 @@ NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
 
 	*cli = NULL;
 
-	result = init_dc_connection(domain);
+	result = init_dc_connection_rpc(domain);
 	if (!NT_STATUS_IS_OK(result)) {
 		return result;
 	}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list