- DEBUG("Successfully wrote security data.");
- return p;
-}
-
-static void
-print_acl(const void *p, const tchar *type)
-{
- const ACL *acl = p;
- u8 revision = acl->revision;
- u16 acl_size = le16_to_cpu(acl->acl_size);
- u16 ace_count = le16_to_cpu(acl->ace_count);
- tprintf(T(" [%"TS" ACL]\n"), type);
- tprintf(T(" Revision = %u\n"), revision);
- tprintf(T(" ACL Size = %u\n"), acl_size);
- tprintf(T(" ACE Count = %u\n"), ace_count);
-
- p += sizeof(ACL);
- for (u16 i = 0; i < ace_count; i++) {
- const ACEHeader *hdr = p;
- tprintf(T(" [ACE]\n"));
- tprintf(T(" ACE type = %d\n"), hdr->type);
- tprintf(T(" ACE flags = 0x%x\n"), hdr->flags);
- tprintf(T(" ACE size = %u\n"), hdr->size);
- const AccessAllowedACE *aaa = (const AccessAllowedACE*)hdr;
- tprintf(T(" ACE mask = %x\n"), le32_to_cpu(aaa->mask));
- tprintf(T(" SID start = %u\n"), le32_to_cpu(aaa->sid_start));
- p += hdr->size;
- }
- tputchar(T('\n'));
-}
-
-static void
-print_sid(const void *p, const tchar *type)
-{
- const SID *sid = p;
- tprintf(T(" [%"TS" SID]\n"), type);
- tprintf(T(" Revision = %u\n"), sid->revision);
- tprintf(T(" Subauthority count = %u\n"), sid->sub_authority_count);
- tprintf(T(" Identifier authority = "));
- print_byte_field(sid->identifier_authority,
- sizeof(sid->identifier_authority), stdout);
- tputchar(T('\n'));
- for (u8 i = 0; i < sid->sub_authority_count; i++) {
- tprintf(T(" Subauthority %u = %u\n"),
- i, le32_to_cpu(sid->sub_authority[i]));
- }
- tputchar(T('\n'));
-}
-
-static void
-print_security_descriptor(const void *p, u64 size)
-{
- const SecurityDescriptor *sd = p;
-
- u8 revision = sd->revision;
- u16 control = le16_to_cpu(sd->security_descriptor_control);
- u32 owner_offset = le32_to_cpu(sd->owner_offset);
- u32 group_offset = le32_to_cpu(sd->group_offset);
- u32 sacl_offset = le32_to_cpu(sd->sacl_offset);
- u32 dacl_offset = le32_to_cpu(sd->dacl_offset);
- tprintf(T("Revision = %u\n"), revision);
- tprintf(T("Security Descriptor Control = %#x\n"), control);
- tprintf(T("Owner offset = %u\n"), owner_offset);
- tprintf(T("Group offset = %u\n"), group_offset);
- tprintf(T("System ACL offset = %u\n"), sacl_offset);
- tprintf(T("Discretionary ACL offset = %u\n"), dacl_offset);
-
- if (sd->owner_offset != 0)
- print_sid(p + owner_offset, T("Owner"));
- if (sd->group_offset != 0)
- print_sid(p + group_offset, T("Group"));
- if (sd->sacl_offset != 0)
- print_acl(p + sacl_offset, T("System"));
- if (sd->dacl_offset != 0)
- print_acl(p + dacl_offset, T("Discretionary"));
-}
-
-/*
- * Prints the security data for a WIM file.
- */
-void
-print_security_data(const struct wim_security_data *sd)
-{
- wimlib_assert(sd != NULL);