| 5030 | } |
| 5031 | |
| 5032 | static bool win_file_dacl_is_empty(win_security_t *security, HANDLE file) { |
| 5033 | PACL dacl = NULL; |
| 5034 | PSECURITY_DESCRIPTOR descriptor = NULL; |
| 5035 | if (security->get_security_info(file, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, |
| 5036 | &dacl, NULL, &descriptor) != ERROR_SUCCESS) { |
| 5037 | return false; |
| 5038 | } |
| 5039 | ACL_SIZE_INFORMATION information; |
| 5040 | memset(&information, 0, sizeof(information)); |
| 5041 | bool empty = dacl && security->is_valid_acl(dacl) && |
| 5042 | security->get_acl_information(dacl, &information, sizeof(information), |
| 5043 | AclSizeInformation) && |
| 5044 | information.AceCount == 0U; |
| 5045 | if (descriptor) { |
| 5046 | (void)LocalFree(descriptor); |
| 5047 | } |
| 5048 | return empty; |
| 5049 | } |
| 5050 | |
| 5051 | /* Repair cache/runtime children left unusable by the pre-v0.10.3 DACL regime. |
| 5052 | * |
no outgoing calls
no test coverage detected