mirror of
https://github.com/SELinuxProject/setools
synced 2025-02-09 08:26:53 +00:00
0c3b238498
This is not officially supported.
76 lines
2.9 KiB
Diff
76 lines
2.9 KiB
Diff
Applying this patch to the SETools 4 source code should allow it
|
|
to compile using libsepol-2.3.
|
|
|
|
This is not officially supported by SETools.
|
|
|
|
diff --git a/libqpol/policy_define.c b/libqpol/policy_define.c
|
|
index af5a6e6..ceb65e2 100644
|
|
--- a/libqpol/policy_define.c
|
|
+++ b/libqpol/policy_define.c
|
|
@@ -1593,7 +1593,7 @@ int define_compute_type_helper(int which, avrule_t ** rule)
|
|
goto bad;
|
|
}
|
|
class_perm_node_init(perm);
|
|
- perm->tclass = i + 1;
|
|
+ perm->class = i + 1;
|
|
perm->data = datum->s.value;
|
|
perm->next = avrule->perms;
|
|
avrule->perms = perm;
|
|
@@ -1807,7 +1807,7 @@ int define_te_avtab_helper(int which, avrule_t ** rule)
|
|
goto out;
|
|
}
|
|
class_perm_node_init(cur_perms);
|
|
- cur_perms->tclass = i + 1;
|
|
+ cur_perms->class = i + 1;
|
|
if (!perms)
|
|
perms = cur_perms;
|
|
if (tail)
|
|
diff --git a/libqpol/policy_extend.c b/libqpol/policy_extend.c
|
|
index 5fb0cfe..1009c81 100644
|
|
--- a/libqpol/policy_extend.c
|
|
+++ b/libqpol/policy_extend.c
|
|
@@ -843,7 +843,7 @@ static int qpol_syn_rule_table_insert_sepol_avrule(qpol_policy_t * policy, qpol_
|
|
for (class_node = rule->perms; class_node; class_node = class_node->next) {
|
|
key.rule_type = rule->specified;
|
|
key.source_val = key.target_val = i + 1;
|
|
- key.class_val = class_node->tclass;
|
|
+ key.class_val = class_node->class;
|
|
key.cond = cond;
|
|
if (qpol_syn_rule_table_insert_entry(policy, table, &key, new_rule))
|
|
goto err;
|
|
@@ -856,7 +856,7 @@ static int qpol_syn_rule_table_insert_sepol_avrule(qpol_policy_t * policy, qpol_
|
|
key.rule_type = rule->specified;
|
|
key.source_val = i + 1;
|
|
key.target_val = j + 1;
|
|
- key.class_val = class_node->tclass;
|
|
+ key.class_val = class_node->class;
|
|
key.cond = cond;
|
|
if (qpol_syn_rule_table_insert_entry(policy, table, &key, new_rule))
|
|
goto err;
|
|
diff --git a/libqpol/syn_rule_query.c b/libqpol/syn_rule_query.c
|
|
index d7578f1..3e63204 100644
|
|
--- a/libqpol/syn_rule_query.c
|
|
+++ b/libqpol/syn_rule_query.c
|
|
@@ -67,7 +67,7 @@ static void *syn_rule_class_state_get_cur(const qpol_iterator_t * iter)
|
|
return NULL;
|
|
}
|
|
|
|
- return db->class_val_to_struct[srcs->cur->tclass - 1];
|
|
+ return db->class_val_to_struct[srcs->cur->class - 1];
|
|
}
|
|
|
|
static int syn_rule_class_state_next(qpol_iterator_t * iter)
|
|
@@ -465,10 +465,10 @@ int qpol_syn_avrule_get_perm_iter(const qpol_policy_t * policy, const qpol_syn_a
|
|
}
|
|
|
|
for (node = internal_rule->perms; node; node = node->next) {
|
|
- for (i = 0; i < db->class_val_to_struct[node->tclass - 1]->permissions.nprim; i++) {
|
|
+ for (i = 0; i < db->class_val_to_struct[node->class - 1]->permissions.nprim; i++) {
|
|
if (!(node->data & (1 << i)))
|
|
continue;
|
|
- tmp = sepol_av_to_string(db, node->tclass, (sepol_access_vector_t) (1 << i));
|
|
+ tmp = sepol_av_to_string(db, node->class, (sepol_access_vector_t) (1 << i));
|
|
if (tmp) {
|
|
tmp++; /* remove prepended space */
|
|
for (cur = 0; cur < perm_list_sz; cur++)
|