{ .type = SET_FILTER_NAME, .key = "userdb_ldap", },
DEF(STR, hosts),
DEF(STR, uris),
- DEF(STR, dn),
- DEF(STR, dnpass),
+ DEF(STR, auth_dn),
+ DEF(STR, auth_dn_password),
DEF(BOOL, auth_bind),
DEF(STR, auth_bind_userdn),
+ DEF(BOOL, auth_sasl_bind),
+ DEF(STR, auth_sasl_mechanism),
+ DEF(STR, auth_sasl_realm),
+ DEF(STR, auth_sasl_authz_id),
DEF(BOOL, starttls),
- DEF(BOOL, sasl_bind),
- DEF(STR, sasl_mech),
- DEF(STR, sasl_realm),
- DEF(STR, sasl_authz_id),
DEF(STR, deref),
DEF(STR, scope),
DEF(STR, base),
static const struct ldap_settings ldap_default_settings = {
.hosts = "",
.uris = "",
- .dn = "",
- .dnpass = "",
+ .auth_dn = "",
+ .auth_dn_password = "",
.auth_bind = FALSE,
.auth_bind_userdn = "",
+ .auth_sasl_bind = FALSE,
+ .auth_sasl_mechanism = "",
+ .auth_sasl_realm = "",
+ .auth_sasl_authz_id = "",
.starttls = FALSE,
- .sasl_bind = FALSE,
- .sasl_mech = "",
- .sasl_realm = "",
- .sasl_authz_id = "",
.deref = "never",
.scope = "subtree",
.base = "",
#endif
#ifndef HAVE_LDAP_SASL
- if (set->sasl_bind) {
- *error_r = "ldap_sasl_bind=yes but no SASL support compiled in";
+ if (set->auth_sasl_bind) {
+ *error_r = "ldap_auth_sasl_bind=yes but no SASL support compiled in";
return FALSE;
}
#endif
}
if (set->version < 3) {
- if (set->sasl_bind) {
- *error_r = "ldap_sasl_bind=yes requires ldap_version=3";
+ if (set->auth_sasl_bind) {
+ *error_r = "ldap_sauth_sasl_bind=yes requires ldap_version=3";
return -1;
}
if (set->starttls) {
const char *hosts;
const char *uris;
- const char *dn;
- const char *dnpass;
+ const char *auth_dn;
+ const char *auth_dn_password;
const char *auth_bind_userdn;
- const char *sasl_mech;
- const char *sasl_realm;
- const char *sasl_authz_id;
+ const char *auth_sasl_mechanism;
+ const char *auth_sasl_realm;
+ const char *auth_sasl_authz_id;
const char *deref;
const char *scope;
gid_t gid;
bool auth_bind;
+ bool auth_sasl_bind;
bool starttls;
- bool sasl_bind;
/* parsed */
int parsed_deref;
}
if (ret != LDAP_SUCCESS) {
e_error(conn->event, "binding failed (dn %s): %s",
- conn->set->dn == NULL ? "(none)" : conn->set->dn,
+ conn->set->auth_dn == NULL ? "(none)" : conn->set->auth_dn,
ldap_get_error(conn));
return -1;
}
int ret;
i_zero(&context);
- context.authcid = conn->set->dn;
- context.passwd = conn->set->dnpass;
- context.realm = conn->set->sasl_realm;
- context.authzid = conn->set->sasl_authz_id;
+ context.authcid = conn->set->auth_dn;
+ context.passwd = conn->set->auth_dn_password;
+ context.realm = conn->set->auth_sasl_realm;
+ context.authzid = conn->set->auth_sasl_authz_id;
/* There doesn't seem to be a way to do SASL binding
asynchronously.. */
ret = ldap_sasl_interactive_bind_s(conn->ld, NULL,
- conn->set->sasl_mech,
+ conn->set->auth_sasl_mechanism,
NULL, NULL, LDAP_SASL_QUIET,
sasl_interact, &context);
if (db_ldap_connect_finish(conn, ret) < 0)
i_assert(conn->default_bind_msgid == -1);
i_assert(conn->pending_count == 0);
- msgid = ldap_bind(conn->ld, conn->set->dn, conn->set->dnpass,
- LDAP_AUTH_SIMPLE);
+ msgid = ldap_bind(conn->ld, conn->set->auth_dn,
+ conn->set->auth_dn_password, LDAP_AUTH_SIMPLE);
if (msgid == -1) {
i_assert(ldap_get_errno(conn) != LDAP_SUCCESS);
if (db_ldap_connect_finish(conn, ldap_get_errno(conn)) < 0) {
static int db_ldap_bind(struct ldap_connection *conn)
{
- if (conn->set->sasl_bind) {
+ if (conn->set->auth_sasl_bind) {
if (db_ldap_bind_sasl(conn) < 0)
return -1;
} else {