From: Jong Hyuk Choi Date: Tue, 15 Jul 2003 00:43:39 +0000 (+0000) Subject: Various udpates for SyncRepl X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~822 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=aaa66d254e48f5451792dbedf8900d103c8db299;p=openldap Various udpates for SyncRepl --- diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index c2df351f87..c583e67eb9 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -312,10 +312,13 @@ retry: /* transaction retry */ #endif rs->sr_err = LDAP_INSUFFICIENT_ACCESS; rs->sr_text = "no write access to parent"; - goto return_results;; + goto return_results; } - +#ifdef LDAP_SYNCREPL + } else if ( !is_entry_glue( op->oq_add.rs_e )) { +#else } else { +#endif #ifdef NEW_LOGGING LDAP_LOG ( OPERATION, DETAIL1, "bdb_add: %s denied\n", pdn.bv_len == 0 ? "suffix" : "entry at root", 0, 0 ); @@ -324,7 +327,7 @@ retry: /* transaction retry */ pdn.bv_len == 0 ? "suffix" : "entry at root", 0, 0 ); #endif - rs->sr_err = LDAP_INSUFFICIENT_ACCESS; + rs->sr_err = LDAP_NO_SUCH_OBJECT; goto return_results; } } @@ -339,9 +342,9 @@ retry: /* transaction retry */ "bdb_add: no parent, cannot add subentry\n", 0, 0, 0 ); #endif - rs->sr_err = LDAP_INSUFFICIENT_ACCESS; + rs->sr_err = LDAP_NO_SUCH_OBJECT; rs->sr_text = "no parent, cannot add subentry"; - goto return_results;; + goto return_results; } #endif } diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index 5a8c63d35b..4fcfc35cfe 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -226,7 +226,7 @@ retry: /* transaction retry */ } } -#ifdef LDAP_SYNCREPL +#ifdef LDAP_SYNCREPL /* FIXME : dn2entry() should return non-glue entry */ if ( e == NULL || ( !manageDSAit && is_entry_glue( e ))) { #else if ( e == NULL ) { @@ -240,11 +240,7 @@ retry: /* transaction retry */ op->o_req_dn.bv_val, 0, 0); #endif -#ifdef LDAP_SYNCREPL - if ( e == NULL && matched != NULL && !is_entry_glue( matched )) { -#else if ( matched != NULL ) { -#endif rs->sr_matched = ch_strdup( matched->e_dn ); rs->sr_ref = is_entry_referral( matched ) ? get_entry_referrals( op, matched ) diff --git a/servers/slapd/back-bdb/dn2entry.c b/servers/slapd/back-bdb/dn2entry.c index ac20900f59..1479051802 100644 --- a/servers/slapd/back-bdb/dn2entry.c +++ b/servers/slapd/back-bdb/dn2entry.c @@ -12,7 +12,6 @@ #include "back-bdb.h" - /* * dn2entry - look up dn in the cache/indexes and return the corresponding * entry. If the requested DN is not found and matched is TRUE, return info diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 6bcaaa53d6..6df4d5d71b 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -411,14 +411,12 @@ retry: /* transaction retry */ e = ei->bei_e; /* acquire and lock entry */ -#ifdef LDAP_SYNCREPL - if ( rs->sr_err == DB_NOTFOUND || !e || - ( !manageDSAit && is_entry_glue( e ))) { - if ( e != NULL && !is_entry_glue( e )) { +#ifdef LDAP_SYNCREPL /* FIXME: dn2entry() should return non-glue entry */ + if (( rs->sr_err == DB_NOTFOUND ) || ( !manageDSAit && e && is_entry_glue( e ))) { #else if ( rs->sr_err == DB_NOTFOUND ) { - if ( e != NULL ) { #endif + if ( e != NULL ) { rs->sr_matched = ch_strdup( e->e_dn ); rs->sr_ref = is_entry_referral( e ) ? get_entry_referrals( op, e ) diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index e2838a7e9b..76ab5ee9c5 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -160,14 +160,12 @@ retry: /* transaction retry */ } e = ei->bei_e; -#ifdef LDAP_SYNCREPL - if ( rs->sr_err == DB_NOTFOUND || !e || - ( !manageDSAit && is_entry_glue( e ))) { - if( e != NULL && !is_entry_glue( e )) { +#ifdef LDAP_SYNCREPL /* FIXME: dn2entry() should return non-glue entry */ + if (( rs->sr_err == DB_NOTFOUND ) || ( !manageDSAit && e && is_entry_glue( e ))) { #else if ( rs->sr_err == DB_NOTFOUND ) { - if( e != NULL ) { #endif + if( e != NULL ) { rs->sr_matched = ch_strdup( e->e_dn ); rs->sr_ref = is_entry_referral( e ) ? get_entry_referrals( op, e ) @@ -687,6 +685,7 @@ retry: /* transaction retry */ new_ndn.bv_val, 0, 0 ); #endif + /* Shortcut the search */ nei = neip ? neip : eip; rs->sr_err = bdb_cache_find_ndn ( op, ltid, &new_ndn, &nei, locker ); diff --git a/servers/slapd/back-bdb/passwd.c b/servers/slapd/back-bdb/passwd.c index d847cd3ef5..528f3c4cb4 100644 --- a/servers/slapd/back-bdb/passwd.c +++ b/servers/slapd/back-bdb/passwd.c @@ -175,6 +175,7 @@ retry: /* transaction retry */ #ifdef LDAP_SYNCREPL if ( e == NULL || is_entry_glue( e )) { + /* FIXME: dn2entry() should return non-glue entry */ #else if ( e == NULL ) { #endif @@ -191,6 +192,7 @@ retry: /* transaction retry */ goto done; } #endif + #ifdef BDB_ALIASES if( is_entry_alias( e ) ) { /* entry is an alias, don't allow operation */ diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index 5c362739de..3772dfe4ba 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -887,7 +887,9 @@ id2entry_retry: rs->sr_entry = e; #ifdef BDB_SUBENTRIES + /* FIXME: send all but syncrepl if ( !is_sync_protocol( sop ) ) { + */ if ( is_entry_subentry( e ) ) { if( sop->oq_search.rs_scope != LDAP_SCOPE_BASE ) { if(!get_subentries_visibility( sop )) { @@ -906,7 +908,9 @@ id2entry_retry: /* only subentries are visible */ goto loop_continue; } + /* } + */ #endif /* Does this candidate actually satisfy the search scope? @@ -1017,8 +1021,7 @@ id2entry_retry: } #ifdef LDAP_SYNCREPL - if ( !manageDSAit && is_entry_glue( e ) ) - { + if ( !manageDSAit && is_entry_glue( e )) { goto loop_continue; } #endif