summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-03-15 01:25:33 +0000
committerSam James <sam@gentoo.org>2021-03-15 01:25:33 +0000
commit0a0d469ed446b082600e3f4c7db0472dccd87d58 (patch)
tree7439aa4c622f9fbf6d5d901fde0baf9c4c61ea4a /app-admin/sagan
parentapp-admin/sagan: fix log and runtime directory permissions (diff)
downloadgentoo-0a0d469ed446b082600e3f4c7db0472dccd87d58.tar.gz
gentoo-0a0d469ed446b082600e3f4c7db0472dccd87d58.tar.bz2
gentoo-0a0d469ed446b082600e3f4c7db0472dccd87d58.zip
app-admin/sagan: add warning to fix permissions for older installs
Bug: https://bugs.gentoo.org/775902 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-admin/sagan')
-rw-r--r--app-admin/sagan/sagan-2.0.1-r4.ebuild18
1 files changed, 18 insertions, 0 deletions
diff --git a/app-admin/sagan/sagan-2.0.1-r4.ebuild b/app-admin/sagan/sagan-2.0.1-r4.ebuild
index 50e4eef44849..aa3ce608b688 100644
--- a/app-admin/sagan/sagan-2.0.1-r4.ebuild
+++ b/app-admin/sagan/sagan-2.0.1-r4.ebuild
@@ -102,9 +102,27 @@ src_install() {
dodoc -r extra/*
}
+pkg_preinst() {
+ # bug #775902 revealed that we need 750 on /var/log/sagan or e.g.
+ # logrotate will fail. Let's inform the user to fix up permissions
+ # in such a case.
+ # (fperms won't modify the live filesystem.)
+ HAD_BROKEN_PERMS=0
+
+ if has_version "<app-admin/sagan-2.0.1-r4" ; then
+ HAD_BROKEN_PERMS=1
+ fi
+}
+
pkg_postinst() {
tmpfiles_process sagan.conf
+ if [[ "${HAD_BROKEN_PERMS}" -eq 1 ]] ; then
+ ewarn "Please fix the permissions on ${EPREFIX}/var/log/sagan:"
+ ewarn "e.g. chmod 750 /var/log/sagan"
+ ewarn "See bug #775902"
+ fi
+
if use smtp; then
ewarn "You have enabled smtp use flag. If you plan on using Sagan with"
ewarn "email, create valid writable home directory for user 'sagan'"