svn commit: samba r4691 - in branches/SAMBA_4_0/source/librpc/rpc: .

abartlet at samba.org abartlet at samba.org
Tue Jan 11 20:09:59 GMT 2005


Author: abartlet
Date: 2005-01-11 20:09:59 +0000 (Tue, 11 Jan 2005)
New Revision: 4691

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4691

Log:
Make the DCE-RPC bind code compleatly generic to the number of passes
that the GENSEC mechanism wishes to select.  It is of course up to the
GENSEC mech and the remote server to actually support this however...

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_auth.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_auth.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_auth.c	2005-01-11 16:53:02 UTC (rev 4690)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_auth.c	2005-01-11 20:09:59 UTC (rev 4691)
@@ -75,22 +75,30 @@
 	status = gensec_update(p->conn->security_state.generic_state, tmp_ctx,
 			       null_data_blob,
 			       &credentials);
-	if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
-		goto done;
-	}
 
 	p->conn->security_state.auth_info->credentials = credentials;
 
-	status = dcerpc_bind_byuuid(p, tmp_ctx, uuid, version);
-	if (!NT_STATUS_IS_OK(status)) {
+	if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
+		/* We are demanding a reply, so use a request that will get us one */
+		status = dcerpc_bind_byuuid(p, tmp_ctx, uuid, version);
+		if (!NT_STATUS_IS_OK(status)) {
+			goto done;
+		}
+	} else if (NT_STATUS_IS_OK(status)) {
+		/* We don't care for the reply, so jump to the end */
+		status = dcerpc_bind_byuuid(p, tmp_ctx, uuid, version);
 		goto done;
+	} else {
+		/* Something broke in GENSEC - bail */
+		goto done;
 	}
 
 	while (1) {
 		status = gensec_update(p->conn->security_state.generic_state, tmp_ctx,
 				       p->conn->security_state.auth_info->credentials,
 				       &credentials);
-		if (!NT_STATUS_IS_OK(status) && !NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
+		if (!NT_STATUS_IS_OK(status) 
+		    && !NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
 			break;
 		}
 



More information about the samba-cvs mailing list