mirror of
https://github.com/samba-team/samba.git
synced 2025-08-05 12:22:11 +03:00
s4-ldapserver: support controls on ldap add and rename
we need to pass the controls down to the add and rename ldb operations Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
@ -294,8 +294,9 @@ static NTSTATUS ldapsrv_unwilling(struct ldapsrv_call *call, int error)
|
|||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ldb_add_with_context(struct ldb_context *ldb,
|
static int ldb_add_with_controls(struct ldb_context *ldb,
|
||||||
const struct ldb_message *message,
|
const struct ldb_message *message,
|
||||||
|
struct ldb_control **controls,
|
||||||
void *context)
|
void *context)
|
||||||
{
|
{
|
||||||
struct ldb_request *req;
|
struct ldb_request *req;
|
||||||
@ -308,7 +309,7 @@ static int ldb_add_with_context(struct ldb_context *ldb,
|
|||||||
|
|
||||||
ret = ldb_build_add_req(&req, ldb, ldb,
|
ret = ldb_build_add_req(&req, ldb, ldb,
|
||||||
message,
|
message,
|
||||||
NULL,
|
controls,
|
||||||
context,
|
context,
|
||||||
ldb_modify_default_callback,
|
ldb_modify_default_callback,
|
||||||
NULL);
|
NULL);
|
||||||
@ -421,9 +422,10 @@ static int ldb_del_req_with_controls(struct ldb_context *ldb,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ldb_rename_with_context(struct ldb_context *ldb,
|
int ldb_rename_with_controls(struct ldb_context *ldb,
|
||||||
struct ldb_dn *olddn,
|
struct ldb_dn *olddn,
|
||||||
struct ldb_dn *newdn,
|
struct ldb_dn *newdn,
|
||||||
|
struct ldb_control **controls,
|
||||||
void *context)
|
void *context)
|
||||||
{
|
{
|
||||||
struct ldb_request *req;
|
struct ldb_request *req;
|
||||||
@ -851,7 +853,7 @@ reply:
|
|||||||
if (result == LDAP_SUCCESS) {
|
if (result == LDAP_SUCCESS) {
|
||||||
res = talloc_zero(local_ctx, struct ldb_result);
|
res = talloc_zero(local_ctx, struct ldb_result);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(res);
|
NT_STATUS_HAVE_NO_MEMORY(res);
|
||||||
ldb_ret = ldb_add_with_context(samdb, msg, res);
|
ldb_ret = ldb_add_with_controls(samdb, msg, call->request->controls, res);
|
||||||
result = map_ldb_error(local_ctx, ldb_ret, ldb_errstring(samdb),
|
result = map_ldb_error(local_ctx, ldb_ret, ldb_errstring(samdb),
|
||||||
&errstr);
|
&errstr);
|
||||||
}
|
}
|
||||||
@ -1015,7 +1017,7 @@ reply:
|
|||||||
if (result == LDAP_SUCCESS) {
|
if (result == LDAP_SUCCESS) {
|
||||||
res = talloc_zero(local_ctx, struct ldb_result);
|
res = talloc_zero(local_ctx, struct ldb_result);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(res);
|
NT_STATUS_HAVE_NO_MEMORY(res);
|
||||||
ldb_ret = ldb_rename_with_context(samdb, olddn, newdn, res);
|
ldb_ret = ldb_rename_with_controls(samdb, olddn, newdn, call->request->controls, res);
|
||||||
result = map_ldb_error(local_ctx, ldb_ret, ldb_errstring(samdb),
|
result = map_ldb_error(local_ctx, ldb_ret, ldb_errstring(samdb),
|
||||||
&errstr);
|
&errstr);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user