From c1c140a26e2136741918ee78d38f8ba86e1eacde Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Wed, 24 Jun 2015 17:59:35 +0200 Subject: [PATCH] * Wed Jun 24 2015 Petr Lautrbach 2.4-0.6 - Allow to use compressed modules without a compression extension --- libsemanage-rhat.patch | 40 ++++++++++++++++++++++++++++++++++++++++ libsemanage.spec | 5 ++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/libsemanage-rhat.patch b/libsemanage-rhat.patch index a18c90b..74da8e0 100644 --- a/libsemanage-rhat.patch +++ b/libsemanage-rhat.patch @@ -1,3 +1,43 @@ +diff --git libsemanage-2.4/src/direct_api.c libsemanage-2.4/src/direct_api.c +index b0ed338..ba5f475 100644 +--- libsemanage-2.4/src/direct_api.c ++++ libsemanage-2.4/src/direct_api.c +@@ -1355,7 +1355,7 @@ static int semanage_direct_install_file(semanage_handle_t * sh, + int in_fd = -1; + char *path = NULL; + char *filename; +- char *lang_ext; ++ char *lang_ext = NULL; + char *separator; + + if ((in_fd = open(install_filename, O_RDONLY)) == -1) { +@@ -1387,17 +1387,20 @@ static int semanage_direct_install_file(semanage_handle_t * sh, + goto cleanup; + } + *separator = '\0'; ++ lang_ext = separator + 1; + } + + separator = strrchr(filename, '.'); + if (separator == NULL) { +- ERR(sh, "Module does not have a valid extension."); +- retval = -1; +- goto cleanup; ++ if (lang_ext == NULL) { ++ ERR(sh, "Module does not have a valid extension."); ++ retval = -1; ++ goto cleanup; ++ } ++ } else { ++ *separator = '\0'; ++ lang_ext = separator + 1; + } +- *separator = '\0'; +- +- lang_ext = separator + 1; + + retval = semanage_direct_install(sh, data, data_len, filename, lang_ext); + diff --git libsemanage-2.4/tests/test_utilities.c libsemanage-2.4/tests/test_utilities.c index 4d25b07..32cc33c 100644 --- libsemanage-2.4/tests/test_utilities.c diff --git a/libsemanage.spec b/libsemanage.spec index ae09283..3c39e1a 100644 --- a/libsemanage.spec +++ b/libsemanage.spec @@ -7,7 +7,7 @@ Summary: SELinux binary policy manipulation library Name: libsemanage Version: 2.4 -Release: 0%{?dist}.5 +Release: 0%{?dist}.6 License: LGPLv2+ Group: System Environment/Libraries Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20150202/libsemanage-%{version}.tar.gz @@ -187,6 +187,9 @@ rm -rf ${RPM_BUILD_ROOT} %endif # if with_python3 %changelog +* Wed Jun 24 2015 Petr Lautrbach 2.4-0.6 +- Allow to use compressed modules without a compression extension + * Tue Jun 16 2015 Petr Lautrbach 2.4-0.5 - add /var/lib/selinux/tmp directory