s4: change removal case for replPropertyMeta
authorMatthieu Patou <mat@matws.net>
Mon, 7 Feb 2011 06:59:55 +0000 (09:59 +0300)
committerMatthieu Patou <mat@matws.net>
Tue, 8 Mar 2011 21:54:29 +0000 (00:54 +0300)
Change from remove unless asked to remove unless asked or if the
bypassoperational is specified

source4/dsdb/samdb/ldb_modules/operational.c

index dcc047f13e3a55aef4f808e4fa12964392fcf07a..ec6b96677bd55f50c4d6e4561eed039a8266c7a6 100644 (file)
@@ -618,6 +618,7 @@ static const struct {
 enum op_remove {
        OPERATIONAL_REMOVE_ALWAYS, /* remove always */
        OPERATIONAL_REMOVE_UNASKED,/* remove if not requested */
+       OPERATIONAL_REMOVE_NOBYPASS_OR_UNASKED,/* remove if not requested or if bypassoperational is not set */
        OPERATIONAL_SD_FLAGS,      /* show if SD_FLAGS_OID set, or asked for */
        OPERATIONAL_REMOVE_UNLESS_CONTROL        /* remove always unless an adhoc control has been specified */
 };
@@ -635,7 +636,7 @@ static const struct {
        { "nTSecurityDescriptor",    OPERATIONAL_SD_FLAGS },
        { "msDS-KeyVersionNumber",   OPERATIONAL_REMOVE_UNLESS_CONTROL  },
        { "parentGUID",              OPERATIONAL_REMOVE_ALWAYS  },
-       { "replPropertyMetaData",    OPERATIONAL_REMOVE_UNASKED },
+       { "replPropertyMetaData",    OPERATIONAL_REMOVE_NOBYPASS_OR_UNASKED },
 #define _SEP ,OPERATIONAL_REMOVE_UNASKED},{
        { DSDB_SECRET_ATTRIBUTES_EX(_SEP), OPERATIONAL_REMOVE_UNASKED }
 };
@@ -664,6 +665,10 @@ static int operational_search_post_process(struct ldb_module *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_NOBYPASS_OR_UNASKED:
+                       if (controls_flags->bypassoperational) {
+                               continue;
+                       }
                case OPERATIONAL_REMOVE_UNASKED:
                        if (ldb_attr_in_list(attrs_from_user, operational_remove[i].attr)) {
                                continue;