Two controls with the same OID makes no sense, as they may
have different data attached
struct ldb_control **ctrls;
struct ldb_control *ctrl;
- for (n=0; req->controls && req->controls[n];) { n++; }
+ for (n=0; req->controls && req->controls[n];) {
+ /* having two controls of the same OID makes no sense */
+ if (strcmp(oid, req->controls[n]->oid) == 0) {
+ return LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS;
+ }
+ n++;
+ }
ctrls = talloc_realloc(req, req->controls,
struct ldb_control *,