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

s4:dcesrv_samr - prevent "ldb_modify" on a possibly empty message

In this code part under certain circumstances we can end up with an empty message.
Since our new behaviour denies them (like the real AD) we need to bypass them
on LDB modify calls.
This commit is contained in:
Matthias Dieter Wallnöfer 2009-10-13 00:48:15 +02:00
parent 7c53386adf
commit 6b91a2ad8e

View File

@ -3611,14 +3611,16 @@ static NTSTATUS dcesrv_samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALL
}
/* modify the samdb record */
ret = ldb_modify(a_state->sam_ctx, msg);
if (ret != LDB_SUCCESS) {
DEBUG(1,("Failed to modify record %s: %s\n",
ldb_dn_get_linearized(a_state->account_dn),
ldb_errstring(a_state->sam_ctx)));
if (msg->num_elements > 0) {
ret = ldb_modify(a_state->sam_ctx, msg);
if (ret != LDB_SUCCESS) {
DEBUG(1,("Failed to modify record %s: %s\n",
ldb_dn_get_linearized(a_state->account_dn),
ldb_errstring(a_state->sam_ctx)));
/* we really need samdb.c to return NTSTATUS */
return NT_STATUS_UNSUCCESSFUL;
/* we really need samdb.c to return NTSTATUS */
return NT_STATUS_UNSUCCESSFUL;
}
}
return NT_STATUS_OK;