Skip to content

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

Closed

Description

@wyattoday

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

Activity

  1. bagder commented on May 16, 2017

    @bagder
    Member

    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.

  2. bagder commented on May 16, 2017

    @bagder
    Member

    Thanks!

  3. locked as resolved and limited conversation to collaborators on May 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions