- Add patch for libsepool 2.4 support

This commit is contained in:
Dan Horák 2016-01-29 14:01:11 +01:00
parent 07282d3796
commit 300f5dde54
2 changed files with 107 additions and 1 deletions

View File

@ -0,0 +1,101 @@
From 0e41755e0364df7666f286a3b6f8d663933c3149 Mon Sep 17 00:00:00 2001
From: Chris PeBenito <cpebenito@tresys.com>
Date: Wed, 4 Feb 2015 14:34:47 -0500
Subject: [PATCH] Update to libsepol 2.4 parser.
There was a struct change internally. Now setools requires libsepol 2.4.
---
README | 4 ++--
libqpol/src/policy_define.c | 4 ++--
libqpol/src/policy_extend.c | 4 ++--
libqpol/src/syn_rule_query.c | 6 +++---
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/README b/README
index 04b159b..c08d786 100644
--- a/README
+++ b/README
@@ -71,8 +71,8 @@ compilation:
bison
pkg-config 0.23 or greater
libselinux 2.0.87 or greater
- libsepol 2.0.38 or greater
- libsepol-static 2.0.38 or greater
+ libsepol 2.4 or greater
+ libsepol-static 2.4 or greater
libxml2
sqlite 3.6.20 or greater
diff --git a/libqpol/src/policy_define.c b/libqpol/src/policy_define.c
index fad6b60..231962f 100644
--- a/libqpol/src/policy_define.c
+++ b/libqpol/src/policy_define.c
@@ -1449,7 +1449,7 @@ int define_compute_type_helper(int which, avrule_t ** rule)
return -1;
}
class_perm_node_init(perm);
- perm->class = i + 1;
+ perm->tclass = i + 1;
perm->data = datum->s.value;
perm->next = avrule->perms;
avrule->perms = perm;
@@ -1699,7 +1699,7 @@ int define_te_avtab_helper(int which, avrule_t ** rule)
goto out;
}
class_perm_node_init(cur_perms);
- cur_perms->class = i + 1;
+ cur_perms->tclass = i + 1;
if (!perms)
perms = cur_perms;
if (tail)
diff --git a/libqpol/src/policy_extend.c b/libqpol/src/policy_extend.c
index 5325a87..1417271 100644
--- a/libqpol/src/policy_extend.c
+++ b/libqpol/src/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->class;
+ key.class_val = class_node->tclass;
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->class;
+ key.class_val = class_node->tclass;
key.cond = cond;
if (qpol_syn_rule_table_insert_entry(policy, table, &key, new_rule))
goto err;
diff --git a/libqpol/src/syn_rule_query.c b/libqpol/src/syn_rule_query.c
index 3e63204..d7578f1 100644
--- a/libqpol/src/syn_rule_query.c
+++ b/libqpol/src/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->class - 1];
+ return db->class_val_to_struct[srcs->cur->tclass - 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->class - 1]->permissions.nprim; i++) {
+ for (i = 0; i < db->class_val_to_struct[node->tclass - 1]->permissions.nprim; i++) {
if (!(node->data & (1 << i)))
continue;
- tmp = sepol_av_to_string(db, node->class, (sepol_access_vector_t) (1 << i));
+ tmp = sepol_av_to_string(db, node->tclass, (sepol_access_vector_t) (1 << i));
if (tmp) {
tmp++; /* remove prepended space */
for (cur = 0; cur < perm_list_sz; cur++)
--
1.8.3.1

View File

@ -3,7 +3,7 @@
Name: setools Name: setools
Version: %{setools_maj_ver}.%{setools_min_ver} Version: %{setools_maj_ver}.%{setools_min_ver}
Release: 7%{?dist} Release: 8%{?dist}
License: GPLv2 License: GPLv2
URL: http://oss.tresys.com/projects/setools URL: http://oss.tresys.com/projects/setools
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@ -23,6 +23,7 @@ Patch9: 0009-Fix-help-message-on-sesearch-D.patch
Patch10: 0010-Apply-swig-patch-to-make-apol-work-again.patch Patch10: 0010-Apply-swig-patch-to-make-apol-work-again.patch
Patch11: 0011-Fix-Wformat-security-issues.patch Patch11: 0011-Fix-Wformat-security-issues.patch
Patch12: 0012-Fix-configure.ac-to-use-SWIG-3.0.0.patch Patch12: 0012-Fix-configure.ac-to-use-SWIG-3.0.0.patch
Patch17: 0017-update-to-libsepool-2.4-parser.patch
Summary: Policy analysis tools for SELinux Summary: Policy analysis tools for SELinux
Group: System Environment/Base Group: System Environment/Base
@ -162,6 +163,7 @@ This package includes the following graphical tools:
%patch10 -p 1 -b .wig-patch %patch10 -p 1 -b .wig-patch
%patch11 -p 1 -b .Wformat-security %patch11 -p 1 -b .Wformat-security
%patch12 -p 1 -b .version %patch12 -p 1 -b .version
%patch17 -p 1 -b .libsepool24
%ifarch sparc sparcv9 sparc64 s390 s390x %ifarch sparc sparcv9 sparc64 s390 s390x
for file in `find . -name Makefile.am`; do for file in `find . -name Makefile.am`; do
@ -281,6 +283,9 @@ rm -rf ${RPM_BUILD_ROOT}
%postun libs-tcl -p /sbin/ldconfig %postun libs-tcl -p /sbin/ldconfig
%changelog %changelog
* Fri Sep 25 2015 David Sommerseth <davids@redhat.com> - 3.3.8-8
- Add patch for libsepool 2.4 support
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3.8-7 * Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3.8-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild