summaryrefslogtreecommitdiff
path: root/Utilities/cmcurl/lib/smb.c
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmcurl/lib/smb.c')
-rw-r--r--Utilities/cmcurl/lib/smb.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/Utilities/cmcurl/lib/smb.c b/Utilities/cmcurl/lib/smb.c
index d493adcc03..dd914a05bf 100644
--- a/Utilities/cmcurl/lib/smb.c
+++ b/Utilities/cmcurl/lib/smb.c
@@ -10,7 +10,7 @@
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -23,11 +23,9 @@
#include "curl_setup.h"
-#if !defined(CURL_DISABLE_SMB) && defined(USE_NTLM) && \
+#if !defined(CURL_DISABLE_SMB) && defined(USE_CURL_NTLM_CORE) && \
(CURL_SIZEOF_CURL_OFF_T > 4)
-#if !defined(USE_WINDOWS_SSPI) || defined(USE_WIN32_CRYPTO)
-
#define BUILDING_CURL_SMB_C
#ifdef HAVE_PROCESS_H
@@ -88,6 +86,7 @@ const struct Curl_handler Curl_handler_smb = {
ZERO_NULL, /* connection_check */
PORT_SMB, /* defport */
CURLPROTO_SMB, /* protocol */
+ CURLPROTO_SMB, /* family */
PROTOPT_NONE /* flags */
};
@@ -113,6 +112,7 @@ const struct Curl_handler Curl_handler_smbs = {
ZERO_NULL, /* connection_check */
PORT_SMBS, /* defport */
CURLPROTO_SMBS, /* protocol */
+ CURLPROTO_SMB, /* family */
PROTOPT_SSL /* flags */
};
#endif
@@ -204,7 +204,7 @@ static void conn_state(struct connectdata *conn, enum smb_conn_state newstate)
static void request_state(struct connectdata *conn,
enum smb_req_state newstate)
{
- struct smb_request *req = conn->data->req.protop;
+ struct smb_request *req = conn->data->req.p.smb;
#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS)
/* For debug purposes */
static const char * const names[] = {
@@ -234,7 +234,7 @@ static CURLcode smb_setup_connection(struct connectdata *conn)
struct smb_request *req;
/* Initialize the request state */
- conn->data->req.protop = req = calloc(1, sizeof(struct smb_request));
+ conn->data->req.p.smb = req = calloc(1, sizeof(struct smb_request));
if(!req)
return CURLE_OUT_OF_MEMORY;
@@ -342,7 +342,7 @@ static void smb_format_message(struct connectdata *conn, struct smb_header *h,
unsigned char cmd, size_t len)
{
struct smb_conn *smbc = &conn->proto.smbc;
- struct smb_request *req = conn->data->req.protop;
+ struct smb_request *req = conn->data->req.p.smb;
unsigned int pid;
memset(h, 0, sizeof(*h));
@@ -505,7 +505,7 @@ static CURLcode smb_send_tree_connect(struct connectdata *conn)
static CURLcode smb_send_open(struct connectdata *conn)
{
- struct smb_request *req = conn->data->req.protop;
+ struct smb_request *req = conn->data->req.p.smb;
struct smb_nt_create msg;
size_t byte_count;
@@ -535,7 +535,7 @@ static CURLcode smb_send_open(struct connectdata *conn)
static CURLcode smb_send_close(struct connectdata *conn)
{
- struct smb_request *req = conn->data->req.protop;
+ struct smb_request *req = conn->data->req.p.smb;
struct smb_close msg;
memset(&msg, 0, sizeof(msg));
@@ -556,7 +556,7 @@ static CURLcode smb_send_tree_disconnect(struct connectdata *conn)
static CURLcode smb_send_read(struct connectdata *conn)
{
- struct smb_request *req = conn->data->req.protop;
+ struct smb_request *req = conn->data->req.p.smb;
curl_off_t offset = conn->data->req.offset;
struct smb_read msg;
@@ -575,7 +575,7 @@ static CURLcode smb_send_read(struct connectdata *conn)
static CURLcode smb_send_write(struct connectdata *conn)
{
struct smb_write *msg;
- struct smb_request *req = conn->data->req.protop;
+ struct smb_request *req = conn->data->req.p.smb;
curl_off_t offset = conn->data->req.offset;
curl_off_t upload_size = conn->data->req.size - conn->data->req.bytecount;
CURLcode result = Curl_get_upload_buffer(conn->data);
@@ -738,7 +738,7 @@ static void get_posix_time(time_t *out, curl_off_t timestamp)
static CURLcode smb_request_state(struct connectdata *conn, bool *done)
{
- struct smb_request *req = conn->data->req.protop;
+ struct smb_request *req = conn->data->req.p.smb;
struct smb_header *h;
struct smb_conn *smbc = &conn->proto.smbc;
enum smb_req_state next_state = SMB_DONE;
@@ -923,7 +923,7 @@ static CURLcode smb_done(struct connectdata *conn, CURLcode status,
bool premature)
{
(void) premature;
- Curl_safefree(conn->data->req.protop);
+ Curl_safefree(conn->data->req.p.smb);
return status;
}
@@ -957,7 +957,7 @@ static CURLcode smb_do(struct connectdata *conn, bool *done)
static CURLcode smb_parse_url_path(struct connectdata *conn)
{
struct Curl_easy *data = conn->data;
- struct smb_request *req = data->req.protop;
+ struct smb_request *req = data->req.p.smb;
struct smb_conn *smbc = &conn->proto.smbc;
char *path;
char *slash;
@@ -996,6 +996,5 @@ static CURLcode smb_parse_url_path(struct connectdata *conn)
return CURLE_OK;
}
-#endif /* !USE_WINDOWS_SSPI || USE_WIN32_CRYPTO */
-
-#endif /* CURL_DISABLE_SMB && USE_NTLM && CURL_SIZEOF_CURL_OFF_T > 4 */
+#endif /* CURL_DISABLE_SMB && USE_CURL_NTLM_CORE &&
+ CURL_SIZEOF_CURL_OFF_T > 4 */