diff options
author | Jason A. Donenfeld <zx2c4@gentoo.org> | 2013-02-28 17:57:15 +0000 |
---|---|---|
committer | Jason A. Donenfeld <zx2c4@gentoo.org> | 2013-02-28 17:57:15 +0000 |
commit | 7e2c634c343dab5c093c6ef547d9c0b10f2c1df4 (patch) | |
tree | 87b6a0b98f8663303397734b6aee8ccdac89d16e /mail-mta | |
parent | Fix build failure with separate tinfo library. (diff) | |
download | gentoo-2-7e2c634c343dab5c093c6ef547d9c0b10f2c1df4.tar.gz gentoo-2-7e2c634c343dab5c093c6ef547d9c0b10f2c1df4.tar.bz2 gentoo-2-7e2c634c343dab5c093c6ef547d9c0b10f2c1df4.zip |
Initial import.
(Portage version: 2.2.0_alpha163/cvs/Linux x86_64, signed Manifest commit with key A5DE03AE)
Diffstat (limited to 'mail-mta')
-rw-r--r-- | mail-mta/opensmtpd/ChangeLog | 10 | ||||
-rw-r--r-- | mail-mta/opensmtpd/files/build-warnings.patch | 39 | ||||
-rw-r--r-- | mail-mta/opensmtpd/files/pam.patch | 85 | ||||
-rw-r--r-- | mail-mta/opensmtpd/files/smtpd.initd | 20 | ||||
-rw-r--r-- | mail-mta/opensmtpd/files/smtpd.pam | 4 | ||||
-rw-r--r-- | mail-mta/opensmtpd/metadata.xml | 12 | ||||
-rw-r--r-- | mail-mta/opensmtpd/opensmtpd-9999.ebuild | 66 |
7 files changed, 236 insertions, 0 deletions
diff --git a/mail-mta/opensmtpd/ChangeLog b/mail-mta/opensmtpd/ChangeLog new file mode 100644 index 000000000000..e4811feeb973 --- /dev/null +++ b/mail-mta/opensmtpd/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for mail-mta/opensmtpd +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/opensmtpd/ChangeLog,v 1.1 2013/02/28 17:57:15 zx2c4 Exp $ + +*opensmtpd-9999 (28 Feb 2013) + + 28 Feb 2013; Jason A. Donenfeld <zx2c4@gentoo.org> + +files/build-warnings.patch, +files/pam.patch, +files/smtpd.initd, + +files/smtpd.pam, +metadata.xml, +opensmtpd-9999.ebuild: + Initial import. diff --git a/mail-mta/opensmtpd/files/build-warnings.patch b/mail-mta/opensmtpd/files/build-warnings.patch new file mode 100644 index 000000000000..5732da99aa5c --- /dev/null +++ b/mail-mta/opensmtpd/files/build-warnings.patch @@ -0,0 +1,39 @@ +diff --git a/openbsd-compat/entropy.c b/openbsd-compat/entropy.c +index 2d4e151..ac1ab37 100644 +--- a/openbsd-compat/entropy.c ++++ b/openbsd-compat/entropy.c +@@ -48,7 +48,7 @@ + //#include "xmalloc.h" + //#include "atomicio.h" + //#include "pathnames.h" +-//#include "log.h" ++#include "log.h" + //#include "buffer.h" + + /* wrapper for signal interface */ +diff --git a/openbsd-compat/imsg-buffer.c b/openbsd-compat/imsg-buffer.c +index 7223ad7..7c4d686 100644 +--- a/openbsd-compat/imsg-buffer.c ++++ b/openbsd-compat/imsg-buffer.c +@@ -256,7 +256,7 @@ msgbuf_write(struct msgbuf *msgbuf) + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; +- *(int *)CMSG_DATA(cmsg) = buf->fd; ++ memcpy(CMSG_DATA(cmsg), &buf->fd, sizeof(int)); + } + + again: +diff --git a/smtpd/mproc.c b/smtpd/mproc.c +index 7d9e593..d152784 100644 +--- a/smtpd/mproc.c ++++ b/smtpd/mproc.c +@@ -230,7 +230,7 @@ msgbuf_write2(struct msgbuf *msgbuf) + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; +- *(int *)CMSG_DATA(cmsg) = buf->fd; ++ memcpy(CMSG_DATA(cmsg), &buf->fd, sizeof(int)); + } + + again: diff --git a/mail-mta/opensmtpd/files/pam.patch b/mail-mta/opensmtpd/files/pam.patch new file mode 100644 index 000000000000..bb2a4e1d6f43 --- /dev/null +++ b/mail-mta/opensmtpd/files/pam.patch @@ -0,0 +1,85 @@ +diff -ru opensmtpd-5.2.xp1/smtpd/smtpd.c opensmtpd-5.2.xp1-pam/smtpd/smtpd.c +--- opensmtpd-5.2.xp1/smtpd/smtpd.c 2013-02-21 20:13:32.000000000 +0100 ++++ opensmtpd-5.2.xp1-pam/smtpd/smtpd.c 2013-02-28 06:02:51.034730193 +0100 +@@ -34,6 +34,15 @@ + #ifdef BSD_AUTH + #include <bsd_auth.h> + #endif ++ ++#ifdef USE_PAM ++#if defined(HAVE_SECURITY_PAM_APPL_H) ++#include <security/pam_appl.h> ++#elif defined (HAVE_PAM_PAM_APPL_H) ++#include <pam/pam_appl.h> ++#endif ++#endif ++ + #ifdef HAVE_CRYPT_H + #include <crypt.h> /* needed for crypt() */ + #endif +@@ -1639,6 +1648,53 @@ + } + #endif + ++#ifdef USE_PAM ++int ++pam_conv_password(int num_msg, const struct pam_message **msg, struct pam_response **respp, const char *password) ++{ ++ struct pam_response *response; ++ if (num_msg != 1) ++ return PAM_CONV_ERR; ++ response = malloc(sizeof(struct pam_response)); ++ if (!response) ++ return PAM_BUF_ERR; ++ memset(response, 0, sizeof(struct pam_response)); ++ response->resp = strdup(password); ++ if (!response->resp) ++ return PAM_BUF_ERR; ++ *respp = response; ++ return PAM_SUCCESS; ++} ++int ++parent_auth_pam(const char *username, const char *password) ++{ ++ int rc; ++ pam_handle_t *pamh = NULL; ++ struct pam_conv conv = { pam_conv_password, password }; ++ ++ if ((rc = pam_start("smtpd", username, &conv, &pamh)) != PAM_SUCCESS) ++ goto end; ++ if ((rc = pam_authenticate(pamh, 0)) != PAM_SUCCESS) ++ goto end; ++ if ((rc = pam_acct_mgmt(pamh, 0)) != PAM_SUCCESS) ++ goto end; ++end: ++ pam_end(pamh, rc); ++ ++ switch (rc) { ++ case PAM_SUCCESS: ++ return LKA_OK; ++ case PAM_SYSTEM_ERR: ++ case PAM_ABORT: ++ case PAM_AUTHINFO_UNAVAIL: ++ return LKA_TEMPFAIL; ++ default: ++ return LKA_PERMFAIL; ++ ++ } ++} ++#endif ++ + int + parent_auth_pwd(const char *username, const char *password) + { +@@ -1664,8 +1720,10 @@ + int + parent_auth_user(const char *username, const char *password) + { +-#ifdef BSD_AUTH ++#if defined(BSD_AUTH) + return (parent_auth_bsd(username, password)); ++#elif defined(USE_PAM) ++ return (parent_auth_pam(username, password)); + #else + return (parent_auth_pwd(username, password)); + #endif diff --git a/mail-mta/opensmtpd/files/smtpd.initd b/mail-mta/opensmtpd/files/smtpd.initd new file mode 100644 index 000000000000..9bd6fbfd4754 --- /dev/null +++ b/mail-mta/opensmtpd/files/smtpd.initd @@ -0,0 +1,20 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/opensmtpd/files/smtpd.initd,v 1.1 2013/02/28 17:57:15 zx2c4 Exp $ + +depend() { + need net +} + +start() { + ebegin "Starting OpenSMTPD" + start-stop-daemon --start --quiet --exec /usr/sbin/smtpd + eend ${?} +} + +stop() { + ebegin "Stopping OpenSMTPD" + /usr/sbin/smtpctl stop + eend ${?} +} diff --git a/mail-mta/opensmtpd/files/smtpd.pam b/mail-mta/opensmtpd/files/smtpd.pam new file mode 100644 index 000000000000..a85aeae1e8b3 --- /dev/null +++ b/mail-mta/opensmtpd/files/smtpd.pam @@ -0,0 +1,4 @@ +auth required pam_nologin.so +auth include system-auth +account include system-auth +session include system-auth diff --git a/mail-mta/opensmtpd/metadata.xml b/mail-mta/opensmtpd/metadata.xml new file mode 100644 index 000000000000..c7aad02804e2 --- /dev/null +++ b/mail-mta/opensmtpd/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<longdescription lang="en"> +OpenSMTPD is an implementation of the server-side SMTP protocol as defined by RFC 5321, with some additional standard extensions. It allows ordinary machines to exchange e-mails with other systems speaking the SMTP protocol. +</longdescription> +<maintainer> +<email>zx2c4@gentoo.org</email> +<name>Jason A. Donenfeld</name> +</maintainer> +</pkgmetadata> + diff --git a/mail-mta/opensmtpd/opensmtpd-9999.ebuild b/mail-mta/opensmtpd/opensmtpd-9999.ebuild new file mode 100644 index 000000000000..d7cf8a349fda --- /dev/null +++ b/mail-mta/opensmtpd/opensmtpd-9999.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/opensmtpd/opensmtpd-9999.ebuild,v 1.1 2013/02/28 17:57:15 zx2c4 Exp $ + +EAPI=5 + +inherit multilib user flag-o-matic eutils pam git-2 + +DESCRIPTION="Lightweight but featured SMTP daemon from OpenBSD" +HOMEPAGE="http://www.opensmtpd.org/" +SRC_URI="" +EGIT_BRANCH="portable" +EGIT_REPO_URI="git://github.com/poolpOrg/OpenSMTPD.git" + +LICENSE="ISC BSD BSD-1 BSD-2 BSD-4" +SLOT="0" +KEYWORDS="" +IUSE="pam" + +DEPEND="dev-libs/openssl + sys-libs/zlib + pam? ( virtual/pam ) + sys-libs/db + dev-db/sqlite:3 + dev-libs/libevent + !mail-mta/courier + !mail-mta/esmtp + !mail-mta/exim + !mail-mta/mini-qmail + !mail-mta/msmtp[mta] + !mail-mta/netqmail + !mail-mta/nullmailer + !mail-mta/postfix + !mail-mta/qmail-ldap + !mail-mta/sendmail + !mail-mta/ssmtp[mta] +" +RDEPEND="${DEPEND}" + +S=${WORKDIR}/${P}.xp1 + +src_prepare() { + epatch "${FILESDIR}"/pam.patch + epatch "${FILESDIR}"/build-warnings.patch +} + +src_configure() { + ./bootstrap + econf \ + --with-privsep-user=smtpd \ + --with-privsep-path=/var/empty \ + --with-sock-dir=/var/run \ + --sysconfdir=/etc/opensmtpd \ + $(use_with pam) +} + +src_install() { + default + newinitd "${FILESDIR}"/smtpd.initd smtpd + use pam && newpamd "${FILESDIR}"/smtpd.pam smtpd +} + +pkg_preinst() { + enewgroup smtpd 25 + enewuser smtpd 25 -1 /var/empty smtpd +} |