1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-26 01:49:31 +03:00

s4:ldap_backend.c - map error codes - add a change which allows custom WERROR codes

This is strictly needed by my recent passwords work, since I want to remove
most of the password change stuff in "samr_password.c". Since AD gives us
CONSTRAINT_VIOLATION on all change problems I cannot distinguish on the SAMR
level which the real cause was about. Therefore I need the extended WERROR codes
here.
This commit is contained in:
Matthias Dieter Wallnöfer
2010-08-15 09:25:58 +02:00
parent 08b628efe4
commit fb58c0f365

View File

@ -45,6 +45,19 @@ static int map_ldb_error(TALLOC_CTX *mem_ctx, int ldb_err,
{
WERROR err;
/* Certain LDB modules need to return very special WERROR codes. Proof
* for them here and if they exist skip the rest of the mapping. */
if (add_err_string != NULL) {
char *endptr;
strtol(add_err_string, &endptr, 16);
if (endptr != add_err_string) {
*errstring = add_err_string;
return ldb_err;
}
}
/* Otherwise we calculate here a generic, but appropriate WERROR. */
switch (ldb_err) {
case LDB_SUCCESS:
err = WERR_OK;