diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-02-22 01:54:40 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2007-02-22 01:54:40 +0000 |
commit | 9ab87e16b4e7266fc09a82d263c38501dcc28989 (patch) | |
tree | bb4adbdf44ed5e330a3dd5b19a61a69b3b549767 /source/ldap_server | |
parent | d134bf3b344dbeb80c1ab9afd8a999c1cb2f9e95 (diff) | |
download | samba-9ab87e16b4e7266fc09a82d263c38501dcc28989.tar.gz samba-9ab87e16b4e7266fc09a82d263c38501dcc28989.tar.xz samba-9ab87e16b4e7266fc09a82d263c38501dcc28989.zip |
r21496: A number of ldb control and LDAP changes, surrounding the
'phantom_root' flag in the search_options control
- Add in support for LDB controls to the js layer
- Test the behaviour
- Implement support for the 'phantom_root' flag in the partitions module
- Make the LDAP server set the 'phantom_root' flag in the search_options control
- This replaces the global_catalog flag passed down as an opaque pointer
- Rework the string-format control parsing function into
ldb_parse_control_strings(), returning errors by ldb_errorstring()
method, rather than with printf to stderr
- Rework some of the ldb_control handling logic
Andrew Bartlett
Diffstat (limited to 'source/ldap_server')
-rw-r--r-- | source/ldap_server/ldap_backend.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/source/ldap_server/ldap_backend.c b/source/ldap_server/ldap_backend.c index b318996f432..fa8c07fa552 100644 --- a/source/ldap_server/ldap_backend.c +++ b/source/ldap_server/ldap_backend.c @@ -90,10 +90,6 @@ NTSTATUS ldapsrv_backend_Init(struct ldapsrv_connection *conn) ldb_set_opaque(conn->ldb, "supportedSASLMechanims", sasl_mechs); } - if (conn->global_catalog) { - ldb_set_opaque(conn->ldb, "global_catalog", (void *)(-1)); - } - return NT_STATUS_OK; } @@ -229,6 +225,21 @@ static NTSTATUS ldapsrv_SearchRequest(struct ldapsrv_call *call) lreq->controls = call->request->controls; + if (call->conn->global_catalog) { + struct ldb_control *search_control = ldb_request_get_control(lreq, LDB_CONTROL_SEARCH_OPTIONS_OID); + + struct ldb_search_options_control *search_options = NULL; + if (search_control) { + search_options = talloc_get_type(search_control->data, struct ldb_search_options_control); + search_options->search_options |= LDB_SEARCH_OPTION_PHANTOM_ROOT; + } else { + search_options = talloc(lreq, struct ldb_search_options_control); + NT_STATUS_HAVE_NO_MEMORY(search_options); + search_options->search_options = LDB_SEARCH_OPTION_PHANTOM_ROOT; + ldb_request_add_control(lreq, LDB_CONTROL_SEARCH_OPTIONS_OID, false, search_options); + } + } + lreq->context = res; lreq->callback = ldb_search_default_callback; |