diff options
author | Xin Ouyang <Xin.Ouyang@windriver.com> | 2012-12-25 11:16:13 +0800 |
---|---|---|
committer | Xin Ouyang <Xin.Ouyang@windriver.com> | 2012-12-25 13:53:41 +0800 |
commit | 2e5fd8c5f2b39c3016dc99aef66b1f1fa592a2d6 (patch) | |
tree | ecb7ddedd52ae5980fdb21f0d58e12db4694f540 | |
parent | 43d72a26eb8cf4b57247b44869bdcb9633a63e54 (diff) | |
download | meta-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.patch | 28 | ||||
-rw-r--r-- | recipes-security/selinux/libsemanage_2.1.6.bb | 9 | ||||
-rw-r--r-- | recipes-security/selinux/libsemanage_git.bb | 9 |
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 @@ | |||
1 | Subject: [PATCH] libsemanage: fix path length limit | ||
2 | |||
3 | semanage_remove_directory uses NAME_MAX(255) as the max length of | ||
4 | file pathes, this will cause failures when the path length>255. | ||
5 | |||
6 | Upstream-Status: pending | ||
7 | |||
8 | Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com> | ||
9 | --- | ||
10 | src/semanage_store.c | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/src/semanage_store.c b/src/semanage_store.c | ||
14 | index 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 | -- | ||
27 | 1.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 \ | |||
4 | as by programs like load_policy that need to perform specific transformations \ | 4 | as by programs like load_policy that need to perform specific transformations \ |
5 | on binary policies such as customizing policy boolean settings." | 5 | on binary policies such as customizing policy boolean settings." |
6 | SECTION = "base" | 6 | SECTION = "base" |
7 | PR = "r2" | 7 | PR = "r3" |
8 | LICENSE = "LGPLv2.1+" | 8 | LICENSE = "LGPLv2.1+" |
9 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" | 9 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" |
10 | 10 | ||
@@ -16,9 +16,10 @@ SRC_URI[sha256sum] = "64e6849fe50fb463ec0ba24653a26e3452fa4aaa7d7e192213d5c5a7c5 | |||
16 | 16 | ||
17 | DEPENDS += "libsepol libselinux ustr bzip2 python bison-native flex-native" | 17 | DEPENDS += "libsepol libselinux ustr bzip2 python bison-native flex-native" |
18 | 18 | ||
19 | SRC_URI += "file://Fix-segfault-for-standard-policy.patch" | 19 | SRC_URI += "file://Fix-segfault-for-standard-policy.patch \ |
20 | SRC_URI += "file://libsemanage-Fix-execve-segfaults-on-Ubuntu.patch" | 20 | file://libsemanage-Fix-execve-segfaults-on-Ubuntu.patch \ |
21 | SRC_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 | ||
23 | PACKAGES += "${PN}-python" | 24 | PACKAGES += "${PN}-python" |
24 | FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*" | 25 | FILES_${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 \ | |||
4 | as by programs like load_policy that need to perform specific transformations \ | 4 | as by programs like load_policy that need to perform specific transformations \ |
5 | on binary policies such as customizing policy boolean settings." | 5 | on binary policies such as customizing policy boolean settings." |
6 | SECTION = "base" | 6 | SECTION = "base" |
7 | PR = "r2" | 7 | PR = "r3" |
8 | LICENSE = "LGPLv2.1+" | 8 | LICENSE = "LGPLv2.1+" |
9 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" | 9 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" |
10 | DEFAULT_PREFERENCE = "-1" | 10 | DEFAULT_PREFERENCE = "-1" |
@@ -17,9 +17,10 @@ PV = "2.1.6+git${SRCPV}" | |||
17 | 17 | ||
18 | DEPENDS += "libsepol libselinux ustr bzip2 python bison-native flex-native" | 18 | DEPENDS += "libsepol libselinux ustr bzip2 python bison-native flex-native" |
19 | 19 | ||
20 | SRC_URI += "file://Fix-segfault-for-standard-policy.patch" | 20 | SRC_URI += "file://Fix-segfault-for-standard-policy.patch \ |
21 | SRC_URI += "file://libsemanage-Fix-execve-segfaults-on-Ubuntu.patch" | 21 | file://libsemanage-Fix-execve-segfaults-on-Ubuntu.patch \ |
22 | SRC_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 | ||
24 | PACKAGES += "${PN}-python" | 25 | PACKAGES += "${PN}-python" |
25 | FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*" | 26 | FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*" |