summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-10-02 02:44:25 +0200
committerStefan Metzmacher <metze@samba.org>2008-10-02 12:20:57 +0200
commit8aff4430308b36ae1a1a6629d67bba87eebb0dde (patch)
treeeae134e1ebe805ccc4d89a1ad753589413032fe1 /source4
parentaec5a08774d312fad52b7dea37305f25af41e65f (diff)
downloadsamba-8aff4430308b36ae1a1a6629d67bba87eebb0dde.tar.gz
samba-8aff4430308b36ae1a1a6629d67bba87eebb0dde.tar.bz2
samba-8aff4430308b36ae1a1a6629d67bba87eebb0dde.zip
s4:kludge_acl: just fake support for the SD_FLAGS control
metze
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/kludge_acl.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/kludge_acl.c b/source4/dsdb/samdb/ldb_modules/kludge_acl.c
index 24527c36c9..6e6da5581d 100644
--- a/source4/dsdb/samdb/ldb_modules/kludge_acl.c
+++ b/source4/dsdb/samdb/ldb_modules/kludge_acl.c
@@ -321,6 +321,8 @@ static int kludge_acl_search(struct ldb_module *module, struct ldb_request *req)
struct kludge_private_data *data;
const char * const *attrs;
int ret, i;
+ struct ldb_control *sd_control;
+ struct ldb_control **sd_saved_controls;
ac = talloc(req, struct kludge_acl_context);
if (ac == NULL) {
@@ -382,6 +384,17 @@ static int kludge_acl_search(struct ldb_module *module, struct ldb_request *req)
return LDB_ERR_OPERATIONS_ERROR;
}
+ /* check if there's an SD_FLAGS control */
+ sd_control = ldb_request_get_control(down_req, LDB_CONTROL_SD_FLAGS_OID);
+ if (sd_control) {
+ /* save it locally and remove it from the list */
+ /* we do not need to replace them later as we
+ * are keeping the original req intact */
+ if (!save_controls(sd_control, down_req, &sd_saved_controls)) {
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+ }
+
/* perform the search */
return ldb_next_request(module, down_req);
}
@@ -462,6 +475,13 @@ static int kludge_acl_init(struct ldb_module *module)
}
data->password_attrs[i] = NULL;
+ ret = ldb_mod_register_control(module, LDB_CONTROL_SD_FLAGS_OID);
+ if (ret != LDB_SUCCESS) {
+ ldb_debug(module->ldb, LDB_DEBUG_ERROR,
+ "partition: Unable to register control with rootdse!\n");
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+
done:
talloc_free(mem_ctx);
return ldb_next_init(module);