summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-05-28 13:35:56 -0400
committerSimo Sorce <ssorce@redhat.com>2010-05-29 17:08:02 -0400
commitbd38c0d47d6a22a68fea5d9d66a73a9e2521b239 (patch)
tree570d14ccbeca9a72d2fdccef9ef9c1b905bc4e37 /source3/auth
parentb99dd10b39a4483a1c4b34f5438630ed99374c10 (diff)
downloadsamba-bd38c0d47d6a22a68fea5d9d66a73a9e2521b239.tar.gz
samba-bd38c0d47d6a22a68fea5d9d66a73a9e2521b239.tar.bz2
samba-bd38c0d47d6a22a68fea5d9d66a73a9e2521b239.zip
s3:auth fix info3 duplication function
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/server_info.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c
index 2545e7d58f..f72cdbaae9 100644
--- a/source3/auth/server_info.c
+++ b/source3/auth/server_info.c
@@ -392,6 +392,7 @@ struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX *mem_ctx,
struct netr_SamInfo3 *orig)
{
struct netr_SamInfo3 *info3;
+ unsigned int i;
info3 = talloc_zero(mem_ctx, struct netr_SamInfo3);
if (!info3) return NULL;
@@ -455,10 +456,14 @@ struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX *mem_ctx,
}
if (orig->sidcount) {
- info3->sids = (struct netr_SidAttr *)talloc_memdup(info3, orig->sids,
- (sizeof(struct netr_SidAttr) *
- orig->sidcount));
+ info3->sids = talloc_array(info3, struct netr_SidAttr,
+ orig->sidcount);
RET_NOMEM(info3->sids);
+ for (i = 0; i < orig->sidcount; i++) {
+ info3->sids[i].sid = sid_dup_talloc(info3->sids,
+ orig->sids[i].sid);
+ RET_NOMEM(info3->sids[i].sid);
+ }
}
return info3;