The branch, master has been updated
       via  554ba5e ldb: Add more data test data for one level test cases
       via  9206eaa ldb: Add tests for the python api
       via  2dc9c07 dsdb-operational: rework the loop for attribute removal
       via  13b4815 ldb: Add more tests related to onelevel search
       via  057896a ldb: use strncmp instead of strcmp when comparing the val 
part
       via  87cbd94 ldb: make test output more readable
       via  75f422f ldb-tdb: Document ltdb_index_add1 for more clarity
       via  1e4e51f ldb-tdb: Fix a wrong parameter in ltdb_store
       via  2470b0f ldb_tdb: raise level of full index scan message so that it 
starts to be really visible
       via  1c0d348 dsdb-repl: make message more clearer
       via  7222ee0 replmetadata: raise msg level for conflict resolution so 
that we don't polute logs
       via  fdca2f6 dsdb-repl: do not ask to add ref when doing getncchange for 
an exop
       via  123954d dsdb-cracknames: Fix potential double free and memory leaks
      from  64eba0a BUG 9633: Recursive mget should continue on EPERM.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 554ba5ebbf1d2e520883cfad6f8a2ed6eb9b2b0f
Author: Matthieu Patou <[email protected]>
Date:   Tue Jan 8 00:09:32 2013 -0800

    ldb: Add more data test data for one level test cases
    
    Reviewed-by: Andrew Bartlett <[email protected]>
    
    Autobuild-User(master): Andrew Bartlett <[email protected]>
    Autobuild-Date(master): Fri Feb  8 06:46:40 CET 2013 on sn-devel-104

commit 9206eaaf5dbacade3ccc79d5900d4b242730b2f3
Author: Matthieu Patou <[email protected]>
Date:   Tue Jan 8 00:28:03 2013 -0800

    ldb: Add tests for the python api
    
    Reviewed-by: Andrew Bartlett <[email protected]>

commit 2dc9c072cbb9b857bf52e229573d92c9a70bdcf6
Author: Matthieu Patou <[email protected]>
Date:   Thu Dec 27 18:29:49 2012 -0800

    dsdb-operational: rework the loop for attribute removal
    
    Instead of doing ldb_in_list size(operational_remove) * (attrs_user +
    attr_searched) * number of entries times to get the list of attributes to 
remove we construct this
    list before the search and then use it for every entries.
    
    Reviewed-by: Andrew Bartlett <[email protected]>

commit 13b481594585cdb079dcf9b8cf892f5094f44a16
Author: Matthieu Patou <[email protected]>
Date:   Sat Dec 29 21:48:46 2012 -0800

    ldb: Add more tests related to onelevel search
    
    Reviewed-by: Andrew Bartlett <[email protected]>

commit 057896a090870ecec56ad0d2f960e55cef561e9e
Author: Matthieu Patou <[email protected]>
Date:   Thu Dec 13 02:18:34 2012 -0800

    ldb: use strncmp instead of strcmp when comparing the val part
    
    val part of a DN's component is DATA_BLOB and nothing insure that it
    will be finished by a '\0'
    
    Reviewed-by: Andrew Bartlett <[email protected]>

commit 87cbd9414bab2f0a71d71b2c145c11ee71acd573
Author: Matthieu Patou <[email protected]>
Date:   Sat Dec 29 16:42:28 2012 -0800

    ldb: make test output more readable
    
    Reviewed-by: Andrew Bartlett <[email protected]>

commit 75f422fe1df7dd04aa46d5c77cbeb43d101c3ad6
Author: Matthieu Patou <[email protected]>
Date:   Mon Dec 17 01:45:30 2012 -0800

    ldb-tdb: Document ltdb_index_add1 for more clarity
    
    Reviewed-by: Andrew Bartlett <[email protected]>

commit 1e4e51f4c913a3821d7ecbd0842280240917ae38
Author: Matthieu Patou <[email protected]>
Date:   Wed Dec 26 21:41:52 2012 -0800

    ldb-tdb: Fix a wrong parameter in ltdb_store
    
    Reviewed-by: Andrew Bartlett <[email protected]>

commit 2470b0fe5f3facf7bb41acbdb3028e2d5daaf8da
Author: Matthieu Patou <[email protected]>
Date:   Sun Jan 6 22:17:26 2013 -0800

    ldb_tdb: raise level of full index scan message so that it starts to be 
really visible
    
    We don't want to have to set log level to 4 or 5 AND set the environment
    variable to be able to see those log messages
    
    Reviewed-by: Andrew Bartlett <[email protected]>

commit 1c0d3486a485cf01338dd5eff49ce847628d1b83
Author: Matthieu Patou <[email protected]>
Date:   Wed Jan 23 11:33:30 2013 -0800

    dsdb-repl: make message more clearer
    
    Reviewed-by: Andrew Bartlett <[email protected]>

commit 7222ee0a245d340b526b8220d53c9ffd8c0c4dfa
Author: Matthieu Patou <[email protected]>
Date:   Sat Jan 26 01:53:41 2013 -0800

    replmetadata: raise msg level for conflict resolution so that we don't 
polute logs
    
    Reviewed-by: Andrew Bartlett <[email protected]>

commit fdca2f6ff47a389cb6300d3ea8327f8486de3c2a
Author: Matthieu Patou <[email protected]>
Date:   Sat Jan 26 01:53:28 2013 -0800

    dsdb-repl: do not ask to add ref when doing getncchange for an exop
    
    Reviewed-by: Andrew Bartlett <[email protected]>

commit 123954d94ee783bd241c89fa53fc902312176875
Author: Matthieu Patou <[email protected]>
Date:   Mon Dec 24 10:01:30 2012 -0800

    dsdb-cracknames: Fix potential double free and memory leaks
    
    Reviewed-by: Andrew Bartlett <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 lib/ldb/common/ldb_dn.c                         |    4 +-
 lib/ldb/ldb_tdb/ldb_index.c                     |   23 ++++-
 lib/ldb/ldb_tdb/ldb_search.c                    |    2 +-
 lib/ldb/ldb_tdb/ldb_tdb.c                       |    3 +-
 lib/ldb/tests/test-controls.sh                  |    6 +-
 lib/ldb/tests/test-tdb-features.sh              |    5 +
 lib/ldb/tests/test-tdb.sh                       |    8 ++
 lib/ldb/tests/test.ldif                         |   23 ++++
 source4/dsdb/repl/drepl_out_helpers.c           |    7 ++
 source4/dsdb/repl/replicated_objects.c          |    4 +-
 source4/dsdb/samdb/cracknames.c                 |    6 +-
 source4/dsdb/samdb/ldb_modules/operational.c    |  131 ++++++++++++++++-------
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c |    4 +-
 13 files changed, 169 insertions(+), 57 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/common/ldb_dn.c b/lib/ldb/common/ldb_dn.c
index b910489..14596f6 100644
--- a/lib/ldb/common/ldb_dn.c
+++ b/lib/ldb/common/ldb_dn.c
@@ -1097,7 +1097,7 @@ int ldb_dn_compare_base(struct ldb_dn *base, struct 
ldb_dn *dn)
                if (b_vlen != dn_vlen) {
                        return b_vlen - dn_vlen;
                }
-               ret = strcmp(b_vdata, dn_vdata);
+               ret = strncmp(b_vdata, dn_vdata, b_vlen);
                if (ret != 0) return ret;
 
                n_base--;
@@ -1176,7 +1176,7 @@ int ldb_dn_compare(struct ldb_dn *dn0, struct ldb_dn *dn1)
                if (dn0_vlen != dn1_vlen) {
                        return dn0_vlen - dn1_vlen;
                }
-               ret = strcmp(dn0_vdata, dn1_vdata);
+               ret = strncmp(dn0_vdata, dn1_vdata, dn0_vlen);
                if (ret != 0) {
                        return ret;
                }
diff --git a/lib/ldb/ldb_tdb/ldb_index.c b/lib/ldb/ldb_tdb/ldb_index.c
index d79417f..cf21092 100644
--- a/lib/ldb/ldb_tdb/ldb_index.c
+++ b/lib/ldb/ldb_tdb/ldb_index.c
@@ -1087,9 +1087,26 @@ int ltdb_search_indexed(struct ltdb_context *ac, 
uint32_t *match_count)
        return ret;
 }
 
-/*
-  add an index entry for one message element
-*/
+/**
+ * @brief Add a DN in the index list of a given attribute name/value pair
+ *
+ * This function will add the DN in the index list for the index for
+ * the given attribute name and value.
+ *
+ * @param[in]  module       A ldb_module structure
+ *
+ * @param[in]  dn           The string representation of the DN as it
+ *                          will be stored in the index entry
+ *
+ * @param[in]  el           A ldb_message_element array, one of the entry
+ *                          referred by the v_idx is the attribute name and
+ *                          value pair which will be used to construct the
+ *                          index name
+ *
+ * @param[in]  v_idx        The index of element in the el array to use
+ *
+ * @return                  An ldb error code
+ */
 static int ltdb_index_add1(struct ldb_module *module, const char *dn,
                           struct ldb_message_element *el, int v_idx)
 {
diff --git a/lib/ldb/ldb_tdb/ldb_search.c b/lib/ldb/ldb_tdb/ldb_search.c
index 26296c7..1e7e7ea 100644
--- a/lib/ldb/ldb_tdb/ldb_search.c
+++ b/lib/ldb/ldb_tdb/ldb_search.c
@@ -606,7 +606,7 @@ int ltdb_search(struct ltdb_context *ctx)
                                /* useful for debugging when slow performance
                                 * is caused by unindexed searches */
                                char *expression = ldb_filter_from_tree(ctx, 
ctx->tree);
-                               ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb FULL 
SEARCH: %s SCOPE: %s DN: %s\n",
+                               ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb FULL 
SEARCH: %s SCOPE: %s DN: %s",
                                                        expression,
                                                        
req->op.search.scope==LDB_SCOPE_BASE?"base":
                                                        
req->op.search.scope==LDB_SCOPE_ONELEVEL?"one":
diff --git a/lib/ldb/ldb_tdb/ldb_tdb.c b/lib/ldb/ldb_tdb/ldb_tdb.c
index 860ee14..4fb1516 100644
--- a/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -265,7 +265,8 @@ int ltdb_store(struct ldb_module *module, const struct 
ldb_message *msg, int flg
                return LDB_ERR_OTHER;
        }
 
-       ret = ldb_pack_data(module, msg, (struct ldb_val *)&tdb_data);
+       ret = ldb_pack_data(ldb_module_get_ctx(module),
+                           msg, (struct ldb_val *)&tdb_data);
        if (ret == -1) {
                talloc_free(tdb_key.dptr);
                return LDB_ERR_OTHER;
diff --git a/lib/ldb/tests/test-controls.sh b/lib/ldb/tests/test-controls.sh
index 771085e..328ed29 100755
--- a/lib/ldb/tests/test-controls.sh
+++ b/lib/ldb/tests/test-controls.sh
@@ -27,13 +27,13 @@ EOF
 $VALGRIND ldbsearch "(touchedBy=sample)" | grep "touchedBy: sample" || exit 1
 # This action are expected to fails because the sample module return an error 
when presented the relax control
 
-cat <<EOF | $VALGRIND ldbadd --controls "relax:0" && exit 1
+cat <<EOF | $VALGRIND ldbadd --controls "relax:0" >/dev/null 2>&1 && exit 1
 dn: dc=foobar
 dc: foobar
 someThing: someThingElse
 EOF
 
-cat <<EOF | $VALGRIND ldbmodify --controls "relax:0" && exit 1
+cat <<EOF | $VALGRIND ldbmodify --controls "relax:0" >/dev/null 2>&1 && exit 1
 dn: dc=bar
 changetype: modify
 replace someThing
@@ -41,5 +41,3 @@ someThing: someThingElseBetter
 EOF
 
 $VALGRIND ldbsearch --controls "bypassoperational:0" >/dev/null 2>&1 || exit 1
-
-set
diff --git a/lib/ldb/tests/test-tdb-features.sh 
b/lib/ldb/tests/test-tdb-features.sh
index 14437ff..59e61ee 100644
--- a/lib/ldb/tests/test-tdb-features.sh
+++ b/lib/ldb/tests/test-tdb-features.sh
@@ -154,6 +154,11 @@ dn: cn=three,cn=t1,cn=TEST
 objectClass: oneclass
 cn: three
 test: one
+
+dn: cn=four,cn=three,cn=t1,cn=TEST
+objectClass: oneclass
+cn: four
+test: one
 EOF
 checkone 3 "cn=t1,cn=TEST" '(test=one)'
 checkone 1 "cn=t1,cn=TEST" '(cn=two)'
diff --git a/lib/ldb/tests/test-tdb.sh b/lib/ldb/tests/test-tdb.sh
index 3310c81..82eef69 100755
--- a/lib/ldb/tests/test-tdb.sh
+++ b/lib/ldb/tests/test-tdb.sh
@@ -4,9 +4,12 @@ BINDIR=$1
 
 if [ -n "$TEST_DATA_PREFIX" ]; then
        LDB_URL="$TEST_DATA_PREFIX/tdbtest.ldb"
+       PYDESTDIR="$TEST_DATA_PREFIX"
 else
        LDB_URL="tdbtest.ldb"
+       PYDESTDIR="/tmp"
 fi
+mkdir $PYDESTDIR/tmp
 export LDB_URL
 
 PATH=$BINDIR:$PATH
@@ -35,3 +38,8 @@ $VALGRIND ldbadd $LDBDIR/tests/init.ldif || exit 1
 . $LDBDIR/tests/test-tdb-features.sh
 
 . $LDBDIR/tests/test-controls.sh
+
+which python >/dev/null 2>&1
+if [ $? -eq 0 ]; then
+       SELFTEST_PREFIX=$PYDESTDIR PYTHONPATH=$BINDIR/python python 
$LDBDIR/tests/python/api.py
+fi
diff --git a/lib/ldb/tests/test.ldif b/lib/ldb/tests/test.ldif
index fd37f00..c6189bf 100644
--- a/lib/ldb/tests/test.ldif
+++ b/lib/ldb/tests/test.ldif
@@ -195,6 +195,15 @@ description: All Alumni Assoc Staff
 cn: Alumni Assoc Staff
 objectclass: groupofnames
 
+dn: cn=Finance, cn=Alumni Assoc Staff,ou=Groups,o=University of Michigan,c=TEST
+member: cn=Manager,o=University of Michigan,c=TEST
+member: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=University of Mic
+ higan,c=TEST
+owner: cn=Manager,o=University of Michigan,c=TEST
+description: Finance group
+cn: Finance
+objectclass: groupofnames
+
 dn: ou=Alumni Association,ou=People,o=University of Michigan,c=TEST
 objectclass: organizationalUnit
 ou: Alumni Association
@@ -415,3 +424,17 @@ objectclass: OpenLDAPperson
 cn: Fred Bassett
 sn: Bassett
 uid: Bassett, Fred
+
+dn: o=ESCPI  ,  o=CNAM,c=TEST
+objectclass: organizationalUnit
+o: ESCPI
+o: CNAM
+
+dn: o=ESCPI  ,  uo=CNAM,c=TEST
+objectclass: organizationalUnit
+o: ESCPI
+uo: CNAM
+
+dn: cn=mat,o=ESCPI,o=CNAM,c=TEST
+objectclass: person
+cn: mat
diff --git a/source4/dsdb/repl/drepl_out_helpers.c 
b/source4/dsdb/repl/drepl_out_helpers.c
index 57205a8..8ddce32 100644
--- a/source4/dsdb/repl/drepl_out_helpers.c
+++ b/source4/dsdb/repl/drepl_out_helpers.c
@@ -439,6 +439,13 @@ static void 
dreplsrv_op_pull_source_get_changes_trigger(struct tevent_req *req)
                        replica_flags &= ~DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING;
                }
        }
+       if (state->op->extended_op != DRSUAPI_EXOP_NONE) {
+               /*
+                * If it's an exop never set the ADD_REF even if it's in
+                * repsFrom flags.
+                */
+               replica_flags &= ~DRSUAPI_DRS_ADD_REF;
+       }
 
        /* is this a full resync of all objects? */
        if (state->op->options & DRSUAPI_DRS_FULL_SYNC_NOW) {
diff --git a/source4/dsdb/repl/replicated_objects.c 
b/source4/dsdb/repl/replicated_objects.c
index 829c440..44c5de8 100644
--- a/source4/dsdb/repl/replicated_objects.c
+++ b/source4/dsdb/repl/replicated_objects.c
@@ -150,8 +150,8 @@ WERROR dsdb_repl_make_working_schema(struct ldb_context 
*ldb,
                }
                talloc_free(tmp_ctx);
 
-               DEBUG(4,("Schema load pass %d: %d/%d of %d objects left to be 
converted.\n",
-                        pass_no, failed_obj_count, converted_obj_count, 
object_count));
+               DEBUG(4,("Schema load pass %d: converted %d, %d of %d objects 
left to be converted.\n",
+                        pass_no, converted_obj_count, failed_obj_count, 
object_count));
                pass_no++;
 
                /* check if we converted any objects in this pass */
diff --git a/source4/dsdb/samdb/cracknames.c b/source4/dsdb/samdb/cracknames.c
index bcf82c6..15463a7 100644
--- a/source4/dsdb/samdb/cracknames.c
+++ b/source4/dsdb/samdb/cracknames.c
@@ -394,10 +394,10 @@ static WERROR 
get_format_functional_filtering_param(struct ldb_context *sam_ctx,
 
                account = name;
                s = strchr(account, '/');
+               talloc_free(domain_res);
                while(s) {
                        s[0] = '\0';
                        s++;
-                       talloc_free(domain_res);
 
                        ldb_ret = ldb_search(sam_ctx, mem_ctx, &domain_res,
                                                tmp_dn,
@@ -410,18 +410,20 @@ static WERROR 
get_format_functional_filtering_param(struct ldb_context *sam_ctx,
                                info1->status = 
DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR;
                                return WERR_OK;
                        }
+                       talloc_free(tmp_dn);
                        switch (domain_res->count) {
                        case 1:
                                break;
                        case 0:
+                               talloc_free(domain_res);
                                info1->status = 
DRSUAPI_DS_NAME_STATUS_NOT_FOUND;
                                return WERR_OK;
                        default:
+                               talloc_free(domain_res);
                                info1->status = 
DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE;
                                return WERR_OK;
                        }
 
-                       talloc_free(tmp_dn);
                        tmp_dn = talloc_steal(mem_ctx, domain_res->msgs[0]->dn);
                        talloc_free(domain_res);
                        search_dn = tmp_dn;
diff --git a/source4/dsdb/samdb/ldb_modules/operational.c 
b/source4/dsdb/samdb/ldb_modules/operational.c
index b1122b3..a34dee0 100644
--- a/source4/dsdb/samdb/ldb_modules/operational.c
+++ b/source4/dsdb/samdb/ldb_modules/operational.c
@@ -667,10 +667,12 @@ enum op_remove {
 
   Some of these are attributes that were once stored, but are now calculated
 */
-static const struct {
+struct op_attributes_operations {
        const char *attr;
        enum op_remove op;
-} operational_remove[] = {
+};
+
+static const struct op_attributes_operations operational_remove[] = {
        { "nTSecurityDescriptor",    OPERATIONAL_SD_FLAGS },
        { "msDS-KeyVersionNumber",   OPERATIONAL_REMOVE_UNLESS_CONTROL  },
        { "parentGUID",              OPERATIONAL_REMOVE_ALWAYS  },
@@ -692,6 +694,8 @@ static int operational_search_post_process(struct 
ldb_module *module,
                                           const char * const *attrs_from_user,
                                           const char * const 
*attrs_searched_for,
                                           struct op_controls_flags* 
controls_flags,
+                                          struct op_attributes_operations 
*list,
+                                          unsigned int list_size,
                                           struct ldb_request *parent)
 {
        struct ldb_context *ldb;
@@ -701,43 +705,8 @@ static int operational_search_post_process(struct 
ldb_module *module,
        ldb = ldb_module_get_ctx(module);
 
        /* removed any attrs that should not be shown to the user */
-       for (i=0; i<ARRAY_SIZE(operational_remove); i++) {
-               switch (operational_remove[i].op) {
-               case OPERATIONAL_REMOVE_UNASKED:
-                       if (ldb_attr_in_list(attrs_from_user, 
operational_remove[i].attr)) {
-                               continue;
-                       }
-                       if (ldb_attr_in_list(attrs_searched_for, 
operational_remove[i].attr)) {
-                               continue;
-                       }
-               case OPERATIONAL_REMOVE_ALWAYS:
-                       ldb_msg_remove_attr(msg, operational_remove[i].attr);
-                       break;
-               case OPERATIONAL_REMOVE_UNLESS_CONTROL:
-                       if (!check_keep_control_for_attribute(controls_flags, 
operational_remove[i].attr)) {
-                               ldb_msg_remove_attr(msg, 
operational_remove[i].attr);
-                               break;
-                       } else {
-                               continue;
-                       }
-               case OPERATIONAL_SD_FLAGS:
-                       if (ldb_attr_in_list(attrs_from_user, 
operational_remove[i].attr)) {
-                               continue;
-                       }
-                       if (controls_flags->sd) {
-                               if (attrs_from_user == NULL) {
-                                       continue;
-                               }
-                               if (attrs_from_user[0] == NULL) {
-                                       continue;
-                               }
-                               if (ldb_attr_in_list(attrs_from_user, "*")) {
-                                       continue;
-                               }
-                       }
-                       ldb_msg_remove_attr(msg, operational_remove[i].attr);
-                       break;
-               }
+       for (i=0; i < list_size; i++) {
+               ldb_msg_remove_attr(msg, list[i].attr);
        }
 
        for (a=0;attrs_from_user && attrs_from_user[a];a++) {
@@ -802,6 +771,8 @@ struct operational_context {
        enum ldb_scope scope;
        const char * const *attrs;
        struct op_controls_flags* controls_flags;
+       struct op_attributes_operations *list_operations;
+       unsigned int list_operations_size;
 };
 
 static int operational_callback(struct ldb_request *req, struct ldb_reply 
*ares)
@@ -829,7 +800,10 @@ static int operational_callback(struct ldb_request *req, 
struct ldb_reply *ares)
                                                      ac->scope,
                                                      ac->attrs,
                                                      req->op.search.attrs,
-                                                     ac->controls_flags, req);
+                                                     ac->controls_flags,
+                                                     ac->list_operations,
+                                                     ac->list_operations_size,
+                                                     req);
                if (ret != 0) {
                        return ldb_module_done(ac->req, NULL, NULL,
                                                LDB_ERR_OPERATIONS_ERROR);
@@ -849,6 +823,74 @@ static int operational_callback(struct ldb_request *req, 
struct ldb_reply *ares)
        return LDB_SUCCESS;
 }
 
+static struct op_attributes_operations* operation_get_op_list(TALLOC_CTX *ctx,
+                                                             const char* 
const* attrs,
+                                                             const char* 
const* searched_attrs,
+                                                             struct 
op_controls_flags* controls_flags)
+{
+       int idx = 0;
+       int i;
+       struct op_attributes_operations *list = talloc_zero_array(ctx,
+                                                                 struct 
op_attributes_operations,
+                                                                 
ARRAY_SIZE(operational_remove) + 1);
+
+       if (list == NULL) {
+               return NULL;
+       }
+
+       for (i=0; i<ARRAY_SIZE(operational_remove); i++) {
+               switch (operational_remove[i].op) {
+               case OPERATIONAL_REMOVE_UNASKED:
+                       if (ldb_attr_in_list(attrs, 
operational_remove[i].attr)) {
+                               continue;
+                       }
+                       if (ldb_attr_in_list(searched_attrs, 
operational_remove[i].attr)) {
+                               continue;
+                       }
+                       list[idx].attr = operational_remove[i].attr;
+                       list[idx].op = OPERATIONAL_REMOVE_UNASKED;
+                       idx++;
+                       break;
+
+               case OPERATIONAL_REMOVE_ALWAYS:
+                       list[idx].attr = operational_remove[i].attr;
+                       list[idx].op = OPERATIONAL_REMOVE_ALWAYS;
+                       idx++;
+                       break;
+
+               case OPERATIONAL_REMOVE_UNLESS_CONTROL:
+                       if (!check_keep_control_for_attribute(controls_flags, 
operational_remove[i].attr)) {
+                               list[idx].attr = operational_remove[i].attr;
+                               list[idx].op = 
OPERATIONAL_REMOVE_UNLESS_CONTROL;
+                               idx++;
+                       }
+                       break;
+
+               case OPERATIONAL_SD_FLAGS:
+                       if (ldb_attr_in_list(attrs, 
operational_remove[i].attr)) {
+                               continue;
+                       }
+                       if (controls_flags->sd) {
+                               if (attrs == NULL) {
+                                       continue;
+                               }
+                               if (attrs[0] == NULL) {
+                                       continue;
+                               }
+                               if (ldb_attr_in_list(attrs, "*")) {
+                                       continue;
+                               }
+                       }
+                       list[idx].attr = operational_remove[i].attr;
+                       list[idx].op = OPERATIONAL_SD_FLAGS;
+                       idx++;
+                       break;
+               }
+       }
+
+       return list;
+}
+
 static int operational_search(struct ldb_module *module, struct ldb_request 
*req)
 {
        struct ldb_context *ldb;
@@ -930,7 +972,16 @@ static int operational_search(struct ldb_module *module, 
struct ldb_request *req
                        }
                }
        }
-
+       ac->list_operations = operation_get_op_list(ac, ac->attrs,
+                                                   search_attrs == 
NULL?req->op.search.attrs:search_attrs,
+                                                   ac->controls_flags);
+       ac->list_operations_size = 0;
+       i = 0;
+
+       while (ac->list_operations && ac->list_operations[i].attr != NULL) {
+               i++;
+       }
+       ac->list_operations_size = i;
        ret = ldb_build_search_req_ex(&down_req, ldb, ac,
                                        req->op.search.base,
                                        req->op.search.scope,
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c 
b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 30b2a42..651cdf1 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -3544,7 +3544,7 @@ static int replmd_op_possible_conflict_callback(struct 
ldb_request *req, struct
                        goto failed;
                }
 
-               DEBUG(1,(__location__ ": Resolving conflict record via incoming 
rename '%s' -> '%s'\n",
+               DEBUG(2,(__location__ ": Resolving conflict record via incoming 
rename '%s' -> '%s'\n",
                         ldb_dn_get_linearized(conflict_dn), 
ldb_dn_get_linearized(new_dn)));
 
                /* re-submit the request, but with a different
@@ -3579,7 +3579,7 @@ static int replmd_op_possible_conflict_callback(struct 
ldb_request *req, struct
                        goto failed;
                }
 
-               DEBUG(1,(__location__ ": Resolving conflict record via existing 
rename '%s' -> '%s'\n",
+               DEBUG(2,(__location__ ": Resolving conflict record via existing 
rename '%s' -> '%s'\n",
                         ldb_dn_get_linearized(conflict_dn), 
ldb_dn_get_linearized(new_dn)));
 
                ret = dsdb_module_rename(ar->module, conflict_dn, new_dn,


-- 
Samba Shared Repository

Reply via email to