Skip to content
Advertisement

Segmentation fault (core dumped) when calling LdapConnection.SendRequest(SearchRequest req) at System.DirectoryServices.Protocols on Ubuntu 18.04.4LTS

When I try to get user information from Active Directory, LdapConnection.SendRequest(SearchRequest req) causes :

Segmentation fault (core dumped)

on an Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-147-generic x86_64).

If I remove the line

searchRequest.TimeLimit = new TimeSpan(0, 1, 0);

LdapPal.SearchDirectory method returns LdapError.TimeOut (-7). and throws :

JavaScript

Below code works without any problem on a Windows.

Verifying username and password by LdapConnection.Bind(new NetworkCredential(username, password, domainName)) works without any problem.

Below is the code:

JavaScript

Configuration

System.DirectoryServices.Protocols version 5.0.0

Runtime : Microsoft.NETCore.App 5.0.7

Target Runtime : portable

Deployment Mode: Portable

Update When using 6.0.0-preview.7.21377.19 version of System.DirectoryServices.Protocols without SearchRequest.TimeLimit property causes :

JavaScript
JavaScript

If I set the searchFilter conditional to operating system, method executes successfully most of the time, even if I don’t set credentials for LDAPConnection object.

However randomly it continues to throw

System.DirectoryServices.Protocols.LdapException: The LDAP server returned an unknown error.

Advertisement

Answer

When I set LdapConnection.SessionOptions.ProtocolVersion to 3, everything worked as expected on Linux also.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement