ldap: support empty username and password#22196
Open
jay wants to merge 2 commits into
Open
Conversation
Prior to this change an empty username or password was passed to the LDAP bind function as NULL instead of an empty string. Regression since 8f71d0f. Reported-by: Yoshiro Yoneya Fixes curl#22162 Closes #xxxx
Member
Author
|
I'm not entirely sure my use of Curl_creds_user/passwd was correct because if credentials doesn't exist then an empty username and password would be used. But if there are no credentials, then the user didn't specify an empty user pass right? Lines 80 to 81 in 68720b4 To really get the old behavior there doesn't seem to be a macro for that, so I'm changing my proposal: diff --git a/lib/ldap.c b/lib/ldap.c
index e385245..ae12727 100644
--- a/lib/ldap.c
+++ b/lib/ldap.c
@@ -282,8 +282,8 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
#else
char *host = NULL;
#endif
- const char *user = Curl_creds_user(data->state.creds);
- const char *passwd = Curl_creds_passwd(data->state.creds);
+ const char *user = data->state.creds ? data->state.creds->user : NULL;
+ const char *passwd = data->state.creds ? data->state.creds->passwd : NULL;
struct ip_quadruple ipquad;
bool is_ipv6;
BerElement *ber = NULL; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prior to this change an empty username or password was passed to the LDAP bind function as NULL instead of an empty string.
Regression since 8f71d0f.
Reported-by: Yoshiro Yoneya
Fixes #22162
Closes #xxxx