diff options
| author | Xin Ouyang <Xin.Ouyang@windriver.com> | 2012-12-19 18:57:57 +0800 |
|---|---|---|
| committer | Xin Ouyang <Xin.Ouyang@windriver.com> | 2012-12-20 09:53:04 +0800 |
| commit | e4415049dbc4ea36877c97f662c52dcc2e45d872 (patch) | |
| tree | 915a51b0d6d0ec6e5acd86a8bda5a4fcc3e91af5 /recipes-extended | |
| parent | 2f6f6d668bd683085c50ee9ec55ff6dabe73125c (diff) | |
| download | meta-selinux-e4415049dbc4ea36877c97f662c52dcc2e45d872.tar.gz | |
sed: fix parallel compile error with libselinux
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
Diffstat (limited to 'recipes-extended')
| -rw-r--r-- | recipes-extended/sed/sed-4.2.1/sed-selinux-fix.patch | 68 | ||||
| -rw-r--r-- | recipes-extended/sed/sed_4.2.1.bbappend | 7 |
2 files changed, 75 insertions, 0 deletions
diff --git a/recipes-extended/sed/sed-4.2.1/sed-selinux-fix.patch b/recipes-extended/sed/sed-4.2.1/sed-selinux-fix.patch new file mode 100644 index 0000000..9b9fcb7 --- /dev/null +++ b/recipes-extended/sed/sed-4.2.1/sed-selinux-fix.patch | |||
| @@ -0,0 +1,68 @@ | |||
| 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.1.bbappend b/recipes-extended/sed/sed_4.2.1.bbappend new file mode 100644 index 0000000..52243c2 --- /dev/null +++ b/recipes-extended/sed/sed_4.2.1.bbappend | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | PR .= ".1" | ||
| 2 | |||
| 3 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" | ||
| 4 | |||
| 5 | SRC_URI += "file://sed-selinux-fix.patch" | ||
| 6 | |||
| 7 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'selinux', 'libselinux', '', d)}" | ||
