#include "ioloop.h"
#include "mech.h"
#include "str.h"
+#include "strfuncs.h"
#include "passdb.h"
#include <ctype.h>
void mech_register_module(const struct mech_module *module)
{
struct mech_module_list *list;
+ i_assert(strcmp(module->mech_name, t_str_ucase(module->mech_name)) == 0);
list = i_new(struct mech_module_list, 1);
list->module = *module;
const struct mech_module *mech_module_find(const char *name)
{
struct mech_module_list *list;
+ name = t_str_ucase(name);
for (list = mech_modules; list != NULL; list = list->next) {
- if (strcasecmp(list->module.mech_name, name) == 0)
+ if (strcmp(list->module.mech_name, name) == 0)
return &list->module;
}
return NULL;
mechanisms = t_strsplit_spaces(set->mechanisms, " ");
for (; *mechanisms != NULL; mechanisms++) {
- const char *name = *mechanisms;
+ const char *name = t_str_ucase(*mechanisms);
- if (strcasecmp(name, "ANONYMOUS") == 0) {
+ if (strcmp(name, "ANONYMOUS") == 0) {
if (*set->anonymous_username == '\0') {
i_fatal("ANONYMOUS listed in mechanisms, "
"but anonymous_username not set");
mech_register_find(const struct mechanisms_register *reg, const char *name)
{
const struct mech_module_list *list;
+ name = t_str_ucase(name);
for (list = reg->modules; list != NULL; list = list->next) {
- if (strcasecmp(list->module.mech_name, name) == 0)
+ if (strcmp(list->module.mech_name, name) == 0)
return &list->module;
}
return NULL;