summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-10 15:47:48 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-10 16:22:08 +0200
commit9f9529886499acc80ad7316d5eab590545643b87 (patch)
tree5ffb7e193a9d59f9f9335863d6fc52159cd7b277 /source4/rpc_server
parent7374cd035807029d800815f82474ab9c6ed2e861 (diff)
downloadsamba-9f9529886499acc80ad7316d5eab590545643b87.tar.gz
samba-9f9529886499acc80ad7316d5eab590545643b87.tar.bz2
samba-9f9529886499acc80ad7316d5eab590545643b87.zip
s4:dcesrv_samr_Add/DeleteAliasMember - provide better NTSTATUS return codes when something didn't work
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index 18175e4c9e..2ab5155c10 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -2451,11 +2451,18 @@ static NTSTATUS dcesrv_samr_AddAliasMember(struct dcesrv_call_state *dce_call, T
return NT_STATUS_UNSUCCESSFUL;
}
- if (ldb_modify(a_state->sam_ctx, mod) != LDB_SUCCESS) {
+ ret = ldb_modify(a_state->sam_ctx, mod);
+ switch (ret) {
+ case LDB_SUCCESS:
+ return NT_STATUS_OK;
+ case LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS:
+ case LDB_ERR_ENTRY_ALREADY_EXISTS:
+ return NT_STATUS_MEMBER_IN_GROUP;
+ case LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS:
+ return NT_STATUS_ACCESS_DENIED;
+ default:
return NT_STATUS_UNSUCCESSFUL;
}
-
- return NT_STATUS_OK;
}
@@ -2497,11 +2504,17 @@ static NTSTATUS dcesrv_samr_DeleteAliasMember(struct dcesrv_call_state *dce_call
return NT_STATUS_UNSUCCESSFUL;
}
- if (ldb_modify(a_state->sam_ctx, mod) != LDB_SUCCESS) {
+ ret = ldb_modify(a_state->sam_ctx, mod);
+ switch (ret) {
+ case LDB_SUCCESS:
+ return NT_STATUS_OK;
+ case LDB_ERR_NO_SUCH_ATTRIBUTE:
+ return NT_STATUS_MEMBER_NOT_IN_GROUP;
+ case LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS:
+ return NT_STATUS_ACCESS_DENIED;
+ default:
return NT_STATUS_UNSUCCESSFUL;
}
-
- return NT_STATUS_OK;
}