1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

ldb: add a new control bypassioperationnal

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
This commit is contained in:
Matthieu Patou 2010-06-15 02:23:11 +04:00 committed by Jelmer Vernooij
parent 9c5f0ed729
commit 3ebe560622
4 changed files with 38 additions and 0 deletions

View File

@ -486,6 +486,33 @@ struct ldb_control **ldb_parse_control_strings(struct ldb_context *ldb, void *me
continue;
}
if (strncmp(control_strings[i], "bypassoperational:", 18) == 0) {
const char *p;
int crit, ret;
p = &(control_strings[i][18]);
ret = sscanf(p, "%d", &crit);
if ((ret != 1) || (crit < 0) || (crit > 1)) {
error_string = talloc_asprintf(mem_ctx, "invalid bypassopreational control syntax\n");
error_string = talloc_asprintf_append(error_string, " syntax: crit(b)\n");
error_string = talloc_asprintf_append(error_string, " note: b = boolean");
ldb_set_errstring(ldb, error_string);
talloc_free(error_string);
return NULL;
}
ctrl[i] = talloc(ctrl, struct ldb_control);
if (!ctrl[i]) {
ldb_oom(ldb);
return NULL;
}
ctrl[i]->oid = LDB_CONTROL_BYPASSOPERATIONAL_OID;
ctrl[i]->critical = crit;
ctrl[i]->data = NULL;
continue;
}
if (strncmp(control_strings[i], "relax:", 6) == 0) {
const char *p;
int crit, ret;

View File

@ -463,6 +463,15 @@ typedef int (*ldb_qsort_cmp_fn_t) (void *v1, void *v2, void *opaque);
\sa <a href="http://opends.dev.java.net/public/standards/draft-zeilenga-ldap-managedit.txt">draft managedit</a>.
*/
#define LDB_CONTROL_RELAX_OID "1.3.6.1.4.1.4203.666.5.12"
/**
OID for getting and manipulating attributes from the ldb
without interception in the operational module.
It can be used to access attribute that used to be stored in the sam
and that are now calculated.
*/
#define LDB_CONTROL_BYPASSOPERATIONAL_OID "1.3.6.1.4.1.7165.4.3.13"
/**
OID for recalculate SD control. This control force the
dsdb code to recalculate the SD of the object as if the

View File

@ -42,5 +42,6 @@ replace someThing
someThing: someThingElseBetter
EOF
$VALGRIND ldbsearch --controls "bypassoperational:0" >/dev/null 2>&1 || exit 1
set

View File

@ -184,6 +184,7 @@
#Allocated: DSDB_CONTROL_PASSWORD_HASH_VALUES_OID 1.3.6.1.4.1.7165.4.3.9
#Allocated: DSDB_CONTROL_PASSWORD_CHANGE_OLD_PW_CHECKED_OID 1.3.6.1.4.1.7165.4.3.10
#Allocated: DSDB_CONTROL_APPLY_LINKS 1.3.6.1.4.1.7165.4.3.11
#Allocated: LDB_CONTROL_BYPASSOPERATIONAL_OID 1.3.6.1.4.1.7165.4.3.13
# Extended 1.3.6.1.4.1.7165.4.4.x
#Allocated: DSDB_EXTENDED_REPLICATED_OBJECTS_OID 1.3.6.1.4.1.7165.4.4.1