summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin Ouyang <Xin.Ouyang@windriver.com>2013-01-19 16:07:58 +0800
committerXin Ouyang <Xin.Ouyang@windriver.com>2013-01-19 16:34:17 +0800
commit393e22b3c923f69e893bb02b117b83862eebe689 (patch)
tree04ee808c469478413ddb327422b49f2021542dbd
parentbecdc022eb5640e5b942b7680e5328ebeee5111a (diff)
downloadmeta-selinux-393e22b3c923f69e893bb02b117b83862eebe689.tar.gz
sed: inherit with-selinux for new version
sed-4.2.2 now has new configure option --with-selinux, so inherit with-selinux bbclass. Also, remove the patch since new version fix the issue. Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
-rw-r--r--recipes-extended/sed/sed-4.2.2/sed-selinux-fix.patch68
-rw-r--r--recipes-extended/sed/sed_4.2.2.bbappend10
2 files changed, 2 insertions, 76 deletions
diff --git a/recipes-extended/sed/sed-4.2.2/sed-selinux-fix.patch b/recipes-extended/sed/sed-4.2.2/sed-selinux-fix.patch
deleted file mode 100644
index 9b9fcb7..0000000
--- a/recipes-extended/sed/sed-4.2.2/sed-selinux-fix.patch
+++ /dev/null
@@ -1,68 +0,0 @@
1Subject: [PATCH] sed: enable selinux only when incs and libs exist.
2
3Upstream-Status: Pending
4
5Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
6---
7 m4/selinux-selinux-h.m4 | 4 ++++
8 sed/execute.c | 8 ++++----
9 2 files changed, 8 insertions(+), 4 deletions(-)
10
11diff --git a/m4/selinux-selinux-h.m4 b/m4/selinux-selinux-h.m4
12index 20dc77c..542b4e6 100644
13--- a/m4/selinux-selinux-h.m4
14+++ b/m4/selinux-selinux-h.m4
15@@ -34,6 +34,10 @@ AC_DEFUN([gl_LIBSELINUX],
16 [test "$ac_cv_search_setfilecon" = "none required" ||
17 LIB_SELINUX=$ac_cv_search_setfilecon])
18 AC_SUBST([LIB_SELINUX])
19+ if test "$ac_cv_search_setfilecon" != no &&
20+ test "$ac_cv_header_selinux_selinux_h" != no ; then
21+ AC_DEFINE(HAVE_LIBSELINUX, 1, [libselinux enabled])
22+ fi
23 LIBS=$gl_save_LIBS
24
25 # Warn if SELinux is found but libselinux is absent;
26diff --git a/sed/execute.c b/sed/execute.c
27index 6fbfff6..7e55e18 100644
28--- a/sed/execute.c
29+++ b/sed/execute.c
30@@ -31,7 +31,7 @@
31 extern int errno;
32 #endif
33
34-#ifndef BOOTSTRAP
35+#ifdef HAVE_LIBSELINUX
36 #include <selinux/selinux.h>
37 #include <selinux/context.h>
38 #endif
39@@ -718,7 +718,7 @@ open_next_file(name, input)
40 {
41 int input_fd;
42 char *tmpdir, *p;
43-#ifndef BOOTSTRAP
44+#ifdef HAVE_LIBSELINUX
45 security_context_t old_fscreatecon;
46 int reset_fscreatecon = 0;
47 memset (&old_fscreatecon, 0, sizeof (old_fscreatecon));
48@@ -744,7 +744,7 @@ open_next_file(name, input)
49 if (!S_ISREG (input->st.st_mode))
50 panic(_("couldn't edit %s: not a regular file"), input->in_file_name);
51
52-#ifndef BOOTSTRAP
53+#ifdef HAVE_LIBSELINUX
54 if (is_selinux_enabled ())
55 {
56 security_context_t con;
57@@ -771,7 +771,7 @@ open_next_file(name, input)
58 output_file.missing_newline = false;
59 free (tmpdir);
60
61-#ifndef BOOTSTRAP
62+#ifdef HAVE_LIBSELINUX
63 if (reset_fscreatecon)
64 {
65 setfscreatecon (old_fscreatecon);
66--
671.7.9.5
68
diff --git a/recipes-extended/sed/sed_4.2.2.bbappend b/recipes-extended/sed/sed_4.2.2.bbappend
index 0607d44..7695b77 100644
--- a/recipes-extended/sed/sed_4.2.2.bbappend
+++ b/recipes-extended/sed/sed_4.2.2.bbappend
@@ -1,9 +1,3 @@
1PR .= ".2" 1PR .= ".3"
2 2
3FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" 3inherit with-selinux
4
5SRC_URI += "file://sed-selinux-fix.patch"
6
7inherit selinux
8
9DEPENDS += "${LIBSELINUX}"