Author: idra Date: 2007-09-10 16:20:41 +0000 (Mon, 10 Sep 2007) New Revision: 25058
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25058 Log: Fix #4772 the idmap ldap suffix was evaluated in the wrong order resulting in the code giving precedence to the old global prameter instead of the one specified for the specific idmap domain configuration. Modified: branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c Changeset: Modified: branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c =================================================================== --- branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c 2007-09-10 15:14:39 UTC (rev 25057) +++ branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c 2007-09-10 16:20:41 UTC (rev 25058) @@ -287,16 +287,9 @@ } CHECK_ALLOC_DONE( idmap_alloc_ldap->url ); - tmp = lp_ldap_idmap_suffix(); + tmp = lp_parm_const_string(-1, "idmap alloc config", "ldap_base_dn", NULL); if ( ! tmp || ! *tmp) { - tmp = lp_parm_const_string(-1, "idmap alloc config", "ldap_base_dn", NULL); - } - if ( ! tmp) { - tmp = lp_ldap_suffix(); - if (tmp) { - DEBUG(1, ("WARNING: Trying to use the global ldap suffix(%s)\n", tmp)); - DEBUGADD(1, ("as suffix. This may not be what you want!\n")); - } + tmp = lp_ldap_idmap_suffix(); if ( ! tmp) { DEBUG(1, ("ERROR: missing idmap ldap suffix\n")); ret = NT_STATUS_UNSUCCESSFUL; @@ -780,21 +773,16 @@ } CHECK_ALLOC_DONE(ctx->url); - tmp = lp_ldap_idmap_suffix(); - if ( ! tmp || ! *tmp) { - tmp = lp_parm_const_string(-1, config_option, "ldap_base_dn", NULL); - } - if ( ! tmp) { - tmp = lp_ldap_suffix(); - if (tmp) { - DEBUG(1, ("WARNING: Trying to use the global ldap suffix(%s)\n", tmp)); - DEBUGADD(1, ("as suffix. This may not be what you want!\n")); - } else { - DEBUG(1, ("ERROR: missing idmap ldap suffix\n")); - ret = NT_STATUS_UNSUCCESSFUL; - goto done; - } - } + tmp = lp_parm_const_string(-1, config_option, "ldap_base_dn", NULL); + if ( ! tmp || ! *tmp) { + tmp = lp_ldap_idmap_suffix(); + if ( ! tmp) { + DEBUG(1, ("ERROR: missing idmap ldap suffix\n")); + ret = NT_STATUS_UNSUCCESSFUL; + goto done; + } + } + ctx->suffix = talloc_strdup(ctx, tmp); CHECK_ALLOC_DONE(ctx->suffix);