Make sepolicy a shared type between rust and cxx

This commit is contained in:
LoveSy
2025-02-04 00:36:11 +08:00
committed by John Wu
parent 7f6c9e8411
commit c913f7ec74
9 changed files with 137 additions and 221 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
#include <base.hpp>
#include "policy.hpp"
#include "include/sepolicy.hpp"
using namespace std;
@@ -653,14 +653,14 @@ bool sepol_impl::add_typeattribute(const char *type, const char *attr) {
return true;
}
void sepolicy::strip_dontaudit() {
void sepolicy::strip_dontaudit() noexcept {
avtab_for_each(&impl->db->te_avtab, [=, this](avtab_ptr_t node) {
if (node->key.specified == AVTAB_AUDITDENY || node->key.specified == AVTAB_XPERMS_DONTAUDIT)
avtab_remove_node(&impl->db->te_avtab, node);
});
}
void sepolicy::print_rules() {
void sepolicy::print_rules() const noexcept {
hashtab_for_each(impl->db->p_types.table, [&](hashtab_ptr_t node) {
type_datum_t *type = auto_cast(node->datum);
if (type->flavor == TYPE_ATTRIB) {