- const SecurityDescriptor *sd = (const SecurityDescriptor*)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);
- printf("Revision = %u\n", revision);
- printf("Security Descriptor Control = %#x\n", control);
- printf("Owner offset = %u\n", owner_offset);
- printf("Group offset = %u\n", group_offset);
- printf("System ACL offset = %u\n", sacl_offset);
- printf("Discretionary ACL offset = %u\n", dacl_offset);
-
- if (sd->owner_offset != 0)
- print_sid(p + owner_offset, "Owner");
- if (sd->group_offset != 0)
- print_sid(p + group_offset, "Group");
- if (sd->sacl_offset != 0)
- print_acl(p + sacl_offset, "System");
- if (sd->dacl_offset != 0)
- print_acl(p + dacl_offset, "Discretionary");
+ struct avl_tree_node *res;
+ struct sd_node dummy;
+
+ copy_hash(dummy.hash, hash);
+ res = avl_tree_lookup_node(set->root, &dummy.index_node,
+ _avl_cmp_nodes_by_hash);
+ if (!res)
+ return -1;
+ return SD_NODE(res)->security_id;