Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile libCurl with CURL_DISABLE_CRYPTO_AUTH and USE_NTLM causes curl_sasl.c to fail to compile #1487

Closed
wyattoday opened this issue May 16, 2017 · 2 comments

Comments

@wyattoday
Copy link
Contributor

wyattoday commented May 16, 2017

I did this

Defined both CURL_DISABLE_CRYPTO_AUTH and USE_NTLM.

I expected the following

A successful compilation. Instead I got an error saying "serverdata" was undefined (because it was being "defined" out).

curl/libcurl version

7.54.0

operating system

Windows, Visual Studio 2017.

Solution:

In curl_sasl.c, around line 417-ish (in Curl_sasl_continue() ), move char *serverdata; outside of the the #if !defined(CURL_DISABLE_CRYPTO_AUTH) define.

Or, alternatively, replace this:

#if !defined(CURL_DISABLE_CRYPTO_AUTH)
  char *serverdata;
  char *chlg = NULL;
  size_t chlglen = 0;
#endif

With this:

#if !defined(CURL_DISABLE_CRYPTO_AUTH) || defined(USE_NTLM) || defined(USE_KERBEROS5)
  char *serverdata;
#endif

#if !defined(CURL_DISABLE_CRYPTO_AUTH)
  char *chlg = NULL;
  size_t chlglen = 0;
#endif
@bagder
Copy link
Member

bagder commented May 16, 2017

Ah yes, thanks! A third alternative would be to declare serverdata in every instance. I'll do the first version since it makes the code nicer than the second, and the "unused variable" warning it may create for some combination of disabled features is still harmless.

@bagder bagder closed this as completed in 32c27f9 May 16, 2017
@bagder
Copy link
Member

bagder commented May 16, 2017

Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants