diff options
Diffstat (limited to 'source4/smb_server')
-rw-r--r-- | source4/smb_server/smb/reply.c | 24 | ||||
-rw-r--r-- | source4/smb_server/smb/service.c | 3 | ||||
-rw-r--r-- | source4/smb_server/smb2/tcon.c | 14 |
3 files changed, 11 insertions, 30 deletions
diff --git a/source4/smb_server/smb/reply.c b/source4/smb_server/smb/reply.c index 1b309a0c1f..ec7b6783fd 100644 --- a/source4/smb_server/smb/reply.c +++ b/source4/smb_server/smb/reply.c @@ -53,16 +53,6 @@ static void reply_tcon_send(struct ntvfs_request *ntvfs) SMBSRV_CHECK_ASYNC_STATUS(con, union smb_tcon); - if (con->generic.level == RAW_TCON_TCON) { - con->tcon.out.max_xmit = req->smb_conn->negotiate.max_recv; - con->tcon.out.tid = req->tcon->tid; - } else { - /* TODO: take a look at tconx.in.flags! */ - con->tconx.out.tid = req->tcon->tid; - con->tconx.out.dev_type = talloc_strdup(req, req->tcon->ntvfs->dev_type); - con->tconx.out.fs_type = talloc_strdup(req, req->tcon->ntvfs->fs_type); - } - /* construct reply */ smbsrv_setup_reply(req, 2, 0); @@ -109,7 +99,7 @@ void smbsrv_reply_tcon(struct smbsrv_request *req) SMBSRV_SETUP_NTVFS_REQUEST(reply_tcon_send, NTVFS_ASYNC_STATE_MAY_ASYNC); /* Invoke NTVFS connection hook */ - SMBSRV_CALL_NTVFS_BACKEND(ntvfs_connect(req->ntvfs, req->tcon->share_name)); + SMBSRV_CALL_NTVFS_BACKEND(ntvfs_connect(req->ntvfs, con)); } @@ -123,16 +113,6 @@ static void reply_tcon_and_X_send(struct ntvfs_request *ntvfs) SMBSRV_CHECK_ASYNC_STATUS(con, union smb_tcon); - if (con->generic.level == RAW_TCON_TCON) { - con->tcon.out.max_xmit = req->smb_conn->negotiate.max_recv; - con->tcon.out.tid = req->tcon->tid; - } else { - /* TODO: take a look at tconx.in.flags! */ - con->tconx.out.tid = req->tcon->tid; - con->tconx.out.dev_type = talloc_strdup(req, req->tcon->ntvfs->dev_type); - con->tconx.out.fs_type = talloc_strdup(req, req->tcon->ntvfs->fs_type); - } - /* construct reply - two variants */ if (req->smb_conn->negotiate.protocol < PROTOCOL_NT1) { smbsrv_setup_reply(req, 2, 0); @@ -205,7 +185,7 @@ void smbsrv_reply_tcon_and_X(struct smbsrv_request *req) SMBSRV_SETUP_NTVFS_REQUEST(reply_tcon_and_X_send, NTVFS_ASYNC_STATE_MAY_ASYNC); /* Invoke NTVFS connection hook */ - SMBSRV_CALL_NTVFS_BACKEND(ntvfs_connect(req->ntvfs, req->tcon->share_name)); + SMBSRV_CALL_NTVFS_BACKEND(ntvfs_connect(req->ntvfs, con)); } diff --git a/source4/smb_server/smb/service.c b/source4/smb_server/smb/service.c index 85d169fc13..5d8d6bbc32 100644 --- a/source4/smb_server/smb/service.c +++ b/source4/smb_server/smb/service.c @@ -158,7 +158,7 @@ static NTSTATUS make_connection(struct smbsrv_request *req, } /* - backend for tree connect call + backend for tree connect call, in preparation for calling ntvfs_connect() */ NTSTATUS smbsrv_tcon_backend(struct smbsrv_request *req, union smb_tcon *con) { @@ -188,6 +188,7 @@ NTSTATUS smbsrv_tcon_backend(struct smbsrv_request *req, union smb_tcon *con) return status; } + con->tconx.out.tid = req->tcon->tid; con->tconx.out.options = SMB_SUPPORT_SEARCH_BITS | (share_int_option(req->tcon->ntvfs->config, SHARE_CSC_POLICY, SHARE_CSC_POLICY_DEFAULT) << 2); if (share_bool_option(req->tcon->ntvfs->config, SHARE_MSDFS_ROOT, SHARE_MSDFS_ROOT_DEFAULT) && lp_host_msdfs(req->smb_conn->lp_ctx)) { con->tconx.out.options |= SMB_SHARE_IN_DFS; diff --git a/source4/smb_server/smb2/tcon.c b/source4/smb_server/smb2/tcon.c index be64013bb2..843a8dac8d 100644 --- a/source4/smb_server/smb2/tcon.c +++ b/source4/smb_server/smb2/tcon.c @@ -335,13 +335,6 @@ static NTSTATUS smb2srv_tcon_backend(struct smb2srv_request *req, union smb_tcon goto failed; } - /* Invoke NTVFS connection hook */ - status = ntvfs_connect(req->ntvfs, scfg->name); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(0,("smb2srv_tcon_backend: NTVFS ntvfs_connect() failed!\n")); - goto failed; - } - io->smb2.out.share_type = (unsigned)type; /* 1 - DISK, 2 - Print, 3 - IPC */ io->smb2.out.reserved = 0; io->smb2.out.flags = 0x00000000; @@ -350,6 +343,13 @@ static NTSTATUS smb2srv_tcon_backend(struct smb2srv_request *req, union smb_tcon io->smb2.out.tid = tcon->tid; + /* Invoke NTVFS connection hook */ + status = ntvfs_connect(req->ntvfs, io); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0,("smb2srv_tcon_backend: NTVFS ntvfs_connect() failed!\n")); + goto failed; + } + return NT_STATUS_OK; failed: |