Index: head/mail/opensmtpd/Makefile =================================================================== --- head/mail/opensmtpd/Makefile (revision 394423) +++ head/mail/opensmtpd/Makefile (revision 394424) @@ -1,58 +1,59 @@ # Created by: Ashish SHUKLA # $FreeBSD$ PORTNAME= opensmtpd PORTVERSION= 5.7.1 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= mail MASTER_SITES= http://www.opensmtpd.org/archives/ \ http://distfiles.pirateparty.in/ashish/ DISTNAME= ${PORTNAME}-${PORTVERSION}p1 MAINTAINER= ashish@FreeBSD.org COMMENT= Security- and simplicity-focused SMTP server from OpenBSD LICENSE= ISCL LICENSE_FILE= ${WRKSRC}/LICENSE LIB_DEPENDS= libevent.so:${PORTSDIR}/devel/libevent2 OPTIONS_DEFINE= CA_BUNDLE LIBASRDEVEL MAILERCONF PAM TABLE_DB OPTIONS_DEFAULT= CA_BUNDLE PAM TABLE_DB CA_BUNDLE_DESC= Install CA bundle for OpenSSL LIBASRDEVEL_DESC= Use development version of libasr MAILERCONF_DESC= Activate OpenSMTPD in mailer.conf(5) TABLE_DB_DESC= Build table-db plugin (aliases) USES= cpe libtool USE_OPENSSL= yes WITH_OPENSSL_PORT= yes GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-libevent-dir=${LOCALBASE} --sysconfdir=${PREFIX}/etc/mail/ \ --with-mailwrapper --with-ssl-dir=${OPENSSLBASE} CPE_VENDOR= openbsd USE_RC_SUBR= smtpd SUB_FILES= pkg-install pkg-deinstall pkg-message CONFLICTS_INSTALL= postfix-[0-9]* sendmail-[0-9]* opensmtpd-devel-[0-9]* USERS= _smtpd _smtpq GROUPS= _smtpd OPTIONS_SUB= yes CA_BUNDLE_CONFIGURE_ON= --with-ca-file=${LOCALBASE}/share/certs/ca-root-nss.crt CA_BUNDLE_RUN_DEPENDS= ${LOCALBASE}/share/certs/ca-root-nss.crt:${PORTSDIR}/security/ca_root_nss LIBASRDEVEL_LIB_DEPENDS_OFF= libasr.so:${PORTSDIR}/dns/libasr LIBASRDEVEL_LIB_DEPENDS= libasr.so:${PORTSDIR}/dns/libasr-devel PAM_CONFIGURE_ON= --with-pam --with-pam-service=smtpd TABLE_DB_CONFIGURE_ON= --enable-table-db .include Index: head/mail/opensmtpd/files/patch-usernamelen =================================================================== --- head/mail/opensmtpd/files/patch-usernamelen (nonexistent) +++ head/mail/opensmtpd/files/patch-usernamelen (revision 394424) @@ -0,0 +1,61 @@ +diff --git a/smtpd/smtp_session.c b/smtpd/smtp_session.c +index 3a0ca2a..404ee50 100644 +--- smtpd/smtp_session.c ++++ smtpd/smtp_session.c +@@ -84,6 +84,7 @@ enum session_flags { + SF_BADINPUT = 0x0080, + SF_FILTERCONN = 0x0100, + SF_FILTERDATA = 0x0200, ++ SF_USERTOLONG = 0x0400, + }; + + enum message_flags { +@@ -133,7 +134,7 @@ struct smtp_session { + + char helo[LINE_MAX]; + char cmd[LINE_MAX]; +- char username[LOGIN_NAME_MAX]; ++ char username[LOGIN_NAME_MAX+HOST_NAME_MAX+1]; + + struct envelope evp; + +@@ -990,6 +991,15 @@ smtp_session_imsg(struct mproc *p, struct imsg *imsg) + + s = tree_xpop(&wait_parent_auth, reqid); + strnvis(user, s->username, sizeof user, VIS_WHITE | VIS_SAFE); ++ ++ if (s->flags & SF_USERTOLONG) { ++ log_info("smtp-in: sesson %016"PRIx64 ++ ": auth failed because username to long", ++ s->id); ++ s->flags &= (~SF_USERTOLONG); ++ success = LKA_PERMFAIL; ++ } ++ + if (success == LKA_OK) { + log_info("smtp-in: session %016"PRIx64 + ": authentication successful for user %s ", +@@ -1929,7 +1939,7 @@ smtp_rfc4954_auth_plain(struct smtp_session *s, char *arg) + user++; /* skip NUL */ + if (strlcpy(s->username, user, sizeof(s->username)) + >= sizeof(s->username)) +- goto abort; ++ s->flags |= SF_USERTOLONG; + + pass = memchr(user, '\0', len - (user - buf)); + if (pass == NULL || pass >= buf + len - 2) +@@ -1969,9 +1979,12 @@ smtp_rfc4954_auth_login(struct smtp_session *s, char *arg) + + case STATE_AUTH_USERNAME: + memset(s->username, 0, sizeof(s->username)); +- if (base64_decode(arg, (unsigned char *)s->username, +- sizeof(s->username) - 1) == -1) ++ if (base64_decode(arg, (unsigned char *)buf, ++ sizeof(buf) - 1) == -1) + goto abort; ++ if (strlcpy(s->username, buf, sizeof(s->username)) ++ >= sizeof(s->username)) ++ s->flags |= SF_USERTOLONG; + + smtp_enter_state(s, STATE_AUTH_PASSWORD); + smtp_reply(s, "334 UGFzc3dvcmQ6"); Property changes on: head/mail/opensmtpd/files/patch-usernamelen ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property