/* Copyright (c) 2023 Dovecot authors, see the included COPYING file */
#include "lib.h"
+#include "settings-parser.h"
#include "sasl-server-private.h" // FIXME: remove
#include "auth.h"
#include "auth-common.h"
* Instance
*/
-void auth_sasl_instance_init(struct auth *auth)
+void auth_sasl_instance_init(struct auth *auth,
+ const struct auth_settings *set)
{
const struct sasl_server_settings sasl_set = {
+ .realms = settings_boollist_get(&set->realms),
.event_parent = auth_event,
+ .verbose = set->verbose,
};
auth->sasl_inst =
* Instance
*/
-void auth_sasl_instance_init(struct auth *auth);
+void auth_sasl_instance_init(struct auth *auth,
+ const struct auth_settings *set);
void auth_sasl_instance_deinit(struct auth *auth);
/*
auth_userdb_preinit(auth, &userdb_dummy_set);
}
- auth_sasl_instance_init(auth);
+ auth_sasl_instance_init(auth, set);
return auth;
}
int refcount;
struct sasl_server_instance *prev, *next;
struct event *event;
+ struct sasl_server_settings set;
unsigned int requests;
};
struct event *mech_event;
const char *protocol;
+ const struct sasl_server_settings *set;
+
// FIXME: To be removed
struct auth_request *request;
};
mreq->pool = pool;
mreq->req = req;
mreq->request = request;
+ mreq->set = &sinst->set;
mreq->mech = mech;
mreq->mech_event = event_parent;
mreq->protocol = p_strdup(mreq->pool, protocol);
sinst->refcount = 1;
sinst->server = server;
+ sinst->set = *set;
+ if (set->realms != NULL)
+ sinst->set.realms = p_strarray_dup(pool, set->realms);
+
if (set->event_parent == NULL)
sinst->event = event_create(server->event);
else {
};
struct sasl_server_settings {
+ const char *const *realms;
+
/* Event to use for the SASL server instance. */
struct event *event_parent;
+
+ /* Enable logging verbosity */
+ bool verbose:1;
};
/*