Fix an incompatible pointer passed to winbind_get_groups
authorVolker Lendecke <vl@samba.org>
Wed, 25 Feb 2009 11:55:47 +0000 (12:55 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 25 Feb 2009 12:04:19 +0000 (13:04 +0100)
This is the same bug that was fixed in other places of the code a few times
already:

A C compiler ONLY does automatic type conversions during an assignment.

Passing down a pointer to type A to a function taking type B as an
argument does NOT do any automatic type conversions.

If required, I can dig up the relevant portions of the C standard.

source3/passdb/pdb_wbc_sam.c

index 33dc03fe4cd787a2620abce7cd2970f849a984de..d2c7fda2936c8d0451392de49eeec619a20c1751 100644 (file)
@@ -115,10 +115,12 @@ static NTSTATUS pdb_wbc_sam_enum_group_memberships(struct pdb_methods *methods,
 {
        size_t i;
        const char *username = pdb_get_username(user);
+       uint32_t num_groups;
 
-       if (!winbind_get_groups(mem_ctx, username, p_num_groups, pp_gids)) {
+       if (!winbind_get_groups(mem_ctx, username, &num_groups, pp_gids)) {
                return NT_STATUS_NO_SUCH_USER;
        }
+       *p_num_groups = num_groups;
 
        if (*p_num_groups == 0) {
                smb_panic("primary group missing");