summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/logrotate/logrotate_3.20.1.bb
diff options
context:
space:
mode:
authorwangmy <wangmy@fujitsu.com>2022-05-30 14:40:47 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-06-11 10:06:13 +0100
commit8c9ea9f6b9cd0435e090d35cf3e9824fd2196959 (patch)
tree688873aa20741bb5c467c8f5d8b30be49585b71c /meta/recipes-extended/logrotate/logrotate_3.20.1.bb
parent42db1a907293961f4ea49bec3ca4a56c8b79341e (diff)
downloadpoky-8c9ea9f6b9cd0435e090d35cf3e9824fd2196959.tar.gz
logrotate: upgrade 3.19.0 -> 3.20.1
Changelog: ========= drop world-readable permission on state file even when ACLs are enabled (#446) fix potential DoS from unprivileged users via the state file (CVE-2022-1348) fix a misleading debug message with copytruncate and rotate 0 (#443) add support for unsigned time_t (#438) do not lock state file /dev/null (#433) (From OE-Core rev: 190457be2ee24a99da3a6383233ccc4b76dd2b0c) Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 391fdcf742c4669c1c4654f9b022b3d277aa0038) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/logrotate/logrotate_3.20.1.bb')
-rw-r--r--meta/recipes-extended/logrotate/logrotate_3.20.1.bb91
1 files changed, 91 insertions, 0 deletions
diff --git a/meta/recipes-extended/logrotate/logrotate_3.20.1.bb b/meta/recipes-extended/logrotate/logrotate_3.20.1.bb
new file mode 100644
index 0000000000..35977535aa
--- /dev/null
+++ b/meta/recipes-extended/logrotate/logrotate_3.20.1.bb
@@ -0,0 +1,91 @@
1SUMMARY = "Rotates, compresses, removes and mails system log files"
2SECTION = "console/utils"
3HOMEPAGE = "https://github.com/logrotate/logrotate/"
4DESCRIPTION = "The logrotate utility is designed to simplify the administration of log files on a system which generates a lot of log files."
5LICENSE = "GPL-2.0-only"
6
7# TODO: Document coreutils dependency. Why not RDEPENDS? Why not busybox?
8
9DEPENDS="coreutils popt"
10
11LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
12
13UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases"
14UPSTREAM_CHECK_REGEX = "logrotate-(?P<pver>\d+(\.\d+)+).tar"
15
16SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.xz"
17
18SRC_URI[sha256sum] = "742f6d6e18eceffa49a4bacd933686d3e42931cfccfb694d7f6369b704e5d094"
19
20# These CVEs are debian, gentoo or SUSE specific on the way logrotate was installed/used
21CVE_CHECK_IGNORE += "CVE-2011-1548 CVE-2011-1549 CVE-2011-1550"
22
23PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)}"
24
25PACKAGECONFIG[acl] = ",,acl"
26PACKAGECONFIG[selinux] = ",,libselinux"
27
28CONFFILES:${PN} += "${localstatedir}/lib/logrotate.status \
29 ${sysconfdir}/logrotate.conf \
30 ${sysconfdir}/logrotate.d/btmp \
31 ${sysconfdir}/logrotate.d/wtmp"
32
33# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our
34# optimization variables, so use it rather than EXTRA_CFLAGS.
35EXTRA_OEMAKE = "\
36 LFS= \
37 OS_NAME='${OS_NAME}' \
38 'CC=${CC}' \
39 'RPM_OPT_FLAGS=${CFLAGS}' \
40 'EXTRA_LDFLAGS=${LDFLAGS}' \
41 ${@bb.utils.contains('PACKAGECONFIG', 'acl', 'WITH_ACL=yes', '', d)} \
42 ${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'WITH_SELINUX=yes', '', d)} \
43"
44
45# OS_NAME in the makefile defaults to `uname -s`. The behavior for
46# freebsd/netbsd is questionable, so leave it as Linux, which only sets
47# INSTALL=install and BASEDIR=/usr.
48OS_NAME = "Linux"
49
50inherit autotools systemd
51
52SYSTEMD_SERVICE:${PN} = "\
53 ${BPN}.service \
54 ${BPN}.timer \
55"
56
57LOGROTATE_OPTIONS ?= ""
58
59LOGROTATE_SYSTEMD_TIMER_BASIS ?= "daily"
60LOGROTATE_SYSTEMD_TIMER_ACCURACY ?= "12h"
61LOGROTATE_SYSTEMD_TIMER_PERSISTENT ?= "true"
62
63do_install(){
64 oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir}
65 mkdir -p ${D}${sysconfdir}/logrotate.d
66 mkdir -p ${D}${localstatedir}/lib
67 install -p -m 644 ${S}/examples/logrotate.conf ${D}${sysconfdir}/logrotate.conf
68 install -p -m 644 ${S}/examples/btmp ${D}${sysconfdir}/logrotate.d/btmp
69 install -p -m 644 ${S}/examples/wtmp ${D}${sysconfdir}/logrotate.d/wtmp
70 touch ${D}${localstatedir}/lib/logrotate.status
71
72 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
73 install -d ${D}${systemd_system_unitdir}
74 install -m 0644 ${S}/examples/logrotate.service ${D}${systemd_system_unitdir}/logrotate.service
75 install -m 0644 ${S}/examples/logrotate.timer ${D}${systemd_system_unitdir}/logrotate.timer
76 [ -z "${LOGROTATE_OPTIONS}" ] ||
77 sed -ri \
78 -e 's|(ExecStart=.*/logrotate.*)$|\1 ${LOGROTATE_OPTIONS}|g' \
79 ${D}${systemd_system_unitdir}/logrotate.service
80 sed -ri \
81 -e 's|(OnCalendar=).*$|\1${LOGROTATE_SYSTEMD_TIMER_BASIS}|g' \
82 -e 's|(AccuracySec=).*$|\1${LOGROTATE_SYSTEMD_TIMER_ACCURACY}|g' \
83 -e 's|(Persistent=).*$|\1${LOGROTATE_SYSTEMD_TIMER_PERSISTENT}|g' \
84 ${D}${systemd_system_unitdir}/logrotate.timer
85 fi
86
87 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
88 mkdir -p ${D}${sysconfdir}/cron.daily
89 install -p -m 0755 ${S}/examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate
90 fi
91}