summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/smb.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2022-06-10 01:53:35 +0300
committerdartraiden <wowemuh@gmail.com>2022-06-10 02:24:49 +0300
commit39de82f0732a81d4dc96197bab4ca585a52c353a (patch)
tree8755c2bc4e9779166f30484f2d94c97c87e910a5 /libs/libcurl/src/smb.c
parent3c5f696829216c7a113f71ff9099178c11817aca (diff)
libcurl: update to 7.83.1
Diffstat (limited to 'libs/libcurl/src/smb.c')
-rw-r--r--libs/libcurl/src/smb.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/libs/libcurl/src/smb.c b/libs/libcurl/src/smb.c
index fd49cf6aaf..8f44704a2c 100644
--- a/libs/libcurl/src/smb.c
+++ b/libs/libcurl/src/smb.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 2016 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 2016 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 2014, Bill Nagel <wnagel@tycoint.com>, Exacq Technologies
*
* This software is licensed as described in the file COPYING, which
@@ -262,7 +262,7 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done)
(void) done;
/* Check we have a username and password to authenticate with */
- if(!conn->bits.user_passwd)
+ if(!data->state.aptr.user)
return CURLE_LOGIN_DENIED;
/* Initialize the connection state */
@@ -299,6 +299,7 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done)
static CURLcode smb_recv_message(struct Curl_easy *data, void **msg)
{
struct connectdata *conn = data->conn;
+ curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
struct smb_conn *smbc = &conn->proto.smbc;
char *buf = smbc->recv_buf;
ssize_t bytes_read;
@@ -307,7 +308,7 @@ static CURLcode smb_recv_message(struct Curl_easy *data, void **msg)
size_t len = MAX_MESSAGE_SIZE - smbc->got;
CURLcode result;
- result = Curl_read(data, FIRSTSOCKET, buf + smbc->got, len, &bytes_read);
+ result = Curl_read(data, sockfd, buf + smbc->got, len, &bytes_read);
if(result)
return result;
@@ -377,11 +378,12 @@ static CURLcode smb_send(struct Curl_easy *data, ssize_t len,
size_t upload_size)
{
struct connectdata *conn = data->conn;
+ curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
struct smb_conn *smbc = &conn->proto.smbc;
ssize_t bytes_written;
CURLcode result;
- result = Curl_write(data, FIRSTSOCKET, data->state.ulbuf,
+ result = Curl_write(data, sockfd, data->state.ulbuf,
len, &bytes_written);
if(result)
return result;
@@ -399,6 +401,7 @@ static CURLcode smb_send(struct Curl_easy *data, ssize_t len,
static CURLcode smb_flush(struct Curl_easy *data)
{
struct connectdata *conn = data->conn;
+ curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
struct smb_conn *smbc = &conn->proto.smbc;
ssize_t bytes_written;
ssize_t len = smbc->send_size - smbc->sent;
@@ -407,7 +410,7 @@ static CURLcode smb_flush(struct Curl_easy *data)
if(!smbc->send_size)
return CURLE_OK;
- result = Curl_write(data, FIRSTSOCKET,
+ result = Curl_write(data, sockfd,
data->state.ulbuf + smbc->sent,
len, &bytes_written);
if(result)
@@ -459,14 +462,10 @@ static CURLcode smb_send_setup(struct Curl_easy *data)
if(byte_count > sizeof(msg.bytes))
return CURLE_FILESIZE_EXCEEDED;
- Curl_ntlm_core_mk_lm_hash(data, conn->passwd, lm_hash);
+ Curl_ntlm_core_mk_lm_hash(conn->passwd, lm_hash);
Curl_ntlm_core_lm_resp(lm_hash, smbc->challenge, lm);
-#ifdef USE_NTRESPONSES
- Curl_ntlm_core_mk_nt_hash(data, conn->passwd, nt_hash);
+ Curl_ntlm_core_mk_nt_hash(conn->passwd, nt_hash);
Curl_ntlm_core_lm_resp(nt_hash, smbc->challenge, nt);
-#else
- memset(nt, 0, sizeof(nt));
-#endif
memset(&msg, 0, sizeof(msg));
msg.word_count = SMB_WC_SETUP_ANDX;
@@ -989,7 +988,7 @@ static CURLcode smb_parse_url_path(struct Curl_easy *data,
char *slash;
/* URL decode the path */
- CURLcode result = Curl_urldecode(data, data->state.up.path, 0, &path, NULL,
+ CURLcode result = Curl_urldecode(data->state.up.path, 0, &path, NULL,
REJECT_CTRL);
if(result)
return result;