]> git.sur5r.net Git - openldap/commitdiff
Various udpates for SyncRepl
authorJong Hyuk Choi <jongchoi@openldap.org>
Tue, 15 Jul 2003 00:43:39 +0000 (00:43 +0000)
committerJong Hyuk Choi <jongchoi@openldap.org>
Tue, 15 Jul 2003 00:43:39 +0000 (00:43 +0000)
servers/slapd/back-bdb/add.c
servers/slapd/back-bdb/delete.c
servers/slapd/back-bdb/dn2entry.c
servers/slapd/back-bdb/modify.c
servers/slapd/back-bdb/modrdn.c
servers/slapd/back-bdb/passwd.c
servers/slapd/back-bdb/search.c

index c2df351f8756b327839674ce6453ca602ac08fb6..c583e67eb910c116b6609ce900c7fbdf20462498 100644 (file)
@@ -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
        }
index 5a8c63d35b5c13936c5b77dfaa717a601d6a69c3..4fcfc35cfe157c15681ccb145ce6f31c49c476e0 100644 (file)
@@ -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 )
index ac20900f597b83fe48e8a592c33a0db843b61115..1479051802e21d7fe21ef6c36ff704943cfe9b05 100644 (file)
@@ -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
index 6bcaaa53d6b655575db254bfabac7b20e8ed6720..6df4d5d71b0765d9cc91ac827b102be0f7292aee 100644 (file)
@@ -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 )
index e2838a7e9b1a8363f457e59507e4d6a711eed93c..76ab5ee9c57272cc7f6aeee08300e3b0ca9ce06f 100644 (file)
@@ -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 );
index d847cd3ef5ebd8b3a219f310355ec6bb3a511c60..528f3c4cb4c5fbf6ae819e7bffb0a191a4bfdb5a 100644 (file)
@@ -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 */
index 5c362739de9deaae980a22d38ee74a6ef1875731..3772dfe4ba730ec6eaff0970a3f530b8dc892d52 100644 (file)
@@ -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