s3 winbindd: Return number of groups in data.num_entries for WINBINDD_LIST_GROUPS
authorKai Blin <kai@samba.org>
Wed, 13 Jan 2010 14:59:57 +0000 (15:59 +0100)
committerKai Blin <kai@samba.org>
Thu, 14 Jan 2010 14:18:34 +0000 (15:18 +0100)
This allows to test if there's something wrong with the group list in
extra_data or if there's simply no groups in the database.

Volker, please check.

source3/winbindd/winbindd_list_groups.c

index 379504578756d01349ead6ef49dd77cf34773e78..a621762edb5fab51f93c98578f6cb551cce113ae 100644 (file)
@@ -153,7 +153,7 @@ NTSTATUS winbindd_list_groups_recv(struct tevent_req *req,
        NTSTATUS status;
        char *result;
        int i;
-       uint32_t j;
+       uint32_t j, num_entries = 0;
        size_t len;
 
        if (tevent_req_is_nterror(req, &status)) {
@@ -193,10 +193,12 @@ NTSTATUS winbindd_list_groups_recv(struct tevent_req *req,
                        len += this_len;
                        result[len] = ',';
                        len += 1;
+                       num_entries++;
                }
        }
        result[len-1] = '\0';
 
+       response->data.num_entries = num_entries;
        response->extra_data.data = result;
        response->length += len;