mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
ldap_server: Plumb ldb error string from a failed connect to ldapsrv_terminate_connection()
However, do not plumb it to the client-seen error string, as it could contain server paths. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
committed by
Douglas Bagnall
parent
c1e41d489d
commit
dd53be2756
@ -293,6 +293,7 @@ static void ldapsrv_accept(struct stream_connection *c,
|
||||
int ret;
|
||||
struct tevent_req *subreq;
|
||||
struct timeval endtime;
|
||||
char *errstring = NULL;
|
||||
|
||||
conn = talloc_zero(c, struct ldapsrv_connection);
|
||||
if (!conn) {
|
||||
@ -361,8 +362,13 @@ static void ldapsrv_accept(struct stream_connection *c,
|
||||
conn->require_strong_auth = lpcfg_ldap_server_require_strong_auth(conn->lp_ctx);
|
||||
}
|
||||
|
||||
if (!NT_STATUS_IS_OK(ldapsrv_backend_Init(conn))) {
|
||||
ldapsrv_terminate_connection(conn, "backend Init failed");
|
||||
ret = ldapsrv_backend_Init(conn, &errstring);
|
||||
if (ret != LDB_SUCCESS) {
|
||||
char *reason = talloc_asprintf(conn,
|
||||
"LDB backend for LDAP Init "
|
||||
"failed: %s: %s",
|
||||
errstring, ldb_strerror(ret));
|
||||
ldapsrv_terminate_connection(conn, reason);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user