aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpsykose <alice@ayaya.dev>2022-06-21 06:31:47 +0000
committerpsykose <alice@ayaya.dev>2022-06-21 10:22:06 +0200
commitc88baf16ee67c66b1199db5cb700fff5d06dfe75 (patch)
tree5e006255323d9c6022e1dd6eb3585f3de65f657c
parentfab5aa987c096363e96512d796d8293d9560dd30 (diff)
main/logrotate: fix permissions of logrotate status
fixes #13946
-rw-r--r--main/logrotate/APKBUILD3
-rw-r--r--main/logrotate/logrotate.post-upgrade12
2 files changed, 14 insertions, 1 deletions
diff --git a/main/logrotate/APKBUILD b/main/logrotate/APKBUILD
index cc0c964e7d2..26fee4660cd 100644
--- a/main/logrotate/APKBUILD
+++ b/main/logrotate/APKBUILD
@@ -2,11 +2,12 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=logrotate
pkgver=3.18.1
-pkgrel=2
+pkgrel=3
pkgdesc="Tool to rotate logfiles"
url="https://github.com/logrotate/logrotate"
arch="all"
license="GPL-2.0-or-later"
+install="$pkgname.post-upgrade"
makedepends="popt-dev autoconf automake libtool"
checkdepends="coreutils"
subpackages="$pkgname-doc $pkgname-openrc"
diff --git a/main/logrotate/logrotate.post-upgrade b/main/logrotate/logrotate.post-upgrade
new file mode 100644
index 00000000000..392c5a4e205
--- /dev/null
+++ b/main/logrotate/logrotate.post-upgrade
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+ver_old=$2
+
+if [ "$(apk version -t "$ver_old" '3.18.1-r3')" = '<' ]; then
+ # need to remove world permissions from status file, to dodge
+ # error: state file /var/lib/logrotate.status is world-readable
+ # 640 matches the spec file
+ chmod 640 /var/lib/logrotate.status
+fi
+
+exit 0