svn commit: samba r21382 - in branches: SAMBA_3_0/source/nsswitch SAMBA_3_0/source/rpc_client SAMBA_3_0_25/source/nsswitch SAMBA_3_0_25/source/rpc_client

gd at samba.org gd at samba.org
Fri Feb 16 13:30:26 GMT 2007


Author: gd
Date: 2007-02-16 13:30:19 +0000 (Fri, 16 Feb 2007)
New Revision: 21382

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

Log:
Important fix for winbind when using non-AD domains.

Jeremy, I'm afraid you removed the "domain->initialized" from the
set_dc_types_and_flags() call when the connect to PI_LSARPC_DS failed
(with rev. 19148).

This causes now that init_dc_connection_network is called again and
again which in turn rescans the DC each time (which of course fails each
time with NT_STATUS_BUFFER_TOO_SMALL). Just continue with the
non-PI_LSARPC_DS scan so that the domain is initialized properly.

Guenther


Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c
   branches/SAMBA_3_0/source/rpc_client/cli_pipe.c
   branches/SAMBA_3_0_25/source/nsswitch/winbindd_cm.c
   branches/SAMBA_3_0_25/source/rpc_client/cli_pipe.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c	2007-02-16 12:47:08 UTC (rev 21381)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c	2007-02-16 13:30:19 UTC (rev 21382)
@@ -1539,7 +1539,12 @@
 		DEBUG(5, ("set_dc_type_and_flags: Could not bind to "
 			  "PI_LSARPC_DS on domain %s: (%s)\n",
 			  domain->name, nt_errstr(result)));
-		return;
+
+		/* if this is just a non-AD domain we need to continue
+		 * identifying so that we can in the end return with
+		 * domain->initialized = True - gd */
+
+		goto no_lsarpc_ds;
 	}
 
 	result = rpccli_ds_getprimarydominfo(cli, cli->cli->mem_ctx,
@@ -1561,6 +1566,7 @@
 		domain->native_mode = False;
 	}
 
+no_lsarpc_ds:
 	cli = cli_rpc_pipe_open_noauth(domain->conn.cli, PI_LSARPC, &result);
 
 	if (cli == NULL) {

Modified: branches/SAMBA_3_0/source/rpc_client/cli_pipe.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_client/cli_pipe.c	2007-02-16 12:47:08 UTC (rev 21381)
+++ branches/SAMBA_3_0/source/rpc_client/cli_pipe.c	2007-02-16 13:30:19 UTC (rev 21382)
@@ -2261,7 +2261,13 @@
 
 	*perr = rpc_pipe_bind(result, PIPE_AUTH_TYPE_NONE, PIPE_AUTH_LEVEL_NONE);
 	if (!NT_STATUS_IS_OK(*perr)) {
-		DEBUG(0, ("cli_rpc_pipe_open_noauth: rpc_pipe_bind for pipe %s failed with error %s\n",
+		int lvl = 0;
+		if (pipe_idx == PI_LSARPC_DS) {
+			/* non AD domains just don't have this pipe, avoid
+			 * level 0 statement in that case - gd */
+			lvl = 3;
+		}
+		DEBUG(lvl, ("cli_rpc_pipe_open_noauth: rpc_pipe_bind for pipe %s failed with error %s\n",
 			cli_get_pipe_name(pipe_idx), nt_errstr(*perr) ));
 		cli_rpc_pipe_close(result);
 		return NULL;

Modified: branches/SAMBA_3_0_25/source/nsswitch/winbindd_cm.c
===================================================================
--- branches/SAMBA_3_0_25/source/nsswitch/winbindd_cm.c	2007-02-16 12:47:08 UTC (rev 21381)
+++ branches/SAMBA_3_0_25/source/nsswitch/winbindd_cm.c	2007-02-16 13:30:19 UTC (rev 21382)
@@ -1539,7 +1539,12 @@
 		DEBUG(5, ("set_dc_type_and_flags: Could not bind to "
 			  "PI_LSARPC_DS on domain %s: (%s)\n",
 			  domain->name, nt_errstr(result)));
-		return;
+
+		/* if this is just a non-AD domain we need to continue
+		 * identifying so that we can in the end return with
+		 * domain->initialized = True - gd */
+
+		goto no_lsarpc_ds;
 	}
 
 	result = rpccli_ds_getprimarydominfo(cli, cli->cli->mem_ctx,
@@ -1561,6 +1566,7 @@
 		domain->native_mode = False;
 	}
 
+no_lsarpc_ds:
 	cli = cli_rpc_pipe_open_noauth(domain->conn.cli, PI_LSARPC, &result);
 
 	if (cli == NULL) {

Modified: branches/SAMBA_3_0_25/source/rpc_client/cli_pipe.c
===================================================================
--- branches/SAMBA_3_0_25/source/rpc_client/cli_pipe.c	2007-02-16 12:47:08 UTC (rev 21381)
+++ branches/SAMBA_3_0_25/source/rpc_client/cli_pipe.c	2007-02-16 13:30:19 UTC (rev 21382)
@@ -2261,7 +2261,13 @@
 
 	*perr = rpc_pipe_bind(result, PIPE_AUTH_TYPE_NONE, PIPE_AUTH_LEVEL_NONE);
 	if (!NT_STATUS_IS_OK(*perr)) {
-		DEBUG(0, ("cli_rpc_pipe_open_noauth: rpc_pipe_bind for pipe %s failed with error %s\n",
+		int lvl = 0;
+		if (pipe_idx == PI_LSARPC_DS) {
+			/* non AD domains just don't have this pipe, avoid
+			 * level 0 statement in that case - gd */
+			lvl = 3;
+		}
+		DEBUG(lvl, ("cli_rpc_pipe_open_noauth: rpc_pipe_bind for pipe %s failed with error %s\n",
 			cli_get_pipe_name(pipe_idx), nt_errstr(*perr) ));
 		cli_rpc_pipe_close(result);
 		return NULL;



More information about the samba-cvs mailing list