diff options
author | Guido Günther <agx@sigxcpu.org> | 2021-03-17 16:51:52 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2021-03-17 16:51:52 +0100 |
commit | db74bc456f995a96aad0d7e6099586e240c01da6 (patch) | |
tree | b68122d49e16e6bc0ac283f12d77d8028eeb4d3d | |
parent | 2553a8944228081dd949daefd5660dbaa16f5952 (diff) |
ldap: Add add/delete with timeout
-rw-r--r-- | debian/patches/ldap-Add-add-delete-with-timeout.patch | 45 | ||||
-rw-r--r-- | debian/patches/series | 1 |
2 files changed, 46 insertions, 0 deletions
diff --git a/debian/patches/ldap-Add-add-delete-with-timeout.patch b/debian/patches/ldap-Add-add-delete-with-timeout.patch new file mode 100644 index 0000000..c94f7c1 --- /dev/null +++ b/debian/patches/ldap-Add-add-delete-with-timeout.patch @@ -0,0 +1,45 @@ +From: =?utf-8?q?Guido_G=C3=BCnther?= <agx@sigxcpu.org> +Date: Wed, 17 Mar 2021 16:17:20 +0100 +Subject: ldap: Add add/delete with timeout + +This allows to work with super slow ldap servers. + +(cherry picked from commit 8fdf25981878d9cb1820f6dccf187f877088e758) +--- + src/ldapsp_ldap.erl | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/src/ldapsp_ldap.erl b/src/ldapsp_ldap.erl +index 48b1780..9a9be66 100644 +--- a/src/ldapsp_ldap.erl ++++ b/src/ldapsp_ldap.erl +@@ -28,7 +28,9 @@ + terminate/2, code_change/3, + %% API + add/2, +- delete/1 ++ add/3, ++ delete/1, ++ delete/2 + ]). + + -define(SERVER, ?MODULE). +@@ -39,10 +41,18 @@ + %%% API + %%%=================================================================== + ++-spec add(string(), list(), integer()) -> ok | {error,atom}. ++add(Dn, Attributes, Timeout) -> ++ gen_server:call(?SERVER, {add, Dn, Attributes}, Timeout). ++ + -spec add(string(), list()) -> ok | {error,atom}. + add(Dn, Attributes) -> + gen_server:call(?SERVER, {add, Dn, Attributes}). + ++-spec delete(string(), integer()) -> ok | {error,atom}. ++delete(Dn, Timeout) -> ++ gen_server:call(?SERVER, {delete, Dn}, Timeout). ++ + -spec delete(string()) -> ok | {error,atom}. + delete(Dn) -> + gen_server:call(?SERVER, {delete, Dn}). diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..979ed72 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +ldap-Add-add-delete-with-timeout.patch |