Skip to content
Snippets Groups Projects
Commit 3fac5cd1 authored by Timo Sirainen's avatar Timo Sirainen
Browse files

lib-sieve: storage: ldap: Drop support for ldap_hosts

parent a56a71b5
No related branches found
No related tags found
No related merge requests found
...@@ -107,9 +107,12 @@ have_ldap=no ...@@ -107,9 +107,12 @@ have_ldap=no
if test $want_ldap != no; then if test $want_ldap != no; then
AC_CHECK_LIB(ldap, ldap_init, [ AC_CHECK_LIB(ldap, ldap_init, [
AC_CHECK_HEADER(ldap.h, [ AC_CHECK_HEADER(ldap.h, [
AC_CHECK_LIB(ldap, ldap_initialize, [ AC_CHECK_LIB(ldap, ldap_initialize, :, [
AC_DEFINE(LDAP_HAVE_INITIALIZE,, [Define if you have ldap_initialize]) AC_MSG_ERROR([
]) cannot build with LDAP support: function ldap_initialize() not found
(OpenLDAP >= 2.4 required)
])
], $LDAP_LIBS)
AC_CHECK_LIB(ldap, ldap_start_tls_s, [ AC_CHECK_LIB(ldap, ldap_start_tls_s, [
AC_DEFINE(LDAP_HAVE_START_TLS_S,, [Define if you have ldap_start_tls_s]) AC_DEFINE(LDAP_HAVE_START_TLS_S,, [Define if you have ldap_start_tls_s])
]) ])
......
...@@ -260,9 +260,7 @@ static int db_ldap_connect_finish(struct ldap_connection *conn, int ret) ...@@ -260,9 +260,7 @@ static int db_ldap_connect_finish(struct ldap_connection *conn, int ret)
if (ret == LDAP_SERVER_DOWN) { if (ret == LDAP_SERVER_DOWN) {
e_error(storage->event, "db: " e_error(storage->event, "db: "
"Can't connect to server: %s", "Can't connect to server: %s", set->uris);
*set->uris != '\0' ?
set->uris : set->hosts);
return -1; return -1;
} }
if (ret != LDAP_SUCCESS) { if (ret != LDAP_SUCCESS) {
...@@ -754,24 +752,10 @@ int sieve_ldap_db_connect(struct ldap_connection *conn) ...@@ -754,24 +752,10 @@ int sieve_ldap_db_connect(struct ldap_connection *conn)
i_gettimeofday(&start); i_gettimeofday(&start);
i_assert(conn->pending_count == 0); i_assert(conn->pending_count == 0);
if (conn->ld == NULL) { if (conn->ld == NULL) {
if (*set->uris != '\0') { if (ldap_initialize(&conn->ld, set->uris) != LDAP_SUCCESS) {
#ifdef LDAP_HAVE_INITIALIZE
if (ldap_initialize(&conn->ld,
set->uris) != LDAP_SUCCESS)
conn->ld = NULL;
#else
e_error(storage->event, "db: "
"Your LDAP library doesn't support "
"'uris' setting, use 'hosts' instead.");
return -1;
#endif
} else
conn->ld = ldap_init(set->hosts, LDAP_PORT);
if (conn->ld == NULL) {
e_error(storage->event, "db: " e_error(storage->event, "db: "
"ldap_init() failed with hosts: %s", "ldap_init() failed with uris: %s",
set->hosts); set->uris);
return -1; return -1;
} }
......
...@@ -25,7 +25,6 @@ static bool ...@@ -25,7 +25,6 @@ static bool
sieve_ldap_settings_check(void *_set, pool_t pool, const char **error_r); sieve_ldap_settings_check(void *_set, pool_t pool, const char **error_r);
static const struct setting_define sieve_ldap_setting_defines[] = { static const struct setting_define sieve_ldap_setting_defines[] = {
DEF(STR, hosts),
DEF(STR, uris), DEF(STR, uris),
DEF(STR, dn), DEF(STR, dn),
DEF(STR, dnpass), DEF(STR, dnpass),
...@@ -51,7 +50,6 @@ static const struct setting_define sieve_ldap_setting_defines[] = { ...@@ -51,7 +50,6 @@ static const struct setting_define sieve_ldap_setting_defines[] = {
}; };
const struct sieve_ldap_settings sieve_ldap_default_settings = { const struct sieve_ldap_settings sieve_ldap_default_settings = {
.hosts = "",
.uris = "", .uris = "",
.dn = "", .dn = "",
.dnpass = "", .dnpass = "",
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
struct sieve_ldap_settings { struct sieve_ldap_settings {
pool_t pool; pool_t pool;
const char *hosts;
const char *uris; const char *uris;
const char *dn; const char *dn;
const char *dnpass; const char *dnpass;
......
...@@ -60,7 +60,7 @@ sieve_ldap_storage_init(struct sieve_storage *storage) ...@@ -60,7 +60,7 @@ sieve_ldap_storage_init(struct sieve_storage *storage)
sieve_storage_set_critical(storage, "%s", error); sieve_storage_set_critical(storage, "%s", error);
return -1; return -1;
} }
if (*ldap_set->uris == '\0' && *ldap_set->hosts == '\0') { if (*ldap_set->uris == '\0') {
sieve_storage_set_critical(storage, sieve_storage_set_critical(storage,
"sieve_script %s { ldap_uris / ldap_hosts } not set", "sieve_script %s { ldap_uris / ldap_hosts } not set",
storage->name); storage->name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.