diff options
| author | Yi Zhao <yi.zhao@windriver.com> | 2021-08-05 10:43:15 +0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2021-08-06 20:38:40 -0700 |
| commit | 7fa86c0cb9af5635a2087befe8a0125dae038704 (patch) | |
| tree | 5ebddc5abbf5b3278f75d77316c224204e1c59a3 | |
| parent | da798f15ffd93759e1ba3f21bd1ba80c73e962af (diff) | |
| download | meta-openembedded-7fa86c0cb9af5635a2087befe8a0125dae038704.tar.gz | |
audit: fix compile error for 2.8.5
* Backport a patch to fix the compile error
* Refresh the patches to fix the patch-fuzz warning.
* Minor tweaks to the recipe with reference to the 3.0 bb file.
Fixes:
tmp/work/core2-64-poky-linux/audit/2.8.5-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/11.1.1/ld:
ausearch-checkpt.o:/usr/src/debug/audit/2.8.5-r0/build/src/../../git/src/ausearch-common.h:53: multiple definition of `event_node_list';
ausearch.o:/usr/src/debug/audit/2.8.5-r0/build/src/../../git/src/ausearch-common.h:53: first defined here
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-security/audit/audit/0001-Add-substitue-functions-for-strndupa-rawmemchr.patch (renamed from meta-oe/recipes-security/audit/audit/Add-substitue-functions-for-strndupa-rawmemchr.patch) | 6 | ||||
| -rw-r--r-- | meta-oe/recipes-security/audit/audit/0002-Fixed-swig-host-contamination-issue.patch | 57 | ||||
| -rw-r--r-- | meta-oe/recipes-security/audit/audit/0003-Header-definitions-need-to-be-external-when-building.patch | 30 | ||||
| -rw-r--r-- | meta-oe/recipes-security/audit/audit_2.8.5.bb | 36 |
4 files changed, 110 insertions, 19 deletions
diff --git a/meta-oe/recipes-security/audit/audit/Add-substitue-functions-for-strndupa-rawmemchr.patch b/meta-oe/recipes-security/audit/audit/0001-Add-substitue-functions-for-strndupa-rawmemchr.patch index bb6c61e805..ed1c0e2b57 100644 --- a/meta-oe/recipes-security/audit/audit/Add-substitue-functions-for-strndupa-rawmemchr.patch +++ b/meta-oe/recipes-security/audit/audit/0001-Add-substitue-functions-for-strndupa-rawmemchr.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From bdcdc3dff4469aac88e718bd15958d5ed4b9392a Mon Sep 17 00:00:00 2001 | 1 | From d5a4b800a696b8b8d2c0f0bad098b1a8ff94333f Mon Sep 17 00:00:00 2001 |
| 2 | From: Steve Grubb <sgrubb@redhat.com> | 2 | From: Steve Grubb <sgrubb@redhat.com> |
| 3 | Date: Tue, 26 Feb 2019 18:33:33 -0500 | 3 | Date: Tue, 26 Feb 2019 18:33:33 -0500 |
| 4 | Subject: [PATCH] Add substitue functions for strndupa & rawmemchr | 4 | Subject: [PATCH] Add substitue functions for strndupa & rawmemchr |
| @@ -68,7 +68,7 @@ index 51c4a5e..67b7b77 100644 | |||
| 68 | break; | 68 | break; |
| 69 | *ptr = ' '; | 69 | *ptr = ' '; |
| 70 | diff --git a/configure.ac b/configure.ac | 70 | diff --git a/configure.ac b/configure.ac |
| 71 | index 54bdbf1..aef07fb 100644 | 71 | index 6e345f1..6f3007e 100644 |
| 72 | --- a/configure.ac | 72 | --- a/configure.ac |
| 73 | +++ b/configure.ac | 73 | +++ b/configure.ac |
| 74 | @@ -1,7 +1,7 @@ | 74 | @@ -1,7 +1,7 @@ |
| @@ -129,5 +129,5 @@ index 5d17a72..758c33e 100644 | |||
| 129 | * This function will look at the line and pick out pieces of it. | 129 | * This function will look at the line and pick out pieces of it. |
| 130 | */ | 130 | */ |
| 131 | -- | 131 | -- |
| 132 | 2.7.4 | 132 | 2.17.1 |
| 133 | 133 | ||
diff --git a/meta-oe/recipes-security/audit/audit/0002-Fixed-swig-host-contamination-issue.patch b/meta-oe/recipes-security/audit/audit/0002-Fixed-swig-host-contamination-issue.patch new file mode 100644 index 0000000000..4a1b979975 --- /dev/null +++ b/meta-oe/recipes-security/audit/audit/0002-Fixed-swig-host-contamination-issue.patch | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | From 3467abce1f3cfc96f9bdace7c09d95218cbcaeb1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Li xin <lixin.fnst@cn.fujitsu.com> | ||
| 3 | Date: Sun, 19 Jul 2015 02:42:58 +0900 | ||
| 4 | Subject: [PATCH] audit: Fixed swig host contamination issue | ||
| 5 | |||
| 6 | The audit build uses swig to generate a python wrapper. | ||
| 7 | Unfortunately, the swig info file references host include | ||
| 8 | directories. Some of these were previously noticed and | ||
| 9 | eliminated, but the one fixed here was not. | ||
| 10 | |||
| 11 | Upstream-Status: Inappropriate [embedded specific] | ||
| 12 | |||
| 13 | Signed-off-by: Anders Hedlund <anders.hedlund@windriver.com> | ||
| 14 | Signed-off-by: Joe Slater <jslater@windriver.com> | ||
| 15 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
| 16 | --- | ||
| 17 | bindings/swig/python3/Makefile.am | 3 ++- | ||
| 18 | bindings/swig/src/auditswig.i | 2 +- | ||
| 19 | 2 files changed, 3 insertions(+), 2 deletions(-) | ||
| 20 | |||
| 21 | diff --git a/bindings/swig/python3/Makefile.am b/bindings/swig/python3/Makefile.am | ||
| 22 | index 9938418..fa46aac 100644 | ||
| 23 | --- a/bindings/swig/python3/Makefile.am | ||
| 24 | +++ b/bindings/swig/python3/Makefile.am | ||
| 25 | @@ -22,6 +22,7 @@ | ||
| 26 | CONFIG_CLEAN_FILES = *.loT *.rej *.orig | ||
| 27 | AM_CFLAGS = -fPIC -DPIC -fno-strict-aliasing $(PYTHON3_CFLAGS) | ||
| 28 | AM_CPPFLAGS = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) | ||
| 29 | +STDINC ?= /usr/include | ||
| 30 | LIBS = $(top_builddir)/lib/libaudit.la | ||
| 31 | SWIG_FLAGS = -python -py3 -modern | ||
| 32 | SWIG_INCLUDES = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) | ||
| 33 | @@ -37,7 +38,7 @@ _audit_la_DEPENDENCIES =${top_srcdir}/lib/libaudit.h ${top_builddir}/lib/libaudi | ||
| 34 | _audit_la_LIBADD = ${top_builddir}/lib/libaudit.la | ||
| 35 | nodist__audit_la_SOURCES = audit_wrap.c | ||
| 36 | audit.py audit_wrap.c: ${srcdir}/../src/auditswig.i | ||
| 37 | - swig -o audit_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} ${srcdir}/../src/auditswig.i | ||
| 38 | + swig -o audit_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} -I$(STDINC) ${srcdir}/../src/auditswig.i | ||
| 39 | |||
| 40 | CLEANFILES = audit.py* audit_wrap.c *~ | ||
| 41 | |||
| 42 | diff --git a/bindings/swig/src/auditswig.i b/bindings/swig/src/auditswig.i | ||
| 43 | index 7ebb373..424fb68 100644 | ||
| 44 | --- a/bindings/swig/src/auditswig.i | ||
| 45 | +++ b/bindings/swig/src/auditswig.i | ||
| 46 | @@ -39,7 +39,7 @@ signed | ||
| 47 | #define __attribute(X) /*nothing*/ | ||
| 48 | typedef unsigned __u32; | ||
| 49 | typedef unsigned uid_t; | ||
| 50 | -%include "/usr/include/linux/audit.h" | ||
| 51 | +%include "linux/audit.h" | ||
| 52 | #define __extension__ /*nothing*/ | ||
| 53 | #include <stdint.h> | ||
| 54 | %include "../lib/libaudit.h" | ||
| 55 | -- | ||
| 56 | 2.17.1 | ||
| 57 | |||
diff --git a/meta-oe/recipes-security/audit/audit/0003-Header-definitions-need-to-be-external-when-building.patch b/meta-oe/recipes-security/audit/audit/0003-Header-definitions-need-to-be-external-when-building.patch new file mode 100644 index 0000000000..f209e560bd --- /dev/null +++ b/meta-oe/recipes-security/audit/audit/0003-Header-definitions-need-to-be-external-when-building.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | From 2938f46d318df4a09565db837b60bafd0300f858 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Steve Grubb <sgrubb@redhat.com> | ||
| 3 | Date: Fri, 10 Jan 2020 21:13:50 -0500 | ||
| 4 | Subject: [PATCH] Header definitions need to be external when building with | ||
| 5 | -fno-common (which is default in GCC 10) - Tony Jones | ||
| 6 | |||
| 7 | Upstream-Status: Backport | ||
| 8 | [https://github.com/linux-audit/audit-userspace/commit/017e6c6ab95df55f34e339d2139def83e5dada1f] | ||
| 9 | |||
| 10 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 11 | --- | ||
| 12 | src/ausearch-common.h | 2 +- | ||
| 13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/src/ausearch-common.h b/src/ausearch-common.h | ||
| 16 | index 6669203..3040547 100644 | ||
| 17 | --- a/src/ausearch-common.h | ||
| 18 | +++ b/src/ausearch-common.h | ||
| 19 | @@ -50,7 +50,7 @@ extern pid_t event_pid; | ||
| 20 | extern int event_exact_match; | ||
| 21 | extern uid_t event_uid, event_euid, event_loginuid; | ||
| 22 | extern const char *event_tuid, *event_teuid, *event_tauid; | ||
| 23 | -slist *event_node_list; | ||
| 24 | +extern slist *event_node_list; | ||
| 25 | extern const char *event_comm; | ||
| 26 | extern const char *event_filename; | ||
| 27 | extern const char *event_hostname; | ||
| 28 | -- | ||
| 29 | 2.17.1 | ||
| 30 | |||
diff --git a/meta-oe/recipes-security/audit/audit_2.8.5.bb b/meta-oe/recipes-security/audit/audit_2.8.5.bb index 11ec9e9fc4..10c1afbb8b 100644 --- a/meta-oe/recipes-security/audit/audit_2.8.5.bb +++ b/meta-oe/recipes-security/audit/audit_2.8.5.bb | |||
| @@ -8,8 +8,9 @@ LICENSE = "GPLv2+ & LGPLv2+" | |||
| 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" |
| 9 | 9 | ||
| 10 | SRC_URI = "git://github.com/linux-audit/${BPN}-userspace.git;branch=2.8_maintenance \ | 10 | SRC_URI = "git://github.com/linux-audit/${BPN}-userspace.git;branch=2.8_maintenance \ |
| 11 | file://Add-substitue-functions-for-strndupa-rawmemchr.patch \ | 11 | file://0001-Add-substitue-functions-for-strndupa-rawmemchr.patch \ |
| 12 | file://Fixed-swig-host-contamination-issue.patch \ | 12 | file://0002-Fixed-swig-host-contamination-issue.patch \ |
| 13 | file://0003-Header-definitions-need-to-be-external-when-building.patch \ | ||
| 13 | file://auditd \ | 14 | file://auditd \ |
| 14 | file://auditd.service \ | 15 | file://auditd.service \ |
| 15 | file://audit-volatile.conf \ | 16 | file://audit-volatile.conf \ |
| @@ -27,9 +28,9 @@ INITSCRIPT_PARAMS = "defaults" | |||
| 27 | SYSTEMD_PACKAGES = "auditd" | 28 | SYSTEMD_PACKAGES = "auditd" |
| 28 | SYSTEMD_SERVICE:auditd = "auditd.service" | 29 | SYSTEMD_SERVICE:auditd = "auditd.service" |
| 29 | 30 | ||
| 30 | DEPENDS += "python3 tcp-wrappers libcap-ng linux-libc-headers swig-native" | 31 | DEPENDS = "python3 tcp-wrappers libcap-ng linux-libc-headers swig-native" |
| 31 | 32 | ||
| 32 | EXTRA_OECONF += "--without-prelude \ | 33 | EXTRA_OECONF = "--without-prelude \ |
| 33 | --with-libwrap \ | 34 | --with-libwrap \ |
| 34 | --enable-gssapi-krb5=no \ | 35 | --enable-gssapi-krb5=no \ |
| 35 | --with-libcap-ng=yes \ | 36 | --with-libcap-ng=yes \ |
| @@ -39,11 +40,11 @@ EXTRA_OECONF += "--without-prelude \ | |||
| 39 | --without-python \ | 40 | --without-python \ |
| 40 | --without-golang \ | 41 | --without-golang \ |
| 41 | --disable-zos-remote \ | 42 | --disable-zos-remote \ |
| 43 | --with-arm=yes \ | ||
| 44 | --with-aarch64=yes \ | ||
| 42 | " | 45 | " |
| 43 | EXTRA_OECONF:append:arm = " --with-arm=yes" | ||
| 44 | EXTRA_OECONF:append:aarch64 = " --with-aarch64=yes" | ||
| 45 | 46 | ||
| 46 | EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}' \ | 47 | EXTRA_OEMAKE = "PYLIBVER='python${PYTHON_BASEVERSION}' \ |
| 47 | PYINC='${STAGING_INCDIR}/$(PYLIBVER)' \ | 48 | PYINC='${STAGING_INCDIR}/$(PYLIBVER)' \ |
| 48 | pyexecdir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \ | 49 | pyexecdir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \ |
| 49 | STDINC='${STAGING_INCDIR}' \ | 50 | STDINC='${STAGING_INCDIR}' \ |
| @@ -60,16 +61,16 @@ PACKAGES =+ "audispd-plugins" | |||
| 60 | PACKAGES += "auditd ${PN}-python" | 61 | PACKAGES += "auditd ${PN}-python" |
| 61 | 62 | ||
| 62 | FILES:${PN} = "${sysconfdir}/libaudit.conf ${base_libdir}/libaudit.so.1* ${base_libdir}/libauparse.so.*" | 63 | FILES:${PN} = "${sysconfdir}/libaudit.conf ${base_libdir}/libaudit.so.1* ${base_libdir}/libauparse.so.*" |
| 63 | FILES:auditd += "${bindir}/* ${base_sbindir}/* ${sysconfdir}/*" | 64 | FILES:auditd = "${bindir}/* ${base_sbindir}/* ${sysconfdir}/*" |
| 64 | FILES:audispd-plugins += "${sysconfdir}/audisp/audisp-remote.conf \ | 65 | FILES:audispd-plugins = "${sysconfdir}/audisp/audisp-remote.conf \ |
| 65 | ${sysconfdir}/audisp/plugins.d/au-remote.conf \ | 66 | ${sysconfdir}/audisp/plugins.d/au-remote.conf \ |
| 66 | ${sbindir}/audisp-remote ${localstatedir}/spool/audit \ | 67 | ${base_sbindir}/audisp-remote ${localstatedir}/spool/audit \ |
| 67 | " | 68 | " |
| 68 | FILES:${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug" | 69 | FILES:${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug" |
| 69 | FILES:${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}" | 70 | FILES:${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}" |
| 70 | 71 | ||
| 71 | CONFFILES:auditd += "${sysconfdir}/audit/audit.rules" | 72 | CONFFILES:auditd = "${sysconfdir}/audit/audit.rules" |
| 72 | RDEPENDS:auditd += "bash" | 73 | RDEPENDS:auditd = "bash" |
| 73 | 74 | ||
| 74 | do_install:append() { | 75 | do_install:append() { |
| 75 | rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a | 76 | rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a |
| @@ -85,14 +86,14 @@ do_install:append() { | |||
| 85 | rm -rf ${D}/etc/rc.d | 86 | rm -rf ${D}/etc/rc.d |
| 86 | 87 | ||
| 87 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | 88 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 89 | # install systemd unit files | ||
| 90 | install -d ${D}${systemd_unitdir}/system | ||
| 91 | install -m 0644 ${WORKDIR}/auditd.service ${D}${systemd_unitdir}/system | ||
| 92 | |||
| 88 | install -d ${D}${sysconfdir}/tmpfiles.d/ | 93 | install -d ${D}${sysconfdir}/tmpfiles.d/ |
| 89 | install -m 0644 ${WORKDIR}/audit-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ | 94 | install -m 0644 ${WORKDIR}/audit-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ |
| 90 | fi | 95 | fi |
| 91 | 96 | ||
| 92 | # install systemd unit files | ||
| 93 | install -d ${D}${systemd_unitdir}/system | ||
| 94 | install -m 0644 ${WORKDIR}/auditd.service ${D}${systemd_unitdir}/system | ||
| 95 | |||
| 96 | # audit-2.5 doesn't install any rules by default, so we do that here | 97 | # audit-2.5 doesn't install any rules by default, so we do that here |
| 97 | mkdir -p ${D}/etc/audit ${D}/etc/audit/rules.d | 98 | mkdir -p ${D}/etc/audit ${D}/etc/audit/rules.d |
| 98 | cp ${S}/rules/10-base-config.rules ${D}/etc/audit/rules.d/audit.rules | 99 | cp ${S}/rules/10-base-config.rules ${D}/etc/audit/rules.d/audit.rules |
| @@ -102,4 +103,7 @@ do_install:append() { | |||
| 102 | 103 | ||
| 103 | # Based on the audit.spec "Copy default rules into place on new installation" | 104 | # Based on the audit.spec "Copy default rules into place on new installation" |
| 104 | cp ${D}/etc/audit/rules.d/audit.rules ${D}/etc/audit/audit.rules | 105 | cp ${D}/etc/audit/rules.d/audit.rules ${D}/etc/audit/audit.rules |
| 106 | |||
| 107 | # Create /var/spool/audit directory for audisp-remote | ||
| 108 | install -m 0700 -d ${D}${localstatedir}/spool/audit | ||
| 105 | } | 109 | } |
