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

Projects
None yet
2 participants
@wyattoday
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

This comment has been minimized.

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 in 32c27f9 May 16, 2017

@bagder

This comment has been minimized.

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.