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

NTLM authentication fails when using proxy without username and password #5914

Closed
wants to merge 1 commit into from
Closed

Conversation

ustcqidi
Copy link

@ustcqidi ustcqidi commented Sep 5, 2020

try to fix the issue #5911

@bagder
Copy link
Member

bagder commented Sep 5, 2020

Except for the compiler warnings it seems reasonable:

url.c:2385:9: error: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
  char *proxyuser = data->set.str[STRING_PROXYUSERNAME] ? data->set.str[STRING_PROXYUSERNAME] : "";
        ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
url.c:2386:9: error: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
  char *proxypasswd = data->set.str[STRING_PROXYPASSWORD] ? data->set.str[STRING_PROXYPASSWORD] : "";
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@bagder bagder changed the title NTLM Authenticate always failed in curl 7.71.1 if Use proxy without username and password NTLM authentication fails when using proxy without username and password Sep 5, 2020
@ustcqidi
Copy link
Author

ustcqidi commented Sep 6, 2020

Except for the compiler warnings it seems reasonable:

url.c:2385:9: error: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
  char *proxyuser = data->set.str[STRING_PROXYUSERNAME] ? data->set.str[STRING_PROXYUSERNAME] : "";
        ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
url.c:2386:9: error: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
  char *proxypasswd = data->set.str[STRING_PROXYPASSWORD] ? data->set.str[STRING_PROXYPASSWORD] : "";
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@bagder thanks for your review, I have updated the patch. Could you please help to review it again? Many thanks.

@bagder
Copy link
Member

bagder commented Sep 7, 2020

The CI builds still complain (run make checksrc to detect these yourself):

./url.c:2385:106: warning: Longer than 79 columns (LONGLINE)
   const char *proxyuser = data->set.str[STRING_PROXYUSERNAME] ? data->set.str[STRING_PROXYUSERNAME] : "";
./url.c:2386:108: warning: Longer than 79 columns (LONGLINE)
   const char *proxypasswd = data->set.str[STRING_PROXYPASSWORD] ? data->set.str[STRING_PROXYPASSWORD] : "";
checksrc: 0 errors and 2 warnings

@ustcqidi
Copy link
Author

ustcqidi commented Sep 7, 2020

Have fixed the warning and verified with checksrc.bat. thanks @bagder

@ghost
Copy link

ghost commented Sep 7, 2020

DeepCode failed to analyze this pull request

Something went wrong despite trying multiple times, sorry about that.
Please comment this pull request with "Retry DeepCode" to manually retry, or contact us so that a human can look into the issue.

1 similar comment
@ghost
Copy link

ghost commented Sep 7, 2020

DeepCode failed to analyze this pull request

Something went wrong despite trying multiple times, sorry about that.
Please comment this pull request with "Retry DeepCode" to manually retry, or contact us so that a human can look into the issue.

@bagder
Copy link
Member

bagder commented Sep 7, 2020

Thanks!

@bagder bagder closed this in 3532262 Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants