summaryrefslogtreecommitdiff
path: root/source4/rpc_server/samr
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-12 00:06:07 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-12 16:45:48 +0200
commitd2099a1deff54423b477bf58c977118256ece92b (patch)
tree83c143b60c829b5912d0463590f3d9451f3ca60f /source4/rpc_server/samr
parent776eb25ef75bf4d7625f04db404c4b8a1ae90936 (diff)
downloadsamba-d2099a1deff54423b477bf58c977118256ece92b.tar.gz
samba-d2099a1deff54423b477bf58c977118256ece92b.tar.bz2
samba-d2099a1deff54423b477bf58c977118256ece92b.zip
s4:dcesrv_samr_QueryGroupInfo - make it more like "QueryAliasInfo"
Diffstat (limited to 'source4/rpc_server/samr')
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index 617fde7fc5..889d54a7f0 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -1810,8 +1810,7 @@ static NTSTATUS dcesrv_samr_QueryGroupInfo(struct dcesrv_call_state *dce_call, T
{
struct dcesrv_handle *h;
struct samr_account_state *a_state;
- struct ldb_message *msg;
- struct ldb_result *res;
+ struct ldb_message *msg, **res;
const char * const attrs[4] = { "sAMAccountName", "description",
"numMembers", NULL };
int ret;
@@ -1823,22 +1822,16 @@ static NTSTATUS dcesrv_samr_QueryGroupInfo(struct dcesrv_call_state *dce_call, T
a_state = h->data;
- ret = ldb_search(a_state->sam_ctx, mem_ctx, &res, a_state->account_dn,
- LDB_SCOPE_SUBTREE, attrs, "objectClass=*");
-
- if (ret == LDB_ERR_NO_SUCH_OBJECT) {
+ /* pull all the group attributes */
+ ret = gendb_search_dn(a_state->sam_ctx, mem_ctx,
+ a_state->account_dn, &res, attrs);
+ if (ret == 0) {
return NT_STATUS_NO_SUCH_GROUP;
- } else if (ret != LDB_SUCCESS) {
- DEBUG(2, ("Error reading group info: %s\n", ldb_errstring(a_state->sam_ctx)));
- return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
-
- if (res->count != 1) {
- DEBUG(2, ("Error finding group info, got %d entries\n", res->count));
-
+ if (ret != 1) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
- msg = res->msgs[0];
+ msg = res[0];
/* allocate the info structure */
info = talloc_zero(mem_ctx, union samr_GroupInfo);