1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

a null grp_sid should have a 0 offset. Also removed a few more unnecessary

prs_align() for sec_desc.
This commit is contained in:
Gerald Carter 0001-01-01 00:00:00 +00:00
parent d015c08100
commit fc3770f281
2 changed files with 6 additions and 17 deletions

View File

@ -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;
dst->off_grp_sid = offset_sid + sid_size(dst->owner_sid);
}
else
/* sid_size() returns 0 if the sid is NULL so this is ok */
if (dst->grp_sid != NULL)
dst->off_grp_sid = offset_sid;
dst->off_grp_sid = offset_sid + sid_size(dst->owner_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;
}

View File

@ -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;
}