summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/netapi/group.c10
-rw-r--r--source3/lib/netapi/netapi.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/source3/lib/netapi/group.c b/source3/lib/netapi/group.c
index 5807ad83c1..ebaf3660ec 100644
--- a/source3/lib/netapi/group.c
+++ b/source3/lib/netapi/group.c
@@ -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));
diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h
index 086a9a9fca..f6345afe67 100644
--- a/source3/lib/netapi/netapi.h
+++ b/source3/lib/netapi/netapi.h
@@ -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;
};