diff --git a/0014-boolsub.patch b/0014-boolsub.patch new file mode 100644 index 0000000..2890628 --- /dev/null +++ b/0014-boolsub.patch @@ -0,0 +1,24 @@ +diff -up ./setools-3.3.7/secmds/seinfo.c~ ./setools-3.3.7/secmds/seinfo.c +--- ./setools-3.3.7/secmds/seinfo.c~ 2013-03-14 15:26:31.467121596 -0400 ++++ ./setools-3.3.7/secmds/seinfo.c 2013-03-14 15:35:20.154650517 -0400 +@@ -1705,7 +1705,7 @@ int main(int argc, char **argv) + case 'b': /* conditional booleans */ + bools = 1; + if (optarg != 0) +- bool_name = optarg; ++ bool_name = selinux_boolean_sub(optarg); + break; + case OPT_INITIALSID: + isids = 1; +diff -up ./setools-3.3.7/secmds/sesearch.c~ ./setools-3.3.7/secmds/sesearch.c +--- ./setools-3.3.7/secmds/sesearch.c~ 2013-03-14 15:26:31.539121944 -0400 ++++ ./setools-3.3.7/secmds/sesearch.c 2013-03-14 15:34:36.615445562 -0400 +@@ -1056,7 +1056,7 @@ int main(int argc, char **argv) + printf("Missing boolean for -b (--bool)\n"); + exit(1); + } +- cmd_opts.bool_name = strdup(optarg); ++ cmd_opts.bool_name = strdup(selinux_boolean_sub(optarg)); + if (!cmd_opts.bool_name) { + fprintf(stderr, "%s\n", strerror(errno)); + exit(1); diff --git a/0015-aliases.patch b/0015-aliases.patch new file mode 100644 index 0000000..355aff3 --- /dev/null +++ b/0015-aliases.patch @@ -0,0 +1,82 @@ +diff -up setools-3.3.7/libapol/src/policy-query.c~ setools-3.3.7/libapol/src/policy-query.c +diff -up setools-3.3.7/libqpol/include/qpol/type_query.h~ setools-3.3.7/libqpol/include/qpol/type_query.h +diff -up setools-3.3.7/libqpol/tests/iterators-tests.c~ setools-3.3.7/libqpol/tests/iterators-tests.c +diff -up setools-3.3.7/secmds/seinfo.c~ setools-3.3.7/secmds/seinfo.c +--- setools-3.3.7/secmds/seinfo.c~ 2013-03-25 11:30:23.161633059 -0400 ++++ setools-3.3.7/secmds/seinfo.c 2013-03-28 13:08:07.281751011 -0400 +@@ -46,6 +46,7 @@ + #include + #include + #include ++#include + + #define COPYRIGHT_INFO "Copyright (C) 2003-2007 Tresys Technology, LLC" + +@@ -54,6 +55,7 @@ + + static char *policy_file = NULL; + ++static void print_type_aliases(FILE * fp, const qpol_type_t * type_datum, const apol_policy_t * policydb); + static void print_type_attrs(FILE * fp, const qpol_type_t * type_datum, const apol_policy_t * policydb, const int expand); + static void print_attr_types(FILE * fp, const qpol_type_t * type_datum, const apol_policy_t * policydb, const int expand); + static void print_user_roles(FILE * fp, const qpol_user_t * user_datum, const apol_policy_t * policydb, const int expand); +@@ -511,6 +513,7 @@ static int print_types(FILE * fp, const + if (qpol_policy_get_type_by_name(q, name, &type_datum)) + goto cleanup; + print_type_attrs(fp, type_datum, policydb, expand); ++ print_type_aliases(fp, type_datum, policydb); + } else { + if (qpol_policy_get_type_iter(q, &iter)) + goto cleanup; +@@ -1897,6 +1900,51 @@ int main(int argc, char **argv) + } + + /** ++ * Prints the alias of a type. ++ * ++ * @param fp Reference to a file to which to print type information ++ * @param type_datum Reference to sepol type_datum ++ * @param policydb Reference to a policy ++ * attributes ++ */ ++static void print_type_aliases(FILE * fp, const qpol_type_t * type_datum, const apol_policy_t * policydb) ++{ ++ qpol_iterator_t *iter = NULL; ++ size_t alias_size; ++ unsigned char isattr, isalias; ++ const char *type_name = NULL; ++ const char *alias_name; ++ qpol_policy_t *q = apol_policy_get_qpol(policydb); ++ ++ if (qpol_type_get_name(q, type_datum, &type_name)) ++ goto cleanup; ++ if (qpol_type_get_isattr(q, type_datum, &isattr)) ++ goto cleanup; ++ if (qpol_type_get_isalias(q, type_datum, &isalias)) ++ goto cleanup; ++ ++ if (isalias) { ++ fprintf(fp, " TypeName %s\n", type_name); ++ } ++ if (qpol_type_get_alias_iter(q, type_datum, &iter)) ++ goto cleanup; ++ if (qpol_iterator_get_size(iter, &alias_size)) ++ goto cleanup; ++ if (alias_size > 0) { ++ fprintf(fp, " Aliases\n"); ++ for (; !qpol_iterator_end(iter); qpol_iterator_next(iter)) { ++ if (qpol_iterator_get_item(iter, (void **)&alias_name)) ++ goto cleanup; ++ fprintf(fp, " %s\n", alias_name); ++ } ++ } ++ ++ cleanup: ++ qpol_iterator_destroy(&iter); ++ return; ++} ++ ++/** + * Prints a textual representation of a type, and possibly + * all of that type's attributes. + * diff --git a/setools.spec b/setools.spec index 8ee8d11..93a3a48 100644 --- a/setools.spec +++ b/setools.spec @@ -1,11 +1,9 @@ %define setools_maj_ver 3.3 %define setools_min_ver 7 -%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: setools Version: %{setools_maj_ver}.%{setools_min_ver} -Release: 34%{?dist} +Release: 38%{?dist} License: GPLv2 URL: http://oss.tresys.com/projects/setools BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -25,6 +23,8 @@ Patch10: 0010-selinux_current_policy_path.patch Patch11: 0011-setools-noship.patch Patch12: 0012-seaudit.patch Patch13: 0013-swig.patch +Patch14: 0014-boolsub.patch +Patch15: 0015-aliases.patch Summary: Policy analysis tools for SELinux Group: System Environment/Base @@ -34,7 +34,6 @@ Requires: setools-libs = %{version}-%{release} setools-libs-tcl = %{version}-%{r %define autoconf_ver 2.59 %define bwidget_ver 1.8 %define gtk_ver 2.8 -%define python_ver 2.3 %define sepol_ver 2.1.8-5 %define selinux_ver 2.1.12-10 %define sqlite_ver 3.2.0 @@ -54,7 +53,8 @@ Summary: Policy analysis support libraries for SELinux Group: System Environment/Libraries Requires: libselinux >= %{selinux_ver} libsepol >= %{sepol_ver} sqlite >= %{sqlite_ver} Obsoletes: setools-libs-java -BuildRequires: flex bison pkgconfig +Obsoletes: setools-libs-python < 3.3.7-36 +BuildRequires: flex bison pkgconfig bzip2-devel BuildRequires: glibc-devel libstdc++-devel gcc gcc-c++ BuildRequires: libselinux-devel >= %{selinux_ver} libsepol-devel >= %{sepol_ver} BuildRequires: libsepol-static >= %{sepol_ver} @@ -74,25 +74,6 @@ This package includes the following run-time libraries: libseaudit parse and filter SELinux audit messages in log files libsefs SELinux file contexts library -%package libs-python -License: LGPLv2 -Summary: Python bindings for SELinux policy analysis -Group: Development/Languages -Requires: setools-libs = %{version}-%{release} python2 >= %{python_ver} bzip2-libs -BuildRequires: python2-devel >= %{python_ver} swig >= %{swig_ver} bzip2-devel - -%description libs-python -SETools is a collection of graphical tools, command-line tools, and -libraries designed to facilitate SELinux policy analysis. - -This package includes Python bindings for the following libraries: - - libapol policy analysis library - libpoldiff semantic policy difference library - libqpol library that abstracts policy internals - libseaudit parse and filter SELinux audit messages in log files - libsefs SELinux file contexts library - %package libs-tcl License: LGPLv2 Summary: Tcl bindings for SELinux policy analysis @@ -167,8 +148,6 @@ This package includes the following graphical tools: seaudit audit log analysis tool %define setoolsdir %{_datadir}/setools-%{setools_maj_ver} -%define pkg_py_lib %{python_sitelib}/setools -%define pkg_py_arch %{python_sitearch}/setools %define tcllibdir %{_libdir}/setools %prep @@ -185,6 +164,8 @@ This package includes the following graphical tools: %patch11 -p 1 -b .noship %patch12 -p 1 -b .seaudit %patch13 -p 1 -b .swig +%patch14 -p 2 -b .boolsub +%patch15 -p 1 -b .aliases %ifarch sparc sparcv9 sparc64 s390 s390x for file in `find . -name Makefile.am`; do sed -i -e 's:-fpic:-fPIC:' $file; @@ -199,9 +180,8 @@ autoreconf -if %build automake %configure --libdir=%{_libdir} --disable-bwidget-check --disable-selinux-check \ - --enable-swig-python --enable-swig-tcl + --enable-swig-tcl # work around issue with gcc 4.3 + gnu99 + swig-generated code: -sed -i -e 's:$(CC):gcc -std=gnu89:' libseaudit/swig/python/Makefile make %{?_smp_mflags} %install @@ -223,7 +203,6 @@ rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.a # ensure permissions are correct chmod 0755 ${RPM_BUILD_ROOT}/%{_libdir}/*.so.* chmod 0755 ${RPM_BUILD_ROOT}/%{_libdir}/%{name}/*/*.so.* -chmod 0755 ${RPM_BUILD_ROOT}/%{pkg_py_arch}/*.so.* chmod 0644 ${RPM_BUILD_ROOT}/%{tcllibdir}/*/pkgIndex.tcl %clean @@ -242,13 +221,6 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libseaudit.so.* %dir %{setoolsdir} -%files libs-python -%defattr(-,root,root,-) -%{pkg_py_lib}/ -%ifarch x86_64 ppc64 sparc64 s390x -%{pkg_py_arch}/ -%endif - %files libs-tcl %defattr(-,root,root,-) %dir %{tcllibdir} @@ -310,6 +282,18 @@ rm -rf ${RPM_BUILD_ROOT} %postun libs-tcl -p /sbin/ldconfig %changelog +* Thu Mar 28 2013 Dan Walsh - 3.3.7-38 +- Add alias support to seinfo -t + +* Wed Mar 27 2013 Kalev Lember - 3.3.7-37 +- Obsolete the removed setools-libs-python subpackage + +* Fri Mar 15 2013 Dan Walsh - 3.3.7-36 +- Drop support for python bindings + +* Thu Mar 14 2013 Dan Walsh - 3.3.7-35 +- Add support for substituting bools to sesearch and seinfo + * Wed Jan 30 2013 Dan Walsh - 3.3.7-34 - Rebuild using pristine source from Tresys