r17271: Fix a regression in the ldapsam uri syntax.
authorGerald Carter <jerry@samba.org>
Thu, 27 Jul 2006 12:20:19 +0000 (12:20 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:38:23 +0000 (11:38 -0500)
Allow multiple LDAP URIs to be grouped by  ""

source/passdb/pdb_ldap.c

index 7dc76dafe7b47890cd6159b27f6ef3db23a36fea..afc95fe90f1cb3e65e84d1cfa6e841caae105591 100644 (file)
@@ -5492,15 +5492,15 @@ NTSTATUS pdb_init_ldapsam_compat(struct pdb_methods **pdb_method, const char *lo
        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";
 
        ldap_state = (struct ldapsam_privates *)((*pdb_method)->private_data);
@@ -5527,8 +5527,13 @@ NTSTATUS pdb_init_ldapsam(struct pdb_methods **pdb_method, const char *location)
        DOM_SID secrets_domain_sid;
        pstring domain_sid_string;
        char *dn;
+       char *uri = talloc_strdup( NULL, location );
+
+       trim_char( uri, '\"', '\"' );
+       nt_status = pdb_init_ldapsam_common(pdb_method, uri);
+       if ( uri )
+               TALLOC_FREE( uri );
 
-       nt_status = pdb_init_ldapsam_common(pdb_method, location);
        if (!NT_STATUS_IS_OK(nt_status)) {
                return nt_status;
        }