From 397162a47897406a177c7881fe36dcebf82776a2 Mon Sep 17 00:00:00 2001 From: joperator <46897208+joperator@users.noreply.github.com> Date: Mon, 31 Jan 2022 08:50:31 +0100 Subject: [PATCH] Remove library version from libldap and liblber (#149) * Remove library version from libldap and liblber * Add notes about OpenLDAP library finding on Linux --- LdapForNet/Native/NativeMethodsLinux.cs | 4 ++-- README.md | 3 ++- linux.md | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 linux.md diff --git a/LdapForNet/Native/NativeMethodsLinux.cs b/LdapForNet/Native/NativeMethodsLinux.cs index a791656..c6ef13b 100644 --- a/LdapForNet/Native/NativeMethodsLinux.cs +++ b/LdapForNet/Native/NativeMethodsLinux.cs @@ -6,8 +6,8 @@ namespace LdapForNet.Native { internal static class NativeMethodsLinux { - private const string LIB_LDAP_PATH = "ldap-2.4.so.2"; - private const string LIB_LBER_PATH = "lber-2.4.so.2"; + private const string LIB_LDAP_PATH = "ldap.so.2"; + private const string LIB_LBER_PATH = "lber.so.2"; private const string LIB_GNUTLS = "libgnutls.so.30"; internal delegate int LDAP_SASL_INTERACT_PROC(IntPtr ld, uint flags, IntPtr defaults, IntPtr interact); diff --git a/README.md b/README.md index 462cd0a..79fb7c1 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ Help support the project: For Linux\OSX you must ensure you have the latest OpenLDAP client libraries installed from http://www.openldap.org - +For Linux you must also ensure that the appropriate [symlinks for `libldap.so.2` and `liblber.so.2`](linux.md) exist. + It works with any LDAP protocol compatible directory server (including Microsoft Active Directory). Supported paswordless authentication (Kerberos) on all platforms (on Linux\OSX supported SASL GSSAPI (Kerberos) authentication!). diff --git a/linux.md b/linux.md new file mode 100644 index 0000000..136aba5 --- /dev/null +++ b/linux.md @@ -0,0 +1,23 @@ +# Linux: Symlinks for `libldap.so.2` and `liblber.so.2` + +After installing the OpenLDAP client libraries for Linux, you must ensure that the appropriate symlinks `libldap.so.2` and `liblber.so.2` exist in your library directory, which is usually `/lib` or `/usr/lib`. + +They're usually created by default when installing the OpenLDAP client libraries package and refer directly or indirectly to the latest version of the corresponding library located in the same directory, for example: + +```sh +root@linux ~ % ls -l /usr/lib/libldap.so.2 +lrwxrwxrwx 1 root root 10 Jul 18 2021 /usr/lib/libldap.so.2 -> libldap.so +root@linux ~ % ls -l /usr/lib/libldap.so +lrwxrwxrwx 1 root root 21 Jul 18 2021 /usr/lib/libldap.so -> libldap-2.4.so.2.11.7 +root@linux ~ % ls -l /usr/lib/liblber.so.2 +lrwxrwxrwx 1 root root 10 Jul 18 2021 /usr/lib/liblber.so.2 -> liblber.so +root@linux ~ % ls -l /usr/lib/liblber.so +lrwxrwxrwx 1 root root 21 Jul 18 2021 /usr/lib/liblber.so -> liblber-2.4.so.2.11.7 +``` + +If these symlinks do not exist, you can create direct links to the corresponding library using the following commands: + +```sh +root@linux ~ % ln -s /usr/lib/libldap-2.X.so.2.Y.Z /usr/lib/libldap.so.2 +root@linux ~ % ln -s /usr/lib/liblber-2.X.so.2.Y.Z /usr/lib/liblber.so.2 +```