From df4c6b1b136a68d49eeffeb452b0ca3cac88a6ff Mon Sep 17 00:00:00 2001 From: Wietse Venema Date: Tue, 22 Aug 2000 00:00:00 +0000 Subject: [PATCH] snapshot-20000822 --- postfix/HISTORY | 11 +++++++++++ postfix/global/mail_version.h | 2 +- postfix/smtpd/smtpd_sasl_proto.c | 4 ++-- postfix/util/file_limit.c | 8 ++++++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/postfix/HISTORY b/postfix/HISTORY index 17b46c128..6116015b3 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -4136,3 +4136,14 @@ Apologies for any names omitted. Cleanup: smtpd now replies with 555 when the client sends unrecognized RCPT TO parameters, as required by RFC 1869 (problem report by Robert Norris @ its.monash.edu.au). + +20000822 + + Logging: the SMTP server's SASL code logs the authentication + method along with an authentication failure. Suggested by + Ronald F. Guilmette @ monkeys.com. + + Workaround: some systems have file size resource limits + that cannot be represented with the off_t type that is used + by standard functions such as lseek(2). Problem reported + by Blaz Zupan @ amis.net. diff --git a/postfix/global/mail_version.h b/postfix/global/mail_version.h index 9d6310f5b..79c466832 100644 --- a/postfix/global/mail_version.h +++ b/postfix/global/mail_version.h @@ -15,7 +15,7 @@ * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" -#define DEF_MAIL_VERSION "Snapshot-20000821" +#define DEF_MAIL_VERSION "Snapshot-20000822" extern char *var_mail_version; /* LICENSE diff --git a/postfix/smtpd/smtpd_sasl_proto.c b/postfix/smtpd/smtpd_sasl_proto.c index 02ee490a3..8e762f41f 100644 --- a/postfix/smtpd/smtpd_sasl_proto.c +++ b/postfix/smtpd/smtpd_sasl_proto.c @@ -148,8 +148,8 @@ int smtpd_sasl_auth_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv) initial_response = (argc == 3 ? argv[2].strval : 0); err = smtpd_sasl_authenticate(state, auth_mechanism, initial_response); if (err != 0) { - msg_warn("%s[%s]: SASL authentication failed", - state->name, state->addr); + msg_warn("%s[%s]: SASL %s authentication failed", + state->name, state->addr, auth_mechanism); smtpd_chat_reply(state, "%s", err); return (-1); } diff --git a/postfix/util/file_limit.c b/postfix/util/file_limit.c index a45c0a26d..91066dacd 100644 --- a/postfix/util/file_limit.c +++ b/postfix/util/file_limit.c @@ -44,6 +44,7 @@ #include #include #endif +#include /* Utility library. */ @@ -56,18 +57,21 @@ off_t get_file_limit(void) { -#ifdef USE_ULIMIT off_t limit; +#ifdef USE_ULIMIT if ((limit = ulimit(UL_GETFSIZE, 0)) < 0) msg_fatal("ulimit: %m"); + if (limit > INT_MAX / ULIMIT_BLOCK_SIZE) + limit = INT_MAX / ULIMIT_BLOCK_SIZE; return (limit * ULIMIT_BLOCK_SIZE); #else struct rlimit rlim; if (getrlimit(RLIMIT_FSIZE, &rlim) < 0) msg_fatal("getrlimit: %m"); - return (rlim.rlim_cur); + limit = rlim.rlim_cur; + return (limit < 0 ? INT_MAX : rlim.rlim_cur); #endif /* USE_ULIMIT */ }