]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: db-ldap - Drop auth_sasl_bind
authorMarco Bettini <marco.bettini@open-xchange.com>
Tue, 14 May 2024 14:15:58 +0000 (14:15 +0000)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:39:59 +0000 (10:39 +0200)
Now inferred by non-empty ldap_auth_sasl_mechanism.

src/auth/db-ldap-settings.c
src/auth/db-ldap-settings.h
src/auth/db-ldap.c

index 0717198005b842ef67d768c62ac6e32403743b6a..4dd895156d5944e37f05a80f34bd12ffc723e399 100644 (file)
@@ -26,7 +26,6 @@ static const struct setting_define ldap_setting_defines[] = {
        DEF(STR, auth_dn_password),
        DEFN(BOOL, passdb_ldap_bind, passdb_ldap_bind),
        DEFN(STR, passdb_ldap_bind_userdn, passdb_ldap_bind_userdn),
-       DEF(BOOL, auth_sasl_bind),
        DEF(STR, auth_sasl_mechanism),
        DEF(STR, auth_sasl_realm),
        DEF(STR, auth_sasl_authz_id),
@@ -52,7 +51,6 @@ static const struct ldap_settings ldap_default_settings = {
        .auth_dn_password = "",
        .passdb_ldap_bind = FALSE,
        .passdb_ldap_bind_userdn = "",
-       .auth_sasl_bind = FALSE,
        .auth_sasl_mechanism = "",
        .auth_sasl_realm = "",
        .auth_sasl_authz_id = "",
@@ -150,8 +148,8 @@ static bool ldap_setting_check(void *_set, pool_t pool ATTR_UNUSED,
 #endif
 
 #ifndef HAVE_LDAP_SASL
-       if (set->auth_sasl_bind) {
-               *error_r = "ldap_auth_sasl_bind=yes but no SASL support compiled in";
+       if (*set->auth_sasl_mechanism != '\0') {
+               *error_r = "ldap_auth_sasl_mechanism set, but no SASL support compiled in";
                return FALSE;
        }
 #endif
@@ -174,8 +172,8 @@ int ldap_setting_post_check(const struct ldap_settings *set, const char **error_
        }
 
        if (set->version < 3) {
-               if (set->auth_sasl_bind) {
-                       *error_r = "ldap_sauth_sasl_bind=yes requires ldap_version=3";
+               if (*set->auth_sasl_mechanism != '\0') {
+                       *error_r = "ldap_auth_sasl_mechanism requires ldap_version=3";
                        return -1;
                }
                if (set->starttls) {
index 9c5a8dabe15a79dd21ebb1f045ee2e77a8ec8832..25f9718295e952caa59d8029905cb01187667251 100644 (file)
@@ -33,7 +33,6 @@ struct ldap_settings {
        gid_t gid;
 
        bool passdb_ldap_bind;
-       bool auth_sasl_bind;
        bool starttls;
 
        /* parsed */
index 1eac7b3f603e477f67cbe815049c44dea231dc02..17dde333808fc7fa39e0e96b771602b13d29eb76 100644 (file)
@@ -796,7 +796,7 @@ static int db_ldap_bind_simple(struct ldap_connection *conn)
 
 static int db_ldap_bind(struct ldap_connection *conn)
 {
-       if (conn->set->auth_sasl_bind) {
+       if (*conn->set->auth_sasl_mechanism != '\0') {
                if (db_ldap_bind_sasl(conn) < 0)
                        return -1;
        } else {