/* dynlist.c - dynamic list overlay */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2003-2005 The OpenLDAP Foundation.
+ * Copyright 2003-2006 The OpenLDAP Foundation.
* Portions Copyright 2004-2005 Pierangelo Masarati.
* All rights reserved.
*
o.ors_scope = lud->lud_scope;
if ( dli->dli_member_ad != NULL ) {
+ /* if ( lud->lud_attrs != NULL ),
+ * the URL should be ignored */
o.ors_attrs = slap_anlist_no_attrs;
} else if ( lud->lud_attrs == NULL ) {
op->o_tmpfree( o.ors_filterstr.bv_val, op->o_tmpmemctx );
lud->lud_filter = NULL;
}
- if ( lud ) {
- ldap_free_urldesc( lud );
- }
+ ldap_free_urldesc( lud );
}
rs->sr_entry = e;
* the assertion is FALSE rather than
* UNDEFINED */
rs->sr_err = LDAP_COMPARE_FALSE;
+ break;
}
return SLAP_CB_CONTINUE;
for ( dlip = (dynlist_info_t **)&on->on_bi.bi_private;
*dlip; dlip = &(*dlip)->dli_next )
- /* go to last */;
+ {
+ /* The check on objectClass may be relaxed */
+#if 0
+ if ( (*dlip)->dli_oc == oc ) {
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: "
+ "\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
+ "objectClass \"%s\" already mapped.\n",
+ fname, lineno, oc->soc_cname.bv_val );
+ return 1;
+ }
+#endif
+
+ if ( (*dlip)->dli_ad == ad ) {
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: "
+ "\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
+ "URL attributeDescription \"%s\" already mapped.\n",
+ fname, lineno, ad->ad_cname.bv_val );
+ return 1;
+ }
+
+ if ( member_ad != NULL && (*dlip)->dli_member_ad == member_ad ) {
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: "
+ "\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
+ "member attributeDescription \"%s\" already mapped.\n",
+ fname, lineno, member_ad->ad_cname.bv_val );
+ return 1;
+ }
+ }
*dlip = (dynlist_info_t *)ch_calloc( 1, sizeof( dynlist_info_t ) );
(*dlip)->dli_oc = oc;
for ( dlip = (dynlist_info_t **)&on->on_bi.bi_private;
*dlip; dlip = &(*dlip)->dli_next )
- /* go to last */;
+ {
+#if 0
+ /* The check on objectClass may be relaxed */
+ if ( (*dlip)->dli_oc == oc ) {
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: "
+ "\"dynlist-attrpair <member-ad> <URL-ad>\": "
+ "objectClass \"%s\" already mapped.\n",
+ fname, lineno, oc->soc_cname.bv_val );
+ return 1;
+ }
+#endif
+
+ if ( (*dlip)->dli_ad == ad ) {
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: "
+ "\"dynlist-attrpair <member-ad> <URL-ad>\": "
+ "URL attributeDescription \"%s\" already mapped.\n",
+ fname, lineno, ad->ad_cname.bv_val );
+ return 1;
+ }
+
+ if ( member_ad != NULL && (*dlip)->dli_member_ad == member_ad ) {
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: "
+ "\"dynlist-attrpair <member-ad> <URL-ad>\": "
+ "member attributeDescription \"%s\" already mapped.\n",
+ fname, lineno, member_ad->ad_cname.bv_val );
+ return 1;
+ }
+ }
*dlip = (dynlist_info_t *)ch_calloc( 1, sizeof( dynlist_info_t ) );
(*dlip)->dli_oc = oc;
}
}
+ for ( dlip = (dynlist_info_t **)&on->on_bi.bi_private;
+ *dlip; dlip = &(*dlip)->dli_next )
+ {
+ /* The check on objectClass may be relaxed */
+#if 0
+ if ( (*dlip)->dli_oc == oc ) {
+ snprintf( c->msg, sizeof( c->msg ),
+ "\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
+ "objectClass \"%s\" already mapped.\n",
+ oc->soc_cname.bv_val );
+ Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
+ c->log, c->msg, 0 );
+ return 1;
+ }
+#endif
+
+ if ( (*dlip)->dli_ad == ad ) {
+ snprintf( c->msg, sizeof( c->msg ),
+ "\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
+ "URL attributeDescription \"%s\" already mapped.\n",
+ ad->ad_cname.bv_val );
+ Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
+ c->log, c->msg, 0 );
+ return 1;
+ }
+
+ if ( member_ad != NULL && (*dlip)->dli_member_ad == member_ad ) {
+ snprintf( c->msg, sizeof( c->msg ),
+ "\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
+ "member attributeDescription \"%s\" already mapped.\n",
+ member_ad->ad_cname.bv_val );
+ Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
+ c->log, c->msg, 0 );
+ return 1;
+ }
+ }
+
if ( c->valx > 0 ) {
int i;
for ( dlip = (dynlist_info_t **)&on->on_bi.bi_private;
*dlip; dlip = &(*dlip)->dli_next )
- /* goto last */;
+ {
+ /* The check on objectClass may be relaxed */
+#if 0
+ if ( (*dlip)->dli_oc == oc ) {
+ snprintf( c->msg, sizeof( c->msg ),
+ "\"dynlist-attrpair <member-ad> <URL-ad>\": "
+ "objectClass \"%s\" already mapped.\n",
+ oc->soc_cname.bv_val );
+ Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
+ c->log, c->msg, 0 );
+ return 1;
+ }
+#endif
+
+ if ( (*dlip)->dli_ad == ad ) {
+ snprintf( c->msg, sizeof( c->msg ),
+ "\"dynlist-attrpair <member-ad> <URL-ad>\": "
+ "URL attributeDescription \"%s\" already mapped.\n",
+ ad->ad_cname.bv_val );
+ Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
+ c->log, c->msg, 0 );
+ return 1;
+ }
+
+ if ( member_ad != NULL && (*dlip)->dli_member_ad == member_ad ) {
+ snprintf( c->msg, sizeof( c->msg ),
+ "\"dynlist-attrpair <member-ad> <URL-ad>\": "
+ "member attributeDescription \"%s\" already mapped.\n",
+ member_ad->ad_cname.bv_val );
+ Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
+ c->log, c->msg, 0 );
+ return 1;
+ }
+ }
*dlip = (dynlist_info_t *)ch_calloc( 1, sizeof( dynlist_info_t ) );
}
static slap_overinst dynlist = { { NULL } };
+#ifdef TAKEOVER_DYNGROUP
static char *obsolete_names[] = {
"dyngroup",
NULL
};
+#endif
#if SLAPD_OVER_DYNLIST == SLAPD_MOD_DYNAMIC
static