* Wed Jun 24 2015 Petr Lautrbach <plautrba@redhat.com> 2.4-0.6

- Allow to use compressed modules without a compression extension
This commit is contained in:
Petr Lautrbach 2015-06-24 17:59:35 +02:00
parent 7c6e3d711b
commit c1c140a26e
2 changed files with 44 additions and 1 deletions

View File

@ -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

View File

@ -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 <plautrba@redhat.com> 2.4-0.6
- Allow to use compressed modules without a compression extension
* Tue Jun 16 2015 Petr Lautrbach <plautrba@redhat.com> 2.4-0.5
- add /var/lib/selinux/tmp directory