s3:idmap_ldap: trim the " chars from the location string in idmap_ldap_db_init
authorMichael Adam <obnox@samba.org>
Fri, 20 Nov 2009 11:44:43 +0000 (12:44 +0100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 13 Jan 2010 13:00:55 +0000 (14:00 +0100)
Fix bug #6910 (idmap_ldap stumbles over idmap backend = ldap:"ldap://ldap1
ldap://ldap2"=.

When idmap backend is specified as
idmap backend = ldap:"ldap://server1 ldap://server2"
then currently "ldap://server1 ldap://server2" was passed to
ldap_initialize including the quotes, leading to an ldap error.

Michael
(cherry picked from commit 67f1d0ac6edecec4efb100ae61bc23bd321f518f)

source/winbindd/idmap_ldap.c

index 7a0e32b769ade86aee5425c49acbb7e4b2621e9d..ac5f7c8845d71e7abe5a13fecd56cb0537c0637a 100644 (file)
@@ -853,6 +853,8 @@ static NTSTATUS idmap_ldap_db_init(struct idmap_domain *dom,
        }
        CHECK_ALLOC_DONE(ctx->url);
 
+       trim_char(ctx->url, '\"', '\"');
+
         tmp = lp_parm_const_string(-1, config_option, "ldap_base_dn", NULL);
         if ( ! tmp || ! *tmp) {
                 tmp = lp_ldap_idmap_suffix();