]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
netapi: fix map_group_info_to_buffer for GROUP_INFO_3 change.
authorGünther Deschner <gd@samba.org>
Wed, 16 Jul 2008 14:14:47 +0000 (16:14 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 17 Jul 2008 08:37:12 +0000 (10:37 +0200)
Guenther

source/lib/netapi/group.c
source/lib/netapi/netapi.h

index 5807ad83c12609091ce6372583ff2a3225588080..ebaf3660ec26dcea3104f768e4020e7828f4898e 100644 (file)
@@ -593,6 +593,7 @@ static WERROR map_group_info_to_buffer(TALLOC_CTX *mem_ctx,
        struct GROUP_INFO_1 info1;
        struct GROUP_INFO_2 info2;
        struct GROUP_INFO_3 info3;
+       struct dom_sid sid;
 
        switch (level) {
                case 0:
@@ -618,13 +619,14 @@ static WERROR map_group_info_to_buffer(TALLOC_CTX *mem_ctx,
 
                        break;
                case 3:
+                       if (!sid_compose(&sid, domain_sid, rid)) {
+                               return WERR_NOMEM;
+                       }
+
                        info3.grpi3_name        = info->name.string;
                        info3.grpi3_comment     = info->description.string;
                        info3.grpi3_attributes  = info->attributes;
-
-                       if (!sid_compose((struct dom_sid *)&info3.grpi3_group_sid, domain_sid, rid)) {
-                               return WERR_NOMEM;
-                       }
+                       info3.grpi3_group_sid   = (struct domsid *)sid_dup_talloc(mem_ctx, &sid);
 
                        *buffer = (uint8_t *)talloc_memdup(mem_ctx, &info3, sizeof(info3));
 
index 086a9a9fcacba6e5d696cde91184df5b78f68168..f6345afe67c637db06aad0db52d8b121c431bb4b 100644 (file)
@@ -138,7 +138,7 @@ struct GROUP_INFO_2 {
 struct GROUP_INFO_3 {
        const char * grpi3_name;
        const char * grpi3_comment;
-       struct domsid grpi3_group_sid;
+       struct domsid grpi3_group_sid;
        uint32_t grpi3_attributes;
 };