~ubuntu-branches/ubuntu/trusty/dovecot/trusty-updates

« back to all changes in this revision

Viewing changes to src/auth/mech.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-01-08 09:35:49 UTC
  • mfrom: (1.15.3) (96.1.1 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20140108093549-814nkqdcxfbvgktg
Tags: 1:2.2.9-1ubuntu1
* Merge from Debian unstable, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst: Convert init script to upstart.
  + Use the autotools-dev dh addon to update config.guess/config.sub for
    arm64.
* Dropped changes, included in Debian:
  - Update Dovecot name to reflect distribution in login greeting.
  - Update Drac plugin for >= 2.0.0 support.
* d/control: Drop dovecot-postfix package as its no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2002-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2002-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "auth-common.h"
4
4
#include "ioloop.h"
7
7
#include "passdb.h"
8
8
 
9
9
#include <stdlib.h>
 
10
#include <ctype.h>
10
11
 
11
12
static struct mech_module_list *mech_modules;
12
13
 
50
51
                               const unsigned char *data, size_t data_size)
51
52
{
52
53
        if (data == NULL) {
53
 
                auth_request_handler_reply_continue(request, NULL, 0);
 
54
                auth_request_handler_reply_continue(request, &uchar_nul, 0);
54
55
        } else {
55
56
                /* initial reply given, even if it was 0 bytes */
56
57
                request->mech->auth_continue(request, data, data_size);
112
113
        reg->modules = list;
113
114
}
114
115
 
 
116
static const char *mech_get_plugin_name(const char *name)
 
117
{
 
118
        string_t *str = t_str_new(32);
 
119
 
 
120
        str_append(str, "mech_");
 
121
        for (; *name != '\0'; name++) {
 
122
                if (*name == '-')
 
123
                        str_append_c(str, '_');
 
124
                else
 
125
                        str_append_c(str, i_tolower(*name));
 
126
        }
 
127
        return str_c(str);
 
128
}
 
129
 
115
130
struct mechanisms_register *
116
131
mech_register_init(const struct auth_settings *set)
117
132
{
139
154
                mech = mech_module_find(name);
140
155
                if (mech == NULL) {
141
156
                        /* maybe it's a plugin. try to load it. */
142
 
                        auth_module_load(t_strconcat("mech_", name, NULL));
 
157
                        auth_module_load(mech_get_plugin_name(name));
143
158
                        mech = mech_module_find(name);
144
159
                }
145
160
                if (mech == NULL)
205
220
#endif
206
221
        }
207
222
        mech_unregister_module(&mech_otp);
 
223
        mech_unregister_module(&mech_scram_sha1);
208
224
        mech_unregister_module(&mech_skey);
209
225
        mech_unregister_module(&mech_rpa);
210
226
        mech_unregister_module(&mech_anonymous);