[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 85/282: ntlm: Pass the Curl_easy structure to the private winbin
From: |
gnunet |
Subject: |
[gnurl] 85/282: ntlm: Pass the Curl_easy structure to the private winbind functions |
Date: |
Wed, 01 Apr 2020 14:29:10 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit b765cb3c81f88ffbfb5138a9004f1692af413b06
Author: Steve Holme <address@hidden>
AuthorDate: Wed May 8 09:36:51 2019 +0100
ntlm: Pass the Curl_easy structure to the private winbind functions
...rather than the full conndata structure.
---
lib/curl_ntlm_wb.c | 35 +++++++++++++++++++++--------------
1 file changed, 21 insertions(+), 14 deletions(-)
diff --git a/lib/curl_ntlm_wb.c b/lib/curl_ntlm_wb.c
index 3d991b4c5..25233c936 100644
--- a/lib/curl_ntlm_wb.c
+++ b/lib/curl_ntlm_wb.c
@@ -112,7 +112,7 @@ static void ntlm_wb_cleanup(struct ntlmdata *ntlm)
Curl_safefree(ntlm->response);
}
-static CURLcode ntlm_wb_init(struct connectdata *conn, struct ntlmdata *ntlm,
+static CURLcode ntlm_wb_init(struct Curl_easy *data, struct ntlmdata *ntlm,
const char *userp)
{
curl_socket_t sockfds[2];
@@ -127,6 +127,10 @@ static CURLcode ntlm_wb_init(struct connectdata *conn,
struct ntlmdata *ntlm,
#endif
char buffer[STRERROR_LEN];
+#if defined(CURL_DISABLE_VERBOSE_STRINGS)
+ (void) data;
+#endif
+
/* Return if communication with ntlm_auth already set up */
if(ntlm->ntlm_auth_hlpr_socket != CURL_SOCKET_BAD ||
ntlm->ntlm_auth_hlpr_pid)
@@ -180,13 +184,13 @@ static CURLcode ntlm_wb_init(struct connectdata *conn,
struct ntlmdata *ntlm,
ntlm_auth = NTLM_WB_FILE;
if(access(ntlm_auth, X_OK) != 0) {
- failf(conn->data, "Could not access ntlm_auth: %s errno %d: %s",
+ failf(data, "Could not access ntlm_auth: %s errno %d: %s",
ntlm_auth, errno, Curl_strerror(errno, buffer, sizeof(buffer)));
goto done;
}
if(socketpair(AF_UNIX, SOCK_STREAM, 0, sockfds)) {
- failf(conn->data, "Could not open socket pair. errno %d: %s",
+ failf(data, "Could not open socket pair. errno %d: %s",
errno, Curl_strerror(errno, buffer, sizeof(buffer)));
goto done;
}
@@ -195,7 +199,7 @@ static CURLcode ntlm_wb_init(struct connectdata *conn,
struct ntlmdata *ntlm,
if(child_pid == -1) {
sclose(sockfds[0]);
sclose(sockfds[1]);
- failf(conn->data, "Could not fork. errno %d: %s",
+ failf(data, "Could not fork. errno %d: %s",
errno, Curl_strerror(errno, buffer, sizeof(buffer)));
goto done;
}
@@ -207,13 +211,13 @@ static CURLcode ntlm_wb_init(struct connectdata *conn,
struct ntlmdata *ntlm,
/* Don't use sclose in the child since it fools the socket leak detector */
sclose_nolog(sockfds[0]);
if(dup2(sockfds[1], STDIN_FILENO) == -1) {
- failf(conn->data, "Could not redirect child stdin. errno %d: %s",
+ failf(data, "Could not redirect child stdin. errno %d: %s",
errno, Curl_strerror(errno, buffer, sizeof(buffer)));
exit(1);
}
if(dup2(sockfds[1], STDOUT_FILENO) == -1) {
- failf(conn->data, "Could not redirect child stdout. errno %d: %s",
+ failf(data, "Could not redirect child stdout. errno %d: %s",
errno, Curl_strerror(errno, buffer, sizeof(buffer)));
exit(1);
}
@@ -233,7 +237,7 @@ static CURLcode ntlm_wb_init(struct connectdata *conn,
struct ntlmdata *ntlm,
NULL);
sclose_nolog(sockfds[1]);
- failf(conn->data, "Could not execl(). errno %d: %s",
+ failf(data, "Could not execl(). errno %d: %s",
errno, Curl_strerror(errno, buffer, sizeof(buffer)));
exit(1);
}
@@ -254,13 +258,16 @@ done:
/* if larger than this, something is seriously wrong */
#define MAX_NTLM_WB_RESPONSE 100000
-static CURLcode ntlm_wb_response(struct connectdata *conn,
- struct ntlmdata *ntlm, const char *input,
- curlntlm state)
+static CURLcode ntlm_wb_response(struct Curl_easy *data, struct ntlmdata *ntlm,
+ const char *input, curlntlm state)
{
char *buf = malloc(NTLM_BUFSIZE);
size_t len_in = strlen(input), len_out = 0;
+#if defined(CURL_DISABLE_VERBOSE_STRINGS)
+ (void) data;
+#endif
+
if(!buf)
return CURLE_OUT_OF_MEMORY;
@@ -297,7 +304,7 @@ static CURLcode ntlm_wb_response(struct connectdata *conn,
}
if(len_out > MAX_NTLM_WB_RESPONSE) {
- failf(conn->data, "too large ntlm_wb response!");
+ failf(data, "too large ntlm_wb response!");
free(buf);
return CURLE_OUT_OF_MEMORY;
}
@@ -435,10 +442,10 @@ CURLcode Curl_output_ntlm_wb(struct connectdata *conn,
* request handling process.
*/
/* Create communication with ntlm_auth */
- res = ntlm_wb_init(conn, ntlm, userp);
+ res = ntlm_wb_init(conn->data, ntlm, userp);
if(res)
return res;
- res = ntlm_wb_response(conn, ntlm, "YR\n", *state);
+ res = ntlm_wb_response(conn->data, ntlm, "YR\n", *state);
if(res)
return res;
@@ -456,7 +463,7 @@ CURLcode Curl_output_ntlm_wb(struct connectdata *conn,
char *input = aprintf("TT %s\n", ntlm->challenge);
if(!input)
return CURLE_OUT_OF_MEMORY;
- res = ntlm_wb_response(conn, ntlm, input, *state);
+ res = ntlm_wb_response(conn->data, ntlm, input, *state);
free(input);
if(res)
return res;
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 67/282: location.d: the method change is from POST to GET only, (continued)
- [gnurl] 67/282: location.d: the method change is from POST to GET only, gnunet, 2020/04/01
- [gnurl] 84/282: RELEASE-NOTES: synced, gnunet, 2020/04/01
- [gnurl] 86/282: docs/HTTP3: update the OpenSSL branch to use for ngtcp2, gnunet, 2020/04/01
- [gnurl] 66/282: urlapi: guess scheme correct even with credentials given, gnunet, 2020/04/01
- [gnurl] 70/282: KNOWN_BUGS: Multiple methods in a single WWW-Authenticate: header, gnunet, 2020/04/01
- [gnurl] 69/282: oauth2-bearer.d: works for HTTP too, gnunet, 2020/04/01
- [gnurl] 78/282: cirrus: Add some missing semicolons, gnunet, 2020/04/01
- [gnurl] 71/282: cookie: check __Secure- and __Host- case sensitively, gnunet, 2020/04/01
- [gnurl] 79/282: travis: update non-OpenSSL Linux jobs to Bionic, gnunet, 2020/04/01
- [gnurl] 77/282: cleanup: fix typos and wording in docs and comments, gnunet, 2020/04/01
- [gnurl] 85/282: ntlm: Pass the Curl_easy structure to the private winbind functions,
gnunet <=
- [gnurl] 97/282: ntlm_wb: Use Curl_socketpair() for greater portability, gnunet, 2020/04/01
- [gnurl] 87/282: ngtcp2: fixed to only use AF_INET6 when ENABLE_IPV6, gnunet, 2020/04/01
- [gnurl] 90/282: RELEASE-PROCEDURE: feature win is closed post-release a few days, gnunet, 2020/04/01
- [gnurl] 89/282: altsvc: set h3 version at a common single spot, gnunet, 2020/04/01
- [gnurl] 96/282: contributors: Also include people who contributed to curl-www, gnunet, 2020/04/01
- [gnurl] 88/282: altsvc: improved header parser, gnunet, 2020/04/01
- [gnurl] 104/282: asyn-thread: remove dead code, gnunet, 2020/04/01
- [gnurl] 92/282: curl: error on --alt-svc use w/o support, gnunet, 2020/04/01
- [gnurl] 99/282: ftp: remove the duplicated user/password struct fields, gnunet, 2020/04/01
- [gnurl] 91/282: docs/HTTP3: add --enable-alt-svc to curl's configure, gnunet, 2020/04/01