summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-07-16 16:14:47 +0200
committerGünther Deschner <gd@samba.org>2008-07-17 10:37:12 +0200
commit89f4e869b657b6c92f84741bc1cdebbabe4dd72d (patch)
tree75d8301445806ece600414c9c05055840655e2ed /source3
parent4d387af3058ecc0c9e3f8b3711c46adef335d6dc (diff)
downloadsamba-89f4e869b657b6c92f84741bc1cdebbabe4dd72d.tar.gz
samba-89f4e869b657b6c92f84741bc1cdebbabe4dd72d.tar.bz2
samba-89f4e869b657b6c92f84741bc1cdebbabe4dd72d.zip
netapi: fix map_group_info_to_buffer for GROUP_INFO_3 change.
Guenther (This used to be commit f2875677194f440ffebf18e6f5171be948114353)
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;
};