Skip to content

ldap: fix MinGW compiler warning#1664

Closed
MarcelRaad wants to merge 1 commit into
curl:masterfrom
MarcelRaad:ldap_mingw
Closed

ldap: fix MinGW compiler warning#1664
MarcelRaad wants to merge 1 commit into
curl:masterfrom
MarcelRaad:ldap_mingw

Conversation

@MarcelRaad

Copy link
Copy Markdown
Member

ldap_bind_s is marked as deprecated in w32api's winldap.h shipping with
the latest original MinGW, resulting in compiler warnings since commit
f0fe66f. Fix this for the non-SSPI
case by using ldap_simple_bind_s again instead of ldap_bind_s with
LDAP_AUTH_SIMPLE.

ldap_bind_s is marked as deprecated in w32api's winldap.h shipping with
the latest original MinGW, resulting in compiler warnings since commit
f0fe66f. Fix this for the non-SSPI
case by using ldap_simple_bind_s again instead of ldap_bind_s with
LDAP_AUTH_SIMPLE.
@MarcelRaad
MarcelRaad requested a review from snikulov July 8, 2017 15:35
@mention-bot

Copy link
Copy Markdown

@MarcelRaad, thanks for your PR! By analyzing the history of the files in this pull request, we identified @captain-caveman2k, @bagder and @gknauf to be potential reviewers.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.08%) to 76.045% when pulling 3a1cde1 on MarcelRaad:ldap_mingw into a548183 on curl:master.

@snikulov

snikulov commented Jul 8, 2017

Copy link
Copy Markdown
Contributor

@MarcelRaad It is not deprecated in Windows SDK https://msdn.microsoft.com/en-us/library/aa366156(v=vs.85).aspx.

So if you try to solve MinGW problem, could you please use #if defined(MINGW)... or something?

@MarcelRaad

Copy link
Copy Markdown
Member Author

@snikulov Thanks for the comment! Yes, I have that problem only with MinGW (or, to be exact, with w32api, which is MinGW's version of the Windows SDK). But I don't understand what an #ifdef would gain us - do you think there is any downside of always using ldap_simple_bind_s instead of ldap_bind_s(..., LDAP_AUTH_SIMPLE) for simplicity?

(FWIW, ldap_bind_s seems to be deprecated in most implementations - OpenLDAP, IBM, Novell, Mozilla... - with recommendation to either use ldap_simple_bind_s or ldap_sasl_bind_s.)

@jay

jay commented Jul 10, 2017

Copy link
Copy Markdown
Member

Both functions are documented for Vista+ but some searching just now shows them being used on earlier versions. Is one known to be more available than the other?

@snikulov

Copy link
Copy Markdown
Contributor

@MarcelRaad @jay Changes looks good to me. ldap_simple_bind_s <=> ldap_bind_s + LDAP_AUTH_SIMPLE.
So go ahead and merge these changes.

@snikulov snikulov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@MarcelRaad

Copy link
Copy Markdown
Member Author

ldap_simple_bind_s is available unconditionally in the Windows SDK that ships with Visual Studio 2005, which is the lowest version I have access to.

Thanks for the review!

@MarcelRaad
MarcelRaad deleted the ldap_mingw branch July 10, 2017 08:24
@lock lock Bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants