summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWenzong Fan <wenzong.fan@windriver.com>2015-10-10 02:32:42 -0400
committerJoe MacDonald <joe_macdonald@mentor.com>2015-10-22 10:52:49 -0400
commit6d0c9ecd8d08f2bfafbe9def50628b5c14e5fe57 (patch)
treeb9ca5e4c0437cf640ff4465b6a2583440a61d305
parent0eafe06e34ee72d70e28a4f46d2ab1a58ac044e6 (diff)
downloadmeta-selinux-6d0c9ecd8d08f2bfafbe9def50628b5c14e5fe57.tar.gz
refpolicy: fix exit code issue of bzip2
'bzip2 -qt $moudle_name.pp' has different exit codes on different distributions, for example: * On Redhat/CentOS/Fedora, OpenSUSE: $ bzip2 -qt /tmp/tor.pp bzip2: /tmp/tor.pp: bad magic number (file not created by bzip2) $ echo $? 0 This causes install errors: unzip2: /path/to/*.pp is not a bzip2 file. libsepol.module_package_read_offsets: module package header truncated Failed to read policy package * Ubuntu has fixed it: $ bzip2 -qt /tmp/tor.pp bzip2: /tmp/tor.pp: bad magic number (file not created by bzip2) $ echo $? 2 The difference involved by '-q' options, remove it would get the bzip2 works consistently. bzip2-native has the same issue, anyway it should be fixed separately. Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r--recipes-security/refpolicy/refpolicy_common.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/recipes-security/refpolicy/refpolicy_common.inc b/recipes-security/refpolicy/refpolicy_common.inc
index de38dfc..5acbf3e 100644
--- a/recipes-security/refpolicy/refpolicy_common.inc
+++ b/recipes-security/refpolicy/refpolicy_common.inc
@@ -84,7 +84,7 @@ prepare_policy_store () {
84 MOD_DIR=${POL_ACTIVE_MODS}/${MOD_NAME} 84 MOD_DIR=${POL_ACTIVE_MODS}/${MOD_NAME}
85 mkdir -p ${MOD_DIR} 85 mkdir -p ${MOD_DIR}
86 echo -n "${HLL_TYPE}" > ${MOD_DIR}/lang_ext 86 echo -n "${HLL_TYPE}" > ${MOD_DIR}/lang_ext
87 if ! bzip2 -qt $i 2>/dev/null; then 87 if ! bzip2 -t $i >/dev/null 2>&1; then
88 ${HLL_BIN} $i | bzip2 --stdout > ${MOD_DIR}/cil 88 ${HLL_BIN} $i | bzip2 --stdout > ${MOD_DIR}/cil
89 bzip2 -f $i && mv -f $i.bz2 $i 89 bzip2 -f $i && mv -f $i.bz2 $i
90 else 90 else