From 87f2925252b910f2f403bdbb3f9158202cb7a2c5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 6 Mar 2008 15:14:08 +0100 Subject: ntvfs: pass down the client capabilities into the ntvfs layer Note that we don't use any protocol specific values here. For now only NTVFS_CLIENT_CAP_LEVEL_II_OPLOCKS is defined others should be defined, when we find out that the ntvfs layer needs to know about it. metze (This used to be commit cc42cd5f6753ca582677fa6f403f0419eec5ab10) --- source4/smb_server/smb/service.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/smb_server/smb') diff --git a/source4/smb_server/smb/service.c b/source4/smb_server/smb/service.c index 35b3653026..52471c09c9 100644 --- a/source4/smb_server/smb/service.c +++ b/source4/smb_server/smb/service.c @@ -36,6 +36,7 @@ static NTSTATUS make_connection_scfg(struct smbsrv_request *req, { struct smbsrv_tcon *tcon; NTSTATUS status; + uint64_t ntvfs_caps = 0; tcon = smbsrv_smb_tcon_new(req->smb_conn, scfg->name); if (!tcon) { @@ -44,9 +45,14 @@ static NTSTATUS make_connection_scfg(struct smbsrv_request *req, } req->tcon = tcon; + if (req->smb_conn->negotiate.client_caps & CAP_LEVEL_II_OPLOCKS) { + ntvfs_caps |= NTVFS_CLIENT_CAP_LEVEL_II_OPLOCKS; + } + /* init ntvfs function pointers */ status = ntvfs_init_connection(tcon, scfg, type, req->smb_conn->negotiate.protocol, + ntvfs_caps, req->smb_conn->connection->event.ctx, req->smb_conn->connection->msg_ctx, req->smb_conn->lp_ctx, -- cgit From 17af5a9f42e2ee8c342b4d20928da5b0e7d00045 Mon Sep 17 00:00:00 2001 From: Amin Azez Date: Fri, 7 Mar 2008 10:55:49 +0000 Subject: Use 32 bit storage for nttrans counts Erroneous 16bit storage for nttrans counts meant that nttrans behaved "strangely" for sizes of over 64K As 32 bit is used in the SMB message and specified in http://us4.samba.org/samba/ftp/specs/draft-leach-cifs-v1-spec-02.txt section 3.13.2 this fix changes storage to match. Signed-off-by: Amin Azez (This used to be commit d66b6c3823f003875e3b7cdf63617a894cceadf9) --- source4/smb_server/smb/nttrans.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source4/smb_server/smb') diff --git a/source4/smb_server/smb/nttrans.c b/source4/smb_server/smb/nttrans.c index f6edc407d6..a20c41ba4d 100644 --- a/source4/smb_server/smb/nttrans.c +++ b/source4/smb_server/smb/nttrans.c @@ -460,7 +460,7 @@ static NTSTATUS nttrans_backend(struct smbsrv_request *req, static void reply_nttrans_send(struct ntvfs_request *ntvfs) { struct smbsrv_request *req; - uint16_t params_left, data_left; + uint32_t params_left, data_left; uint8_t *params, *data; struct smb_nttrans *trans; struct nttrans_op *op; @@ -502,7 +502,7 @@ static void reply_nttrans_send(struct ntvfs_request *ntvfs) /* we need to divide up the reply into chunks that fit into the negotiated buffer size */ do { - uint16_t this_data, this_param, max_bytes; + uint32_t this_data, this_param, max_bytes; uint_t align1 = 1, align2 = (params_left ? 2 : 0); struct smbsrv_request *this_req; @@ -573,9 +573,9 @@ void smbsrv_reply_nttrans(struct smbsrv_request *req) { struct nttrans_op *op; struct smb_nttrans *trans; - uint16_t param_ofs, data_ofs; - uint16_t param_count, data_count; - uint16_t param_total, data_total; + uint32_t param_ofs, data_ofs; + uint32_t param_count, data_count; + uint32_t param_total, data_total; /* parse request */ if (req->in.wct < 19) { -- cgit