mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Various udpates for SyncRepl
This commit is contained in:
parent
b3e62ef604
commit
aaa66d254e
@ -312,10 +312,13 @@ retry: /* transaction retry */
|
|||||||
#endif
|
#endif
|
||||||
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
|
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
|
||||||
rs->sr_text = "no write access to parent";
|
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 {
|
} else {
|
||||||
|
#endif
|
||||||
#ifdef NEW_LOGGING
|
#ifdef NEW_LOGGING
|
||||||
LDAP_LOG ( OPERATION, DETAIL1, "bdb_add: %s denied\n",
|
LDAP_LOG ( OPERATION, DETAIL1, "bdb_add: %s denied\n",
|
||||||
pdn.bv_len == 0 ? "suffix" : "entry at root", 0, 0 );
|
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",
|
pdn.bv_len == 0 ? "suffix" : "entry at root",
|
||||||
0, 0 );
|
0, 0 );
|
||||||
#endif
|
#endif
|
||||||
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
|
rs->sr_err = LDAP_NO_SUCH_OBJECT;
|
||||||
goto return_results;
|
goto return_results;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -339,9 +342,9 @@ retry: /* transaction retry */
|
|||||||
"bdb_add: no parent, cannot add subentry\n",
|
"bdb_add: no parent, cannot add subentry\n",
|
||||||
0, 0, 0 );
|
0, 0, 0 );
|
||||||
#endif
|
#endif
|
||||||
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
|
rs->sr_err = LDAP_NO_SUCH_OBJECT;
|
||||||
rs->sr_text = "no parent, cannot add subentry";
|
rs->sr_text = "no parent, cannot add subentry";
|
||||||
goto return_results;;
|
goto return_results;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -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 ))) {
|
if ( e == NULL || ( !manageDSAit && is_entry_glue( e ))) {
|
||||||
#else
|
#else
|
||||||
if ( e == NULL ) {
|
if ( e == NULL ) {
|
||||||
@ -240,11 +240,7 @@ retry: /* transaction retry */
|
|||||||
op->o_req_dn.bv_val, 0, 0);
|
op->o_req_dn.bv_val, 0, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LDAP_SYNCREPL
|
|
||||||
if ( e == NULL && matched != NULL && !is_entry_glue( matched )) {
|
|
||||||
#else
|
|
||||||
if ( matched != NULL ) {
|
if ( matched != NULL ) {
|
||||||
#endif
|
|
||||||
rs->sr_matched = ch_strdup( matched->e_dn );
|
rs->sr_matched = ch_strdup( matched->e_dn );
|
||||||
rs->sr_ref = is_entry_referral( matched )
|
rs->sr_ref = is_entry_referral( matched )
|
||||||
? get_entry_referrals( op, matched )
|
? get_entry_referrals( op, matched )
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
#include "back-bdb.h"
|
#include "back-bdb.h"
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* dn2entry - look up dn in the cache/indexes and return the corresponding
|
* 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
|
* entry. If the requested DN is not found and matched is TRUE, return info
|
||||||
|
@ -411,14 +411,12 @@ retry: /* transaction retry */
|
|||||||
|
|
||||||
e = ei->bei_e;
|
e = ei->bei_e;
|
||||||
/* acquire and lock entry */
|
/* acquire and lock entry */
|
||||||
#ifdef LDAP_SYNCREPL
|
#ifdef LDAP_SYNCREPL /* FIXME: dn2entry() should return non-glue entry */
|
||||||
if ( rs->sr_err == DB_NOTFOUND || !e ||
|
if (( rs->sr_err == DB_NOTFOUND ) || ( !manageDSAit && e && is_entry_glue( e ))) {
|
||||||
( !manageDSAit && is_entry_glue( e ))) {
|
|
||||||
if ( e != NULL && !is_entry_glue( e )) {
|
|
||||||
#else
|
#else
|
||||||
if ( rs->sr_err == DB_NOTFOUND ) {
|
if ( rs->sr_err == DB_NOTFOUND ) {
|
||||||
if ( e != NULL ) {
|
|
||||||
#endif
|
#endif
|
||||||
|
if ( e != NULL ) {
|
||||||
rs->sr_matched = ch_strdup( e->e_dn );
|
rs->sr_matched = ch_strdup( e->e_dn );
|
||||||
rs->sr_ref = is_entry_referral( e )
|
rs->sr_ref = is_entry_referral( e )
|
||||||
? get_entry_referrals( op, e )
|
? get_entry_referrals( op, e )
|
||||||
|
@ -160,14 +160,12 @@ retry: /* transaction retry */
|
|||||||
}
|
}
|
||||||
|
|
||||||
e = ei->bei_e;
|
e = ei->bei_e;
|
||||||
#ifdef LDAP_SYNCREPL
|
#ifdef LDAP_SYNCREPL /* FIXME: dn2entry() should return non-glue entry */
|
||||||
if ( rs->sr_err == DB_NOTFOUND || !e ||
|
if (( rs->sr_err == DB_NOTFOUND ) || ( !manageDSAit && e && is_entry_glue( e ))) {
|
||||||
( !manageDSAit && is_entry_glue( e ))) {
|
|
||||||
if( e != NULL && !is_entry_glue( e )) {
|
|
||||||
#else
|
#else
|
||||||
if ( rs->sr_err == DB_NOTFOUND ) {
|
if ( rs->sr_err == DB_NOTFOUND ) {
|
||||||
if( e != NULL ) {
|
|
||||||
#endif
|
#endif
|
||||||
|
if( e != NULL ) {
|
||||||
rs->sr_matched = ch_strdup( e->e_dn );
|
rs->sr_matched = ch_strdup( e->e_dn );
|
||||||
rs->sr_ref = is_entry_referral( e )
|
rs->sr_ref = is_entry_referral( e )
|
||||||
? get_entry_referrals( op, e )
|
? get_entry_referrals( op, e )
|
||||||
@ -687,6 +685,7 @@ retry: /* transaction retry */
|
|||||||
new_ndn.bv_val, 0, 0 );
|
new_ndn.bv_val, 0, 0 );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Shortcut the search */
|
/* Shortcut the search */
|
||||||
nei = neip ? neip : eip;
|
nei = neip ? neip : eip;
|
||||||
rs->sr_err = bdb_cache_find_ndn ( op, ltid, &new_ndn, &nei, locker );
|
rs->sr_err = bdb_cache_find_ndn ( op, ltid, &new_ndn, &nei, locker );
|
||||||
|
@ -175,6 +175,7 @@ retry: /* transaction retry */
|
|||||||
|
|
||||||
#ifdef LDAP_SYNCREPL
|
#ifdef LDAP_SYNCREPL
|
||||||
if ( e == NULL || is_entry_glue( e )) {
|
if ( e == NULL || is_entry_glue( e )) {
|
||||||
|
/* FIXME: dn2entry() should return non-glue entry */
|
||||||
#else
|
#else
|
||||||
if ( e == NULL ) {
|
if ( e == NULL ) {
|
||||||
#endif
|
#endif
|
||||||
@ -191,6 +192,7 @@ retry: /* transaction retry */
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BDB_ALIASES
|
#ifdef BDB_ALIASES
|
||||||
if( is_entry_alias( e ) ) {
|
if( is_entry_alias( e ) ) {
|
||||||
/* entry is an alias, don't allow operation */
|
/* entry is an alias, don't allow operation */
|
||||||
|
@ -887,7 +887,9 @@ id2entry_retry:
|
|||||||
|
|
||||||
rs->sr_entry = e;
|
rs->sr_entry = e;
|
||||||
#ifdef BDB_SUBENTRIES
|
#ifdef BDB_SUBENTRIES
|
||||||
|
/* FIXME: send all but syncrepl
|
||||||
if ( !is_sync_protocol( sop ) ) {
|
if ( !is_sync_protocol( sop ) ) {
|
||||||
|
*/
|
||||||
if ( is_entry_subentry( e ) ) {
|
if ( is_entry_subentry( e ) ) {
|
||||||
if( sop->oq_search.rs_scope != LDAP_SCOPE_BASE ) {
|
if( sop->oq_search.rs_scope != LDAP_SCOPE_BASE ) {
|
||||||
if(!get_subentries_visibility( sop )) {
|
if(!get_subentries_visibility( sop )) {
|
||||||
@ -906,7 +908,9 @@ id2entry_retry:
|
|||||||
/* only subentries are visible */
|
/* only subentries are visible */
|
||||||
goto loop_continue;
|
goto loop_continue;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Does this candidate actually satisfy the search scope?
|
/* Does this candidate actually satisfy the search scope?
|
||||||
@ -1017,8 +1021,7 @@ id2entry_retry:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LDAP_SYNCREPL
|
#ifdef LDAP_SYNCREPL
|
||||||
if ( !manageDSAit && is_entry_glue( e ) )
|
if ( !manageDSAit && is_entry_glue( e )) {
|
||||||
{
|
|
||||||
goto loop_continue;
|
goto loop_continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user