Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

fix ldap bindings, fix issue 17248 #2603

Merged
merged 2 commits into from May 23, 2019

Conversation

WebFreak001
Copy link
Member

@WebFreak001 WebFreak001 commented May 11, 2019

Looked up and corrected most LDAP methods:

changed char* (PCHAR) arguments to const(char)* (PCSTR) where documentation says const.

Renamed some types to be the same as in the documentation. (purely aesthetic, fit in with adding the const to the parameters well)

Fixed a PLDAPControlW actually being PLDAPControlA in an ASCII method.

Changed T[] arguments to T* (fixes the referenced issue)

Did not test this with an actual connection yet. The definition is more like in my ldap package on dub now, which works for me.

Looked up and corrected most LDAP methods:
changed char* (PCHAR) arguments to
const(char)* (PCSTR) where documentation say const
Renamed some types like in the documentation (purely aesthetic)
Fixed a PLDAPControlW actually being PLDAPControlA in an ASCII method
Changed [] arguments to * (fixed the referenced issue)
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WebFreak001!

Bugzilla references

Auto-close Bugzilla Severity Description
17248 minor Multiple wrong function definitions in core.sys.windows.winldap (causing runtime issues)

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "stable + druntime#2603"

@dlang-bot dlang-bot added the Bug Fix Include reference to corresponding bugzilla issue label May 11, 2019
ULONG ldap_unbind(LDAP*);
ULONG ldap_unbind_s(LDAP*);
ULONG ldap_search_extA(LDAP*, PCHAR, ULONG, PCHAR, PCHAR[], ULONG,
ULONG ldap_search_extA(LDAP*, PCSTR, ULONG, PCSTR, PZPSTR, ULONG,
PLDAPControlA*, PLDAPControlA*, ULONG, ULONG, ULONG*);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was PLDAPControlW* before even though this is an A method (corrected it to what the docs said this type is)

@thewilsonator
Copy link
Contributor

Please merge when you have had a chance to test.

The modrdn methods are obsolte as per documentation:
https://docs.microsoft.com/en-us/windows/desktop/api/winldap/nf-winldap-ldap_modrdnA

However the ldap_bind methods don't mention anything about deprecation:
https://docs.microsoft.com/en-us/windows/desktop/api/winldap/nf-winldap-ldap_bindA

I think the deprecation might have been added because of the "do not use" message, however you should only not use it if you aren't connected through an encrypted connection. You must use it to authenticate as a user on the server (as also shown in the code example)
@WebFreak001
Copy link
Member Author

WebFreak001 commented May 15, 2019

I undeprecated the ldap_bind functions (they aren't obsolte or deprecated in the documentation) and added a deprecation message to the ldap_modrdn functions to make it clear why they are deprecated.

Otherwise usage works fine now, (connection works, etc.) the [] methods were the only broken methods before and this PR just fixes those and makes the methods allow more inputs (using const)

Also I don't have merge rights in this repo :p

@dlang-bot dlang-bot merged commit e57ecf4 into dlang:stable May 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Fix Include reference to corresponding bugzilla issue
Projects
None yet
3 participants