s3:registry/regfio read SD from the correct location
authorChristian Ambach <ambi@samba.org>
Tue, 4 Nov 2014 22:47:26 +0000 (23:47 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 18 Dec 2014 20:30:05 +0000 (21:30 +0100)
try to find the security descriptor at the data pointer, not at the beginning of the hbin

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9629

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 217a0189c15761f6c7b24c9d7bfdbccf85de8e1d)

source3/registry/regfio.c

index bde18630aa02b9c265e001d16bef12f91e429a7d..41d60c7930491dc8967b59fe40d22857525122db 100644 (file)
@@ -768,8 +768,10 @@ static bool hbin_prs_sk_rec( const char *desc, REGF_HBIN *hbin, int depth, REGF_
                        if (!prs_copy_data_in(&hbin->ps, (const char *)blob.data, blob.length))
                                return False;
                } else {
-                       blob = data_blob_const(prs_data_p(&hbin->ps),
-                                              prs_data_size(&hbin->ps));
+                       blob = data_blob_const(
+                               prs_data_p(&hbin->ps) + prs_offset(&hbin->ps),
+                               prs_data_size(&hbin->ps) - prs_offset(&hbin->ps)
+                              );
                        status = unmarshall_sec_desc(mem_ctx,
                                                     blob.data, blob.length,
                                                     &sk->sec_desc);