diff options
author | Xin Ouyang <Xin.Ouyang@windriver.com> | 2012-07-23 12:49:12 +0800 |
---|---|---|
committer | Xin Ouyang <Xin.Ouyang@windriver.com> | 2012-07-23 12:50:25 +0800 |
commit | a95119dbecf190d275e021bdff7ff89e08c5f104 (patch) | |
tree | 5fead1b14730564f449234a8389f7ca064d0c1b5 | |
parent | 3467300a26ec1e9ae7aa40485063c4973a638fb4 (diff) | |
download | meta-selinux-a95119dbecf190d275e021bdff7ff89e08c5f104.tar.gz |
policycoreutils: remove format-security from CFLAGS.
Remove -Wno-error=format-security from CFLAGS. and add a patch
so we can build policycoreutils if -Werror=format-security
enabled.
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
3 files changed, 35 insertions, 2 deletions
diff --git a/recipes-security/selinux/policycoreutils/policycoreutils-fix-format-security.patch b/recipes-security/selinux/policycoreutils/policycoreutils-fix-format-security.patch new file mode 100644 index 0000000..4c1d972 --- /dev/null +++ b/recipes-security/selinux/policycoreutils/policycoreutils-fix-format-security.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 11686426e6148dd55c250570f3d537a3b2c2724d Mon Sep 17 00:00:00 2001 | ||
2 | From: Xin Ouyang <Xin.Ouyang@windriver.com> | ||
3 | Date: Mon, 23 Jul 2012 11:22:56 +0800 | ||
4 | Subject: [PATCH] policycoreutils: fix format-security build error. | ||
5 | |||
6 | With this fix, we can build policycoreutils with | ||
7 | -Werror=format-security enabled. | ||
8 | |||
9 | Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com> | ||
10 | --- | ||
11 | sandbox/seunshare.c | 4 ++-- | ||
12 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/sandbox/seunshare.c b/sandbox/seunshare.c | ||
15 | index c493e98..d7eb0b9 100644 | ||
16 | --- a/sandbox/seunshare.c | ||
17 | +++ b/sandbox/seunshare.c | ||
18 | @@ -311,8 +311,8 @@ static int seunshare_mount(const char *src, const char *dst, struct stat *src_st | ||
19 | */ | ||
20 | static int sandbox_error(const char *string) | ||
21 | { | ||
22 | - fprintf(stderr, string); | ||
23 | - syslog(LOG_AUTHPRIV | LOG_ALERT, string); | ||
24 | + fprintf(stderr, "%s", string); | ||
25 | + syslog(LOG_AUTHPRIV | LOG_ALERT, "%s", string); | ||
26 | exit(-1); | ||
27 | } | ||
28 | |||
29 | -- | ||
30 | 1.7.5.4 | ||
31 | |||
diff --git a/recipes-security/selinux/policycoreutils_2.1.10.bb b/recipes-security/selinux/policycoreutils_2.1.10.bb index 32218c6..80c79f2 100644 --- a/recipes-security/selinux/policycoreutils_2.1.10.bb +++ b/recipes-security/selinux/policycoreutils_2.1.10.bb | |||
@@ -14,6 +14,8 @@ include selinux_20120216.inc | |||
14 | SRC_URI[md5sum] = "fefdede2815cdd2ba8b68599fef1f257" | 14 | SRC_URI[md5sum] = "fefdede2815cdd2ba8b68599fef1f257" |
15 | SRC_URI[sha256sum] = "8bbbc36b7d375edff891503932da93e37553f0dd7bdceded7ce9a45c80bec3d1" | 15 | SRC_URI[sha256sum] = "8bbbc36b7d375edff891503932da93e37553f0dd7bdceded7ce9a45c80bec3d1" |
16 | 16 | ||
17 | SRC_URI += "file://policycoreutils-fix-format-security.patch" | ||
18 | |||
17 | DEPENDS += "libsepol libselinux libsemanage ${EXTRA_DEPENDS}" | 19 | DEPENDS += "libsepol libselinux libsemanage ${EXTRA_DEPENDS}" |
18 | EXTRA_DEPENDS = "libcap-ng libcgroup" | 20 | EXTRA_DEPENDS = "libcap-ng libcgroup" |
19 | EXTRA_DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam audit', '', d)}" | 21 | EXTRA_DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam audit', '', d)}" |
@@ -43,7 +45,6 @@ FILES_${PN}-sandbox = "${datadir}/sandbox/*" | |||
43 | FILES_${PN}-sandbox += "${bindir}/sandbox" | 45 | FILES_${PN}-sandbox += "${bindir}/sandbox" |
44 | FILES_${PN}-sandbox += "${sbindir}/seunshare" | 46 | FILES_${PN}-sandbox += "${sbindir}/seunshare" |
45 | 47 | ||
46 | CFLAGS_append = " -Wno-error=format-security" | ||
47 | AUDITH="`ls ${STAGING_INCDIR}/libaudit.h >/dev/null 2>&1 && echo /usr/include/libaudit.h `" | 48 | AUDITH="`ls ${STAGING_INCDIR}/libaudit.h >/dev/null 2>&1 && echo /usr/include/libaudit.h `" |
48 | PAMH="`ls ${STAGING_INCDIR}/security/pam_appl.h >/dev/null 2>&1 && echo /usr/include/security/pam_appl.h `" | 49 | PAMH="`ls ${STAGING_INCDIR}/security/pam_appl.h >/dev/null 2>&1 && echo /usr/include/security/pam_appl.h `" |
49 | EXTRA_OEMAKE += "PAMH=${PAMH} AUDITH=${AUDITH} INOTIFYH=n" | 50 | EXTRA_OEMAKE += "PAMH=${PAMH} AUDITH=${AUDITH} INOTIFYH=n" |
diff --git a/recipes-security/selinux/policycoreutils_git.bb b/recipes-security/selinux/policycoreutils_git.bb index 6555e11..d9c4608 100644 --- a/recipes-security/selinux/policycoreutils_git.bb +++ b/recipes-security/selinux/policycoreutils_git.bb | |||
@@ -15,6 +15,8 @@ include selinux_git.inc | |||
15 | SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" | 15 | SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" |
16 | PV = "2.1.10+git${SRCPV}" | 16 | PV = "2.1.10+git${SRCPV}" |
17 | 17 | ||
18 | SRC_URI += "file://policycoreutils-fix-format-security.patch" | ||
19 | |||
18 | DEPENDS += "libsepol libselinux libsemanage ${EXTRA_DEPENDS}" | 20 | DEPENDS += "libsepol libselinux libsemanage ${EXTRA_DEPENDS}" |
19 | EXTRA_DEPENDS = "libcap-ng libcgroup" | 21 | EXTRA_DEPENDS = "libcap-ng libcgroup" |
20 | EXTRA_DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam audit', '', d)}" | 22 | EXTRA_DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam audit', '', d)}" |
@@ -44,7 +46,6 @@ FILES_${PN}-sandbox = "${datadir}/sandbox/*" | |||
44 | FILES_${PN}-sandbox += "${bindir}/sandbox" | 46 | FILES_${PN}-sandbox += "${bindir}/sandbox" |
45 | FILES_${PN}-sandbox += "${sbindir}/seunshare" | 47 | FILES_${PN}-sandbox += "${sbindir}/seunshare" |
46 | 48 | ||
47 | CFLAGS_append = " -Wno-error=format-security" | ||
48 | AUDITH="`ls ${STAGING_INCDIR}/libaudit.h >/dev/null 2>&1 && echo /usr/include/libaudit.h `" | 49 | AUDITH="`ls ${STAGING_INCDIR}/libaudit.h >/dev/null 2>&1 && echo /usr/include/libaudit.h `" |
49 | PAMH="`ls ${STAGING_INCDIR}/security/pam_appl.h >/dev/null 2>&1 && echo /usr/include/security/pam_appl.h `" | 50 | PAMH="`ls ${STAGING_INCDIR}/security/pam_appl.h >/dev/null 2>&1 && echo /usr/include/security/pam_appl.h `" |
50 | EXTRA_OEMAKE += "PAMH=${PAMH} AUDITH=${AUDITH} INOTIFYH=n" | 51 | EXTRA_OEMAKE += "PAMH=${PAMH} AUDITH=${AUDITH} INOTIFYH=n" |