summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2009-09-23 13:34:58 +0400
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-10-02 12:44:59 +0200
commita73a0372f9fec93c9e6620859c9410ae4e702f88 (patch)
tree7b3ca6e6401bd1d9389d09bdc333ca5d2b3e428d /source4/lib/ldb/common
parentba0eba9e09805b7b0cbaffd66797419e381b1022 (diff)
downloadsamba-a73a0372f9fec93c9e6620859c9410ae4e702f88.tar.gz
samba-a73a0372f9fec93c9e6620859c9410ae4e702f88.tar.bz2
samba-a73a0372f9fec93c9e6620859c9410ae4e702f88.zip
s4-ldb: Add new relax controls that allow relaxed x500 constraints checks
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r--source4/lib/ldb/common/ldb_controls.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source4/lib/ldb/common/ldb_controls.c b/source4/lib/ldb/common/ldb_controls.c
index b38373ec12..32b2c0f66d 100644
--- a/source4/lib/ldb/common/ldb_controls.c
+++ b/source4/lib/ldb/common/ldb_controls.c
@@ -407,6 +407,33 @@ struct ldb_control **ldb_parse_control_strings(struct ldb_context *ldb, void *me
continue;
}
+ if (strncmp(control_strings[i], "relax:", 6) == 0) {
+ const char *p;
+ int crit, ret;
+
+ p = &(control_strings[i][6]);
+ ret = sscanf(p, "%d", &crit);
+ if ((ret != 1) || (crit < 0) || (crit > 1)) {
+ error_string = talloc_asprintf(mem_ctx, "invalid relax 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_RELAX_OID;
+ ctrl[i]->critical = crit;
+ ctrl[i]->data = NULL;
+
+ continue;
+ }
+
if (strncmp(control_strings[i], "domain_scope:", 13) == 0) {
const char *p;
int crit, ret;