~ubuntu-branches/ubuntu/trusty/postfix/trusty

« back to all changes in this revision

Viewing changes to src/smtpd/smtpd_sasl_proto.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones, Wietse Venema, LaMont Jones
  • Date: 2011-05-10 08:40:13 UTC
  • mfrom: (1.1.30 upstream) (33.1.10 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110510084013-eeoaeuuet3projj7
Tags: 2.8.3-1
[Wietse Venema]

* 2.8.3
  - Cleanup: postscreen(8) and verify(8) daemons now lock their respective
    cache file exclusively upon open, to avoid massive cache corruption
    by unsupported sharing.
  - Bugfix (introduced with Postfix SASL patch 20000314): don't reuse a
    server SASL handle after authentication failure.  CVE-2011-1720

[LaMont Jones]
* Ack ubuntu fixes for multiarch.  Closes: #620326, #625674

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
        return (-1);
185
185
    }
186
186
 
 
187
    /* Don't reuse the SASL handle after authentication failure. */
 
188
#ifndef SMTPD_FLAG_AUTH_USED
 
189
#define SMTPD_FLAG_AUTH_USED    (1<<15)
 
190
#endif
 
191
#ifndef XSASL_TYPE_CYRUS 
 
192
#define XSASL_TYPE_CYRUS        "cyrus"
 
193
#endif
 
194
    if (state->flags & SMTPD_FLAG_AUTH_USED) {
 
195
        smtpd_sasl_deactivate(state);
 
196
#ifdef USE_TLS
 
197
        if (state->tls_context != 0)
 
198
            smtpd_sasl_activate(state, VAR_SMTPD_SASL_TLS_OPTS,
 
199
                                var_smtpd_sasl_tls_opts);
 
200
        else
 
201
#endif
 
202
            smtpd_sasl_activate(state, VAR_SMTPD_SASL_OPTS,
 
203
                                var_smtpd_sasl_opts);
 
204
    } else if (strcmp(var_smtpd_sasl_type, XSASL_TYPE_CYRUS) == 0) {
 
205
        state->flags |= SMTPD_FLAG_AUTH_USED;
 
206
    }
 
207
 
187
208
    /*
188
209
     * All authentication failures shall be logged. The 5xx reply code from
189
210
     * the SASL authentication routine triggers tar-pit delays, which help to