summaryrefslogtreecommitdiff
path: root/source4/ldap_server/ldap_backend.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-07-12 04:59:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:10:04 -0500
commit32ab51876728577375b954a04103f71ddd4d93dc (patch)
tree99ece19cb36fc02d90ec07f2498e9b1a34c5c237 /source4/ldap_server/ldap_backend.c
parentb1a92083d8bbfcf917d2a567833bf6925067718e (diff)
downloadsamba-32ab51876728577375b954a04103f71ddd4d93dc.tar.gz
samba-32ab51876728577375b954a04103f71ddd4d93dc.tar.bz2
samba-32ab51876728577375b954a04103f71ddd4d93dc.zip
r16972: Replace the sequence_number function pointer in ldb with the ldb flags.
The function pointer was meant to be unused, this patch fixes partition.c to use ldb_sequence_number(). (No backend provided the pointer any more). Set the flags onto the ldb structure, so that all backends opened by the partitions module inherit the flags. Set the read-ony flag when accessed as the global catalog Modify the LDAP server to track that this query is for the global catalog (by incoming port), and set a opqaue pointer. Next step is to read that opaque pointer in the partitions module. Andrew Bartlett (This used to be commit a1161cb30e4ffa09657a89e03ca85dd6efd4feba)
Diffstat (limited to 'source4/ldap_server/ldap_backend.c')
-rw-r--r--source4/ldap_server/ldap_backend.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c
index 0dafd0f312..fcd282da9e 100644
--- a/source4/ldap_server/ldap_backend.c
+++ b/source4/ldap_server/ldap_backend.c
@@ -24,7 +24,7 @@
#include "libcli/ldap/ldap.h"
#include "lib/ldb/include/ldb.h"
#include "lib/ldb/include/ldb_errors.h"
-#include "dsdb/samdb/samdb.h"
+#include "lib/db_wrap.h"
#define VALID_DN_SYNTAX(dn,i) do {\
if (!(dn)) {\
@@ -49,12 +49,17 @@ static int map_ldb_error(struct ldb_context *ldb, int err, const char **errstrin
*/
NTSTATUS ldapsrv_backend_Init(struct ldapsrv_connection *conn)
{
- conn->ldb = samdb_connect(conn, conn->session_info);
+ conn->ldb = ldb_wrap_connect(conn, lp_sam_url(), conn->session_info,
+ NULL, conn->global_catalog ? LDB_FLG_RDONLY : 0, NULL);
if (conn->ldb == NULL) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
ldb_set_opaque(conn->ldb, "server_credentials", conn->server_credentials);
+ if (conn->global_catalog) {
+ ldb_set_opaque(conn->ldb, "global_catalog", (void *)(-1));
+ }
+
return NT_STATUS_OK;
}