summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-07-29 01:22:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:15:08 -0500
commit2d65c9ada5ca3f5d263707947d73106e180a9920 (patch)
tree358e8411bbab15cdfa979faccdf9a4598f157c6b
parent77bb75ead0b5b13539ab89531542cc2e9813fda4 (diff)
downloadsamba-2d65c9ada5ca3f5d263707947d73106e180a9920.tar.gz
samba-2d65c9ada5ca3f5d263707947d73106e180a9920.tar.bz2
samba-2d65c9ada5ca3f5d263707947d73106e180a9920.zip
r17300: Try to fix some segfaults in ldb_ildap module, when the remote server
drops the connection. The reconnect code needs to be hooked in here. Andrew Bartlett (This used to be commit 778debedea77ac81cc05f00f27bb96a58cbebcd8)
-rw-r--r--source4/lib/ldb/ldb_ildap/ldb_ildap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
index ae92ede8ce..a4427b8b95 100644
--- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c
+++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
@@ -360,6 +360,11 @@ static int ildb_request_send(struct ldb_module *module, struct ldap_message *msg
return LDB_ERR_OPERATIONS_ERROR;
}
+ if (!req->conn) {
+ ldb_set_errstring(module->ldb, talloc_asprintf(module, "connection to remote LDAP server dropped?"));
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+
ildb_ac->req = talloc_steal(ildb_ac, req);
ildb_ac->module = module;
ildb_ac->context = context;
@@ -802,7 +807,7 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
goto failed;
}
- if (flags == LDB_FLG_RECONNECT) {
+ if (flags & LDB_FLG_RECONNECT) {
ldap_set_reconn_params(ildb->ldap, 10);
}