diff options
author | Andrew Bartlett <abartlet@samba.org> | 2013-11-25 14:09:26 +1300 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2014-04-02 17:12:46 +0200 |
commit | befae7f6e65add893cf24a088b93f0350b0b482e (patch) | |
tree | d2ec0c4515018577c0dbcdcbfd0de5561ffa19b8 /lib/ldb-samba | |
parent | c3baddf271b9d09819aff4ce05314f940c6f1e4d (diff) | |
download | samba-befae7f6e65add893cf24a088b93f0350b0b482e.tar.gz |
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>
Diffstat (limited to 'lib/ldb-samba')
-rw-r--r-- | lib/ldb-samba/ldb_ildap.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/ldb-samba/ldb_ildap.c b/lib/ldb-samba/ldb_ildap.c index 18853ebccf7..6ec363de9de 100644 --- a/lib/ldb-samba/ldb_ildap.c +++ b/lib/ldb-samba/ldb_ildap.c @@ -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; } |