From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BEEB21382C5 for ; Wed, 4 Apr 2018 14:04:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 73408E0BF8; Wed, 4 Apr 2018 14:04:09 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4E29AE0BF8 for ; Wed, 4 Apr 2018 14:04:09 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D5F1B335C0A for ; Wed, 4 Apr 2018 14:04:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A24C2250 for ; Wed, 4 Apr 2018 14:04:05 +0000 (UTC) From: "Eray Aslan" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Eray Aslan" Message-ID: <1522850618.3b8f34badbdf4008f9d92db08d49b1e6ead27868.eras@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-mail/mailbase/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-mail/mailbase/mailbase-1.2.ebuild X-VCS-Directories: net-mail/mailbase/ X-VCS-Committer: eras X-VCS-Committer-Name: Eray Aslan X-VCS-Revision: 3b8f34badbdf4008f9d92db08d49b1e6ead27868 X-VCS-Branch: master Date: Wed, 4 Apr 2018 14:04:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: c15b02e0-49d5-434e-8d3b-7e971df2989a X-Archives-Hash: 2710d4071d28117600c9439adfbf2b28 commit: 3b8f34badbdf4008f9d92db08d49b1e6ead27868 Author: Eray Aslan gentoo org> AuthorDate: Wed Apr 4 14:03:38 2018 +0000 Commit: Eray Aslan gentoo org> CommitDate: Wed Apr 4 14:03:38 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b8f34ba net-mail/mailbase: fix mail spool permissions on first install Closes: https://bugs.gentoo.org/614396 Package-Manager: Portage-2.3.28, Repoman-2.3.9 net-mail/mailbase/mailbase-1.2.ebuild | 65 +++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/net-mail/mailbase/mailbase-1.2.ebuild b/net-mail/mailbase/mailbase-1.2.ebuild new file mode 100644 index 00000000000..508f9f65781 --- /dev/null +++ b/net-mail/mailbase/mailbase-1.2.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +inherit pam eutils user + +DESCRIPTION="MTA layout package" +SRC_URI="" +HOMEPAGE="https://www.gentoo.org/" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd" +IUSE="pam" + +RDEPEND="pam? ( virtual/pam )" + +S=${WORKDIR} + +pkg_setup() { + enewgroup mail 12 + enewuser mail 8 -1 /var/spool/mail mail + enewuser postmaster 14 -1 /var/spool/mail +} + +src_install() { + dodir /etc/mail + insinto /etc/mail + doins "${FILESDIR}"/aliases || die + insinto /etc + doins "${FILESDIR}"/mailcap || die + + keepdir /var/spool/mail + fowners root:mail /var/spool/mail + fperms 03775 /var/spool/mail + dosym /var/spool/mail /var/mail + + newpamd "${FILESDIR}"/common-pamd-include pop + newpamd "${FILESDIR}"/common-pamd-include imap + if use pam ; then + local p + for p in pop3 pop3s pops ; do + dosym pop /etc/pam.d/${p} || die + done + for p in imap4 imap4s imaps ; do + dosym imap /etc/pam.d/${p} || die + done + fi +} + +get_permissions_oct() { + if [[ ${USERLAND} = GNU ]] ; then + stat -c%a "${ROOT}$1" + elif [[ ${USERLAND} = BSD ]] ; then + stat -f%p "${ROOT}$1" | cut -c 3- + fi +} + +pkg_postinst() { + # bug 614396 + if [[ "$(get_permissions_oct /var/spool/mail)" != "3775" ]] ; then + einfo "Fixing ${ROOT}var/spool/mail/ permissions" + chown root:mail "${ROOT}var/spool/mail/" + chmod 03775 "${ROOT}var/spool/mail/" + fi +}