Copyright (C) Andrew Bartlett <abartlet@samba.org> 2006
Copyright (C) Stefan Metzmacher <metze@samba.org> 2007
- * NOTICE: this module is NOT released under the GNU LGPL license as
- * other ldb code. This module is release under the GNU GPL v3 or
- * later license.
-
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
}
}
+ if (dn == NULL) {
+ return NULL;
+ }
+
/* Look at base DN */
/* Figure out which partition it is under */
/* Skip the lot if 'data' isn't here yet (initialisation) */
struct partition_context *ac;
struct ldb_module *module;
struct ldb_request *nreq;
- int ret;
+ int ret, i;
+ struct partition_private_data *data;
ac = talloc_get_type(req->context, struct partition_context);
+ data = talloc_get_type(ac->module->private_data, struct partition_private_data);
if (!ares) {
return ldb_module_done(ac->req, NULL, NULL,
return ldb_module_done(ac->req, NULL, NULL,
LDB_ERR_OPERATIONS_ERROR);
}
+ for (i=0; data && data->partitions && data->partitions[i]; i++) {
+ if (ldb_dn_compare(ares->message->dn, data->partitions[i]->ctrl->dn) == 0) {
+ struct ldb_control *part_control;
+ /* this is a partition root message - make
+ sure it isn't one of our fake root
+ entries from a parent partition */
+ part_control = ldb_request_get_control(req, DSDB_CONTROL_CURRENT_PARTITION_OID);
+ if (part_control && part_control->data != data->partitions[i]->ctrl) {
+ DEBUG(6,(__location__ ": Discarding partition mount object %s\n",
+ ldb_dn_get_linearized(ares->message->dn)));
+ talloc_free(ares);
+ return LDB_SUCCESS;
+ }
+ }
+ }
+
return ldb_module_send_entry(ac->req, ares->message, ares->controls);
case LDB_REPLY_DONE:
static int partition_search(struct ldb_module *module, struct ldb_request *req)
{
struct ldb_control **saved_controls;
-
/* Find backend */
struct partition_private_data *data = talloc_get_type(module->private_data,
struct partition_private_data);
+
/* issue request */
/* (later) consider if we should be searching multiple
struct ldb_control *domain_scope_control = ldb_request_get_control(req, LDB_CONTROL_DOMAIN_SCOPE_OID);
struct ldb_search_options_control *search_options = NULL;
+ struct dsdb_partition *p;
+
+ p = find_partition(data, NULL, req);
+ if (p != NULL) {
+ /* the caller specified what partition they want the
+ * search - just pass it on
+ */
+ return ldb_next_request(p->module, req);
+ }
+
+
if (search_control) {
search_options = talloc_get_type(search_control->data, struct ldb_search_options_control);
}
struct ldb_seqnum_result *tseqr;
struct ldb_extended *ext;
struct ldb_result *res;
+ struct dsdb_partition *p;
+
+ p = find_partition(data, NULL, req);
+ if (p != NULL) {
+ /* the caller specified what partition they want the
+ * sequence number operation on - just pass it on
+ */
+ return ldb_next_request(p->module, req);
+ }
seq = talloc_get_type(req->op.extended.data, struct ldb_seqnum_request);