diff options
author | Xin Ouyang <Xin.Ouyang@windriver.com> | 2013-01-19 16:07:58 +0800 |
---|---|---|
committer | Xin Ouyang <Xin.Ouyang@windriver.com> | 2013-01-19 16:34:17 +0800 |
commit | 393e22b3c923f69e893bb02b117b83862eebe689 (patch) | |
tree | 04ee808c469478413ddb327422b49f2021542dbd | |
parent | becdc022eb5640e5b942b7680e5328ebeee5111a (diff) | |
download | meta-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.patch | 68 | ||||
-rw-r--r-- | recipes-extended/sed/sed_4.2.2.bbappend | 10 |
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 @@ | |||
1 | Subject: [PATCH] sed: enable selinux only when incs and libs exist. | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-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 | |||
11 | diff --git a/m4/selinux-selinux-h.m4 b/m4/selinux-selinux-h.m4 | ||
12 | index 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; | ||
26 | diff --git a/sed/execute.c b/sed/execute.c | ||
27 | index 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 | -- | ||
67 | 1.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 @@ | |||
1 | PR .= ".2" | 1 | PR .= ".3" |
2 | 2 | ||
3 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" | 3 | inherit with-selinux |
4 | |||
5 | SRC_URI += "file://sed-selinux-fix.patch" | ||
6 | |||
7 | inherit selinux | ||
8 | |||
9 | DEPENDS += "${LIBSELINUX}" | ||