1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

ldb_ildap: Map some wrong username/password errors on to LDB_ERR_INVALID_CREDENTIALS

This is better than just LDB_ERR_OPERATIONS_ERROR for all errors.

Andrew Bartlett

Change-Id: Id832cf02fcd1dc0347d5ab9eb9a2db78fda39dc6
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Andrew Bartlett 2013-11-25 14:09:26 +13:00 committed by Stefan Metzmacher
parent c3baddf271
commit befae7f6e6

View File

@ -791,7 +791,7 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
{
struct ldb_module *module;
struct ildb_private *ildb;
NTSTATUS status;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
struct cli_credentials *creds;
struct loadparm_context *lp_ctx;
@ -862,6 +862,14 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
failed:
talloc_free(module);
if (NT_STATUS_IS_LDAP(status)) {
return NT_STATUS_LDAP_CODE(status);
} else if (NT_STATUS_EQUAL(status, NT_STATUS_WRONG_PASSWORD)
|| NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_USER)
|| NT_STATUS_EQUAL(status, NT_STATUS_LOGON_FAILURE)
|| NT_STATUS_EQUAL(status, NT_STATUS_ACCOUNT_LOCKED_OUT)) {
return LDB_ERR_INVALID_CREDENTIALS;
}
return LDB_ERR_OPERATIONS_ERROR;
}