summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin Ouyang <Xin.Ouyang@windriver.com>2012-12-25 11:16:13 +0800
committerXin Ouyang <Xin.Ouyang@windriver.com>2012-12-25 13:53:41 +0800
commit2e5fd8c5f2b39c3016dc99aef66b1f1fa592a2d6 (patch)
treeecb7ddedd52ae5980fdb21f0d58e12db4694f540
parent43d72a26eb8cf4b57247b44869bdcb9633a63e54 (diff)
downloadmeta-selinux-2e5fd8c5f2b39c3016dc99aef66b1f1fa592a2d6.tar.gz
libsemanage: fix path length limits.
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
-rw-r--r--recipes-security/selinux/libsemanage/libsemanage-fix-path-len-limit.patch28
-rw-r--r--recipes-security/selinux/libsemanage_2.1.6.bb9
-rw-r--r--recipes-security/selinux/libsemanage_git.bb9
3 files changed, 38 insertions, 8 deletions
diff --git a/recipes-security/selinux/libsemanage/libsemanage-fix-path-len-limit.patch b/recipes-security/selinux/libsemanage/libsemanage-fix-path-len-limit.patch
new file mode 100644
index 0000000..c98f3fc
--- /dev/null
+++ b/recipes-security/selinux/libsemanage/libsemanage-fix-path-len-limit.patch
@@ -0,0 +1,28 @@
1Subject: [PATCH] libsemanage: fix path length limit
2
3semanage_remove_directory uses NAME_MAX(255) as the max length of
4file pathes, this will cause failures when the path length>255.
5
6Upstream-Status: pending
7
8Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
9---
10 src/semanage_store.c | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/src/semanage_store.c b/src/semanage_store.c
14index 3fd4996..251a2d6 100644
15--- a/src/semanage_store.c
16+++ b/src/semanage_store.c
17@@ -580,7 +580,7 @@ int semanage_remove_directory(const char *path)
18 return -1;
19 }
20 for (i = 0; i < num_entries; i++) {
21- char s[NAME_MAX];
22+ char s[PATH_MAX];
23 struct stat buf;
24 snprintf(s, sizeof(s), "%s/%s", path, namelist[i]->d_name);
25 if (stat(s, &buf) == -1) {
26--
271.7.9.5
28
diff --git a/recipes-security/selinux/libsemanage_2.1.6.bb b/recipes-security/selinux/libsemanage_2.1.6.bb
index aa3dcd9..b808b68 100644
--- a/recipes-security/selinux/libsemanage_2.1.6.bb
+++ b/recipes-security/selinux/libsemanage_2.1.6.bb
@@ -4,7 +4,7 @@ It is used by checkpolicy (the policy compiler) and similar tools, as well \
4as by programs like load_policy that need to perform specific transformations \ 4as by programs like load_policy that need to perform specific transformations \
5on binary policies such as customizing policy boolean settings." 5on binary policies such as customizing policy boolean settings."
6SECTION = "base" 6SECTION = "base"
7PR = "r2" 7PR = "r3"
8LICENSE = "LGPLv2.1+" 8LICENSE = "LGPLv2.1+"
9LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" 9LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343"
10 10
@@ -16,9 +16,10 @@ SRC_URI[sha256sum] = "64e6849fe50fb463ec0ba24653a26e3452fa4aaa7d7e192213d5c5a7c5
16 16
17DEPENDS += "libsepol libselinux ustr bzip2 python bison-native flex-native" 17DEPENDS += "libsepol libselinux ustr bzip2 python bison-native flex-native"
18 18
19SRC_URI += "file://Fix-segfault-for-standard-policy.patch" 19SRC_URI += "file://Fix-segfault-for-standard-policy.patch \
20SRC_URI += "file://libsemanage-Fix-execve-segfaults-on-Ubuntu.patch" 20 file://libsemanage-Fix-execve-segfaults-on-Ubuntu.patch \
21SRC_URI += "file://libsemanage-semanage.conf-for-cross-compile.patch" 21 file://libsemanage-semanage.conf-for-cross-compile.patch \
22 file://libsemanage-fix-path-len-limit.patch"
22 23
23PACKAGES += "${PN}-python" 24PACKAGES += "${PN}-python"
24FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*" 25FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
diff --git a/recipes-security/selinux/libsemanage_git.bb b/recipes-security/selinux/libsemanage_git.bb
index 776a54b..71cb1ab 100644
--- a/recipes-security/selinux/libsemanage_git.bb
+++ b/recipes-security/selinux/libsemanage_git.bb
@@ -4,7 +4,7 @@ It is used by checkpolicy (the policy compiler) and similar tools, as well \
4as by programs like load_policy that need to perform specific transformations \ 4as by programs like load_policy that need to perform specific transformations \
5on binary policies such as customizing policy boolean settings." 5on binary policies such as customizing policy boolean settings."
6SECTION = "base" 6SECTION = "base"
7PR = "r2" 7PR = "r3"
8LICENSE = "LGPLv2.1+" 8LICENSE = "LGPLv2.1+"
9LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" 9LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343"
10DEFAULT_PREFERENCE = "-1" 10DEFAULT_PREFERENCE = "-1"
@@ -17,9 +17,10 @@ PV = "2.1.6+git${SRCPV}"
17 17
18DEPENDS += "libsepol libselinux ustr bzip2 python bison-native flex-native" 18DEPENDS += "libsepol libselinux ustr bzip2 python bison-native flex-native"
19 19
20SRC_URI += "file://Fix-segfault-for-standard-policy.patch" 20SRC_URI += "file://Fix-segfault-for-standard-policy.patch \
21SRC_URI += "file://libsemanage-Fix-execve-segfaults-on-Ubuntu.patch" 21 file://libsemanage-Fix-execve-segfaults-on-Ubuntu.patch \
22SRC_URI += "file://libsemanage-semanage.conf-for-cross-compile.patch" 22 file://libsemanage-semanage.conf-for-cross-compile.patch \
23 file://libsemanage-fix-path-len-limit.patch"
23 24
24PACKAGES += "${PN}-python" 25PACKAGES += "${PN}-python"
25FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*" 26FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"