diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-01-03 04:40:24 -0600 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-01-03 12:33:35 -0600 |
commit | 636c9a7c719ef24205c40b8e2018d83040520490 (patch) | |
tree | 0ec0ac52a5c12b9b865b47d10f60cf1ea7c6f915 /source4/ldap_server | |
parent | bcdc491058d8b9ca890a9bdc0635d839d41e8fd8 (diff) | |
download | samba-636c9a7c719ef24205c40b8e2018d83040520490.tar.gz samba-636c9a7c719ef24205c40b8e2018d83040520490.tar.bz2 samba-636c9a7c719ef24205c40b8e2018d83040520490.zip |
r26648: Move detection of global catalog captability to a central function, so
this can be shared with the CLDAP server (for the netlogon reply).
Andrew Bartlett
(This used to be commit 592c10ae11c94007e38404a7edea9fd8471f1907)
Diffstat (limited to 'source4/ldap_server')
-rw-r--r-- | source4/ldap_server/ldap_server.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c index a2521ca406..9bb1279a99 100644 --- a/source4/ldap_server/ldap_server.c +++ b/source4/ldap_server/ldap_server.c @@ -447,11 +447,7 @@ static NTSTATUS add_socket(struct event_context *event_context, { uint16_t port = 389; NTSTATUS status; - const char *attrs[] = { "options", NULL }; - int ret; - struct ldb_result *res; struct ldb_context *ldb; - int options; status = stream_setup_socket(event_context, model_ops, &ldap_stream_ops, "ipv4", address, &port, @@ -481,22 +477,7 @@ static NTSTATUS add_socket(struct event_context *event_context, return NT_STATUS_INTERNAL_DB_CORRUPTION; } - /* Query cn=ntds settings,.... */ - ret = ldb_search(ldb, samdb_ntds_settings_dn(ldb), LDB_SCOPE_BASE, NULL, attrs, &res); - if (ret) { - return NT_STATUS_INTERNAL_DB_CORRUPTION; - } - if (res->count != 1) { - talloc_free(res); - return NT_STATUS_NOT_FOUND; - } - - options = ldb_msg_find_attr_as_int(res->msgs[0], "options", 0); - talloc_free(res); - talloc_free(ldb); - - /* if options attribute has the 0x00000001 flag set, then enable the global catlog */ - if (options & 0x000000001) { + if (samdb_is_gc(ldb)) { port = 3268; status = stream_setup_socket(event_context, model_ops, &ldap_stream_ops, "ipv4", address, &port, |