summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEray Aslan <eras@gentoo.org>2012-10-12 21:30:42 +0000
committerEray Aslan <eras@gentoo.org>2012-10-12 21:30:42 +0000
commitc71a0c09a90fa93ee4ff9fcf5827600561537c51 (patch)
tree51f6c4a9d7f8f5e63bd444d8e3c038320dd3fd7d /net-mail
parentversion bumped TeamSpeak Server to 3.0.6.1 (diff)
downloadgentoo-2-c71a0c09a90fa93ee4ff9fcf5827600561537c51.tar.gz
gentoo-2-c71a0c09a90fa93ee4ff9fcf5827600561537c51.tar.bz2
gentoo-2-c71a0c09a90fa93ee4ff9fcf5827600561537c51.zip
Make /var/spool/mail/ directory setgid and sticky - bugs #424431 #426962 #438062 and various others
(Portage version: 2.2.0_alpha136/cvs/Linux x86_64)
Diffstat (limited to 'net-mail')
-rw-r--r--net-mail/mailbase/ChangeLog8
-rw-r--r--net-mail/mailbase/mailbase-1.1.ebuild70
2 files changed, 77 insertions, 1 deletions
diff --git a/net-mail/mailbase/ChangeLog b/net-mail/mailbase/ChangeLog
index 46cbeefe7171..7cc41c9734c4 100644
--- a/net-mail/mailbase/ChangeLog
+++ b/net-mail/mailbase/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-mail/mailbase
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-mail/mailbase/ChangeLog,v 1.76 2012/04/26 14:21:12 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-mail/mailbase/ChangeLog,v 1.77 2012/10/12 21:30:42 eras Exp $
+
+*mailbase-1.1 (12 Oct 2012)
+
+ 12 Oct 2012; Eray Aslan <eraya@gentoo.org> +mailbase-1.1.ebuild:
+ Make /var/spool/mail/ directory setgid and sticky - bugs #424431 #426962
+ #438062 and various others
26 Apr 2012; Alexis Ballier <aballier@gentoo.org> mailbase-1.ebuild:
keyword ~amd64-fbsd
diff --git a/net-mail/mailbase/mailbase-1.1.ebuild b/net-mail/mailbase/mailbase-1.1.ebuild
new file mode 100644
index 000000000000..98b3601e4335
--- /dev/null
+++ b/net-mail/mailbase/mailbase-1.1.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-mail/mailbase/mailbase-1.1.ebuild,v 1.1 2012/10/12 21:30:42 eras Exp $
+
+inherit pam eutils user
+
+DESCRIPTION="MTA layout package"
+SRC_URI=""
+HOMEPAGE="http://www.gentoo.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-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() {
+ if [[ "$(get_permissions_oct /var/spool/mail)" != "3775" ]] ; then
+ echo
+ ewarn "Your ${ROOT}/var/spool/mail/ directory permissions differ from"
+ ewarn " those which mailbase wants to set it to (03775)."
+ ewarn " If you did not change them on purpose, consider running:"
+ ewarn
+ ewarn " chown root:mail ${ROOT}/var/spool/mail/"
+ ewarn " chmod 03775 ${ROOT}/var/spool/mail/"
+ echo
+ fi
+}