From fc3770f281f6344a0589bfe614cd3e559b7259dd Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 27 Jun 2002 01:12:37 +0000 Subject: [PATCH] a null grp_sid should have a 0 offset. Also removed a few more unnecessary prs_align() for sec_desc. --- source/rpc_parse/parse_sec.c | 16 ++++++---------- source/rpc_parse/parse_spoolss.c | 7 ------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/source/rpc_parse/parse_sec.c b/source/rpc_parse/parse_sec.c index e97cd261e00..8ae8264d6d5 100644 --- a/source/rpc_parse/parse_sec.c +++ b/source/rpc_parse/parse_sec.c @@ -128,9 +128,6 @@ BOOL sec_io_ace(char *desc, SEC_ACE *psa, prs_struct *ps, int depth) if(!sec_io_access("info ", &psa->info, ps, depth)) return False; - if(!prs_align(ps)) - return False; - /* check whether object access is present */ if (!sec_ace_object(psa->type)) { if (!smb_io_dom_sid("trustee ", &psa->trustee , ps, depth)) @@ -675,13 +672,13 @@ SEC_DESC *make_sec_desc(TALLOC_CTX *ctx, uint16 revision, *sd_size = (size_t)((offset == 0) ? SEC_DESC_HEADER_SIZE : offset); - if (dst->owner_sid != NULL) { + if (dst->owner_sid != NULL) dst->off_owner_sid = offset_sid; + + /* sid_size() returns 0 if the sid is NULL so this is ok */ + + if (dst->grp_sid != NULL) dst->off_grp_sid = offset_sid + sid_size(dst->owner_sid); - } - else - if (dst->grp_sid != NULL) - dst->off_grp_sid = offset_sid; return dst; @@ -798,8 +795,6 @@ BOOL sec_io_desc(char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth) if(!smb_io_dom_sid("owner_sid ", psd->owner_sid , ps, depth)) return False; - if(!prs_align(ps)) - return False; ps->data_offset = tmp_offset; } @@ -821,6 +816,7 @@ BOOL sec_io_desc(char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth) if(!smb_io_dom_sid("grp_sid", psd->grp_sid, ps, depth)) return False; + ps->data_offset = tmp_offset; } diff --git a/source/rpc_parse/parse_spoolss.c b/source/rpc_parse/parse_spoolss.c index aa7fcd0010d..841d303840c 100644 --- a/source/rpc_parse/parse_spoolss.c +++ b/source/rpc_parse/parse_spoolss.c @@ -2367,13 +2367,6 @@ BOOL smb_io_printer_info_2(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_2 *info, if (!prs_uint32("averageppm", ps, depth, &info->averageppm)) return False; -#if 0 /* JFMTEST */ - if (!prs_uint32_post("secdesc_ptr", ps, depth, NULL, sec_offset, info->secdesc ? prs_offset(ps)-buffer->struct_start : 0 )) - return False; - - if (!sec_io_desc("secdesc", &info->secdesc, ps, depth)) - return False; -#endif return True; } -- 2.11.4.GIT