From: Hallvard Furuseth Date: Tue, 15 Apr 2008 22:22:38 +0000 (+0000) Subject: For ITS#5408: back-ldif cannot currently handle multiple database suffixes. X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~18 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e67144ca7c2eaa6fced7e7c041be87258cf3fe55;p=openldap For ITS#5408: back-ldif cannot currently handle multiple database suffixes. So make olcDbDirectory SINGLE-VALUE and set SLAP_DBFLAG_ONE_SUFFIX. Take advantage of that in ldif_back_referrals(). --- diff --git a/servers/slapd/back-ldif/ldif.c b/servers/slapd/back-ldif/ldif.c index be9678e4af..79179742d2 100644 --- a/servers/slapd/back-ldif/ldif.c +++ b/servers/slapd/back-ldif/ldif.c @@ -67,7 +67,7 @@ static ConfigTable ldifcfg[] = { "( OLcfgDbAt:0.1 NAME 'olcDbDirectory' " "DESC 'Directory for database content' " "EQUALITY caseIgnoreMatch " - "SYNTAX OMsDirectoryString )", NULL, NULL }, + "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL }, { NULL, NULL, 0, 0, 0, ARG_IGNORED, NULL, NULL, NULL, NULL } }; @@ -722,15 +722,15 @@ ldif_back_referrals( Operation *op, SlapReply *rs ) if ( entry == NULL ) { struct berval odn = op->o_req_dn; struct berval ondn = op->o_req_ndn; + struct berval pndn = ondn; + ber_len_t min_dnlen = op->o_bd->be_nsuffix[0].bv_len; - struct berval pndn = op->o_req_ndn; + if ( min_dnlen == 0 ) + min_dnlen = 1; /* catch empty DN */ for ( ; entry == NULL; ) { dnParent( &pndn, &pndn ); - - if ( BER_BVISEMPTY( &pndn ) - || !dnIsSuffix( &pndn, &op->o_bd->be_nsuffix[0] ) ) - { + if ( pndn.bv_len < min_dnlen ) { break; } @@ -1349,6 +1349,7 @@ ldif_back_db_init( BackendDB *be, ConfigReply *cr ) be->be_private = li; be->be_cf_ocs = ldifocs; ldap_pvt_thread_rdwr_init(&li->li_rdwr); + SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_ONE_SUFFIX; return 0; }