[Samba] SOLVED: 3.0.23 for Debian Sarge: LDAP problems

Gerald (Jerry) Carter jerry at samba.org
Thu Jul 27 12:18:48 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This time with the correct file attached.

Gerald (Jerry) Carter wrote:
> Uwe Laverenz wrote:
> 
>>> According to the smb.conf man page, it is allowed to 
>>> put the ldap URIs in double qoutes:
>>>
>>>     passdb backend = ldapsam:"ldap://ldap-1.example.com \
>>>                   ldap://ldap-2.example.com"
>>>
>>> This does not work for 3.0.23(a) anymore, it works 
>>> as soon as you remove the double quotes. I guess it
>>> has to do with the fact that the use of multiple passdb
>>> backends is not supported with 3.0.23.
> 
> Hmmmm...that should work.  It certainly wasn't an
> intentional change.  This patch should correct it.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEyK8oIR7qMdg1EfYRAiq3AKCd/YR8VfSVbtWntjKFuyJ+P4wi4gCeIQ/u
R8OXKwZA0GZGfZCNiIsvZ/4=
=aL6q
-----END PGP SIGNATURE-----
-------------- next part --------------
=== modified file 'source/passdb/pdb_ldap.c'
--- source/passdb/pdb_ldap.c	
+++ source/passdb/pdb_ldap.c	
@@ -5489,14 +5489,14 @@
 	struct ldapsam_privates *ldap_state;
 	char *uri = talloc_strdup( NULL, location );
 
-	if (!NT_STATUS_IS_OK(nt_status = pdb_init_ldapsam_common( pdb_method, uri ))) {
-		return nt_status;
-	}
-
-	/* the module itself stores a copy of the location so throw this one away */
-
+	trim_char( uri, '\"', '\"' );
+	nt_status = pdb_init_ldapsam_common( pdb_method, uri );
 	if ( uri )
 		TALLOC_FREE( uri );
+
+	if ( !NT_STATUS_IS_OK(nt_status) ) {
+		return nt_status;
+	}
 
 	(*pdb_method)->name = "ldapsam_compat";
 
@@ -5524,8 +5524,13 @@
 	DOM_SID secrets_domain_sid;
 	pstring domain_sid_string;
 	char *dn;
-
-	nt_status = pdb_init_ldapsam_common(pdb_method, location);
+	char *uri = talloc_strdup( NULL, location );
+
+	trim_char( uri, '\"', '\"' );
+	nt_status = pdb_init_ldapsam_common(pdb_method, uri);
+	if ( uri )
+		TALLOC_FREE( uri );
+
 	if (!NT_STATUS_IS_OK(nt_status)) {
 		return nt_status;
 	}



More information about the samba mailing list