From f39a1c97d0442327d2a073d71da50d177a99c21e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chrz=C4=85szcz?= Date: Thu, 12 May 2022 09:14:51 +0200 Subject: [PATCH] Use eldap.hrl from OTP The custom one got out of date in OTP 24.3 and the code stopped working. It is better to use the original one. --- include/eldap.hrl | 41 --------------------------------- src/auth/ejabberd_auth_ldap.erl | 2 +- src/eldap_pool.erl | 3 +-- src/eldap_utils.erl | 3 --- src/mod_shared_roster_ldap.erl | 4 +--- src/mongoose_ldap_worker.erl | 1 - src/vcard/mod_vcard_ldap.erl | 2 +- 7 files changed, 4 insertions(+), 52 deletions(-) delete mode 100644 include/eldap.hrl diff --git a/include/eldap.hrl b/include/eldap.hrl deleted file mode 100644 index 3ff9dd71567..00000000000 --- a/include/eldap.hrl +++ /dev/null @@ -1,41 +0,0 @@ -%%%---------------------------------------------------------------------- -%%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne -%%% -%%% This program is free software; you can redistribute it and/or -%%% modify it under the terms of the GNU General Public License as -%%% published by the Free Software Foundation; either version 2 of the -%%% License, or (at your option) any later version. -%%% -%%% This program is distributed in the hope that it will be useful, -%%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -%%% General Public License for more details. -%%% -%%% You should have received a copy of the GNU General Public License -%%% along with this program; if not, write to the Free Software -%%% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -%%% -%%%---------------------------------------------------------------------- - --define(LDAP_PORT, 389). - --define(LDAPS_PORT, 636). - --type scope() :: baseObject | singleLevel | wholeSubtree. - --record(eldap_search, - {scope = wholeSubtree, - base = <<"">>, - filter, - limit = 0, - attributes = [], - types_only = false, - deref_aliases = neverDerefAliases, - timeout = 0}). - --record(eldap_search_result, {entries = [] :: [eldap:eldap_entry()], - referrals = [] :: iodata()}). - --record(eldap_entry, {object_name = <<>> :: iodata(), - attributes = [] :: [{iodata(), [iodata()]}]}). diff --git a/src/auth/ejabberd_auth_ldap.erl b/src/auth/ejabberd_auth_ldap.erl index 585d7a7275d..7a4e24684c4 100644 --- a/src/auth/ejabberd_auth_ldap.erl +++ b/src/auth/ejabberd_auth_ldap.erl @@ -56,7 +56,7 @@ -ignore_xref([start_link/1]). -include("mongoose_config_spec.hrl"). --include("eldap.hrl"). +-include_lib("eldap/include/eldap.hrl"). -record(state, {host_type :: mongooseim:host_type(), diff --git a/src/eldap_pool.erl b/src/eldap_pool.erl index 66d4e7201ec..29bc320c5f3 100644 --- a/src/eldap_pool.erl +++ b/src/eldap_pool.erl @@ -30,8 +30,7 @@ %% API -export([bind/3, search/2, delete/2, add/3, modify_passwd/3]). -import(eldap_utils, [maybe_b2list/1]). --include("mongoose.hrl"). --include("eldap.hrl"). +-include_lib("eldap/include/eldap.hrl"). %%==================================================================== %% API diff --git a/src/eldap_utils.erl b/src/eldap_utils.erl index a8c6c42a7c6..fb7610552d0 100644 --- a/src/eldap_utils.erl +++ b/src/eldap_utils.erl @@ -45,9 +45,6 @@ -ignore_xref([decode_octet_string/3, generate_subfilter/1, make_filter/2, uids_domain_subst/2]). --include("mongoose.hrl"). --include("eldap.hrl"). - -type dn() :: binary(). -type deref() :: neverDerefAliases | derefInSearching | derefFindingBaseObj | derefAlways. diff --git a/src/mod_shared_roster_ldap.erl b/src/mod_shared_roster_ldap.erl index ffac8d703d2..a2c5778a470 100644 --- a/src/mod_shared_roster_ldap.erl +++ b/src/mod_shared_roster_ldap.erl @@ -46,12 +46,10 @@ -ignore_xref([config_change/4, get_jid_info/4, get_subscription_lists/2, get_user_roster/2, in_subscription/5, out_subscription/4, process_item/2, start_link/2]). --include("mongoose.hrl"). -include("jlib.hrl"). -include("mod_roster.hrl"). -include("mongoose_config_spec.hrl"). - --include("eldap.hrl"). +-include_lib("eldap/include/eldap.hrl"). -define(CACHE_SIZE, 1000). diff --git a/src/mongoose_ldap_worker.erl b/src/mongoose_ldap_worker.erl index 022e58fef40..bc301f2c7f1 100644 --- a/src/mongoose_ldap_worker.erl +++ b/src/mongoose_ldap_worker.erl @@ -11,7 +11,6 @@ code_change/3]). -include("mongoose.hrl"). --include("eldap.hrl"). -type state() :: #{handle := none | eldap:handle(), servers := [string()], diff --git a/src/vcard/mod_vcard_ldap.erl b/src/vcard/mod_vcard_ldap.erl index a310e3b9d98..11b6db70e9d 100644 --- a/src/vcard/mod_vcard_ldap.erl +++ b/src/vcard/mod_vcard_ldap.erl @@ -42,7 +42,7 @@ default_search_fields/0, default_search_reported/0]). --include("eldap.hrl"). +-include_lib("eldap/include/eldap.hrl"). -include("mod_vcard.hrl"). -include("jlib.hrl").