From ef2e26c91b80556af033d3335e55f5dfa6fff31d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Aug 2003 01:53:07 +0000 Subject: first public release of samba4 code (This used to be commit b0510b5428b3461aeb9bbe3cc95f62fc73e2b97f) --- source4/libcli/clireadwrite.c | 155 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 source4/libcli/clireadwrite.c (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c new file mode 100644 index 0000000000..e1d154b283 --- /dev/null +++ b/source4/libcli/clireadwrite.c @@ -0,0 +1,155 @@ +/* + Unix SMB/CIFS implementation. + client file read/write routines + Copyright (C) Andrew Tridgell 1994-1998 + Copyright (C) James Myers 2003 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" + +/**************************************************************************** + Read size bytes at offset offset using SMBreadX. +****************************************************************************/ +ssize_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size) +{ + union smb_read parms; + int readsize; + ssize_t total = 0; + + if (size == 0) { + return 0; + } + + parms.readx.level = RAW_READ_READX; + parms.readx.in.fnum = fnum; + + /* + * Set readsize to the maximum size we can handle in one readX, + * rounded down to a multiple of 1024. + */ + readsize = (cli->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)) & ~1023; + + while (total < size) { + NTSTATUS status; + + readsize = MIN(readsize, size-total); + + parms.readx.in.offset = offset; + parms.readx.in.mincnt = readsize; + parms.readx.in.maxcnt = readsize; + parms.readx.in.remaining = size - total; + parms.readx.out.data = buf + total; + + status = smb_raw_read(cli->tree, &parms); + + if (!NT_STATUS_IS_OK(status)) { + return -1; + } + + total += parms.readx.out.nread; + offset += parms.readx.out.nread; + + /* If the server returned less than we asked for we're at EOF */ + if (parms.readx.out.nread < readsize) + break; + } + + return total; +} + + +/**************************************************************************** + write to a file + write_mode: 0x0001 disallow write cacheing + 0x0002 return bytes remaining + 0x0004 use raw named pipe protocol + 0x0008 start of message mode named pipe protocol +****************************************************************************/ +ssize_t cli_write(struct cli_state *cli, + int fnum, uint16 write_mode, + const char *buf, off_t offset, size_t size) +{ + union smb_write parms; + int block = (cli->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)) & ~1023; + ssize_t total = 0; + + if (size == 0) { + return 0; + } + + parms.writex.level = RAW_WRITE_WRITEX; + parms.writex.in.fnum = fnum; + parms.writex.in.wmode = write_mode; + parms.writex.in.remaining = 0; + + while (total < size) { + NTSTATUS status; + + block = MIN(block, size - total); + + parms.writex.in.offset = offset; + parms.writex.in.count = block; + parms.writex.in.data = buf; + + status = smb_raw_write(cli->tree, &parms); + + if (!NT_STATUS_IS_OK(status)) { + return -1; + } + + offset += parms.writex.out.nwritten; + total += parms.writex.out.nwritten; + buf += parms.writex.out.nwritten; + } + + return total; +} + +/**************************************************************************** + write to a file using a SMBwrite and not bypassing 0 byte writes +****************************************************************************/ +ssize_t cli_smbwrite(struct cli_state *cli, + int fnum, char *buf, off_t offset, size_t size1) +{ + union smb_write parms; + ssize_t total = 0; + + parms.write.level = RAW_WRITE_WRITE; + parms.write.in.remaining = 0; + + do { + size_t size = MIN(size1, cli->transport->negotiate.max_xmit - 48); + + parms.write.in.fnum = fnum; + parms.write.in.offset = offset; + parms.write.in.count = size; + parms.write.in.data = buf + total; + + if (NT_STATUS_IS_ERR(smb_raw_write(cli->tree, &parms))) + return -1; + + size = parms.write.out.nwritten; + if (size == 0) + break; + + size1 -= size; + total += size; + offset += size; + } while (size1); + + return total; +} -- cgit From 4e73a3c0feb47c761fdcded9e6c2ac6d32534d9b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 10 Oct 2003 05:40:32 +0000 Subject: fixed snprintf.c for systems that have only some of the *printf() family of functions cope with servers that return bogus (too large) values in max_xmit cope with a couple more error conditions in RAW-SFILEINFO better startup time heuristics in NBENCH (This used to be commit 89f7261ba589e5760b3cf9c3594eab9d7198dd7e) --- source4/libcli/clireadwrite.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index e1d154b283..1e6c0fc064 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -42,6 +42,7 @@ ssize_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_ * rounded down to a multiple of 1024. */ readsize = (cli->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)) & ~1023; + if (readsize > 0xFFFF) readsize = 0xFFFF; while (total < size) { NTSTATUS status; @@ -91,6 +92,9 @@ ssize_t cli_write(struct cli_state *cli, return 0; } + if (block > 0xFFFF) block = 0xFFFF; + + parms.writex.level = RAW_WRITE_WRITEX; parms.writex.in.fnum = fnum; parms.writex.in.wmode = write_mode; @@ -133,6 +137,7 @@ ssize_t cli_smbwrite(struct cli_state *cli, do { size_t size = MIN(size1, cli->transport->negotiate.max_xmit - 48); + if (size > 0xFFFF) size = 0xFFFF; parms.write.in.fnum = fnum; parms.write.in.offset = offset; -- cgit From 4639eb5a58f8c0906afdc8e8f8f67f82e9547f75 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 8 Feb 2004 00:51:07 +0000 Subject: Convert libcli routines to use cli_tree instead of cli_state. Port smbtorture to use the new interface. Part 2 will be to eliminate cli_state from smbtorture as this is now the only place where it is used. (This used to be commit db1cc96af62ea42837d60592877fc3f93cef143b) --- source4/libcli/clireadwrite.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index 1e6c0fc064..7b47281e2c 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -24,7 +24,8 @@ /**************************************************************************** Read size bytes at offset offset using SMBreadX. ****************************************************************************/ -ssize_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size) +ssize_t cli_read(struct cli_tree *tree, int fnum, char *buf, off_t offset, + size_t size) { union smb_read parms; int readsize; @@ -41,7 +42,8 @@ ssize_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_ * Set readsize to the maximum size we can handle in one readX, * rounded down to a multiple of 1024. */ - readsize = (cli->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)) & ~1023; + readsize = (tree->session->transport->negotiate.max_xmit - + (MIN_SMB_SIZE+32)) & ~1023; if (readsize > 0xFFFF) readsize = 0xFFFF; while (total < size) { @@ -55,7 +57,7 @@ ssize_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_ parms.readx.in.remaining = size - total; parms.readx.out.data = buf + total; - status = smb_raw_read(cli->tree, &parms); + status = smb_raw_read(tree, &parms); if (!NT_STATUS_IS_OK(status)) { return -1; @@ -80,12 +82,12 @@ ssize_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_ 0x0004 use raw named pipe protocol 0x0008 start of message mode named pipe protocol ****************************************************************************/ -ssize_t cli_write(struct cli_state *cli, +ssize_t cli_write(struct cli_tree *tree, int fnum, uint16 write_mode, const char *buf, off_t offset, size_t size) { union smb_write parms; - int block = (cli->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)) & ~1023; + int block = (tree->session->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)) & ~1023; ssize_t total = 0; if (size == 0) { @@ -109,7 +111,7 @@ ssize_t cli_write(struct cli_state *cli, parms.writex.in.count = block; parms.writex.in.data = buf; - status = smb_raw_write(cli->tree, &parms); + status = smb_raw_write(tree, &parms); if (!NT_STATUS_IS_OK(status)) { return -1; @@ -126,7 +128,7 @@ ssize_t cli_write(struct cli_state *cli, /**************************************************************************** write to a file using a SMBwrite and not bypassing 0 byte writes ****************************************************************************/ -ssize_t cli_smbwrite(struct cli_state *cli, +ssize_t cli_smbwrite(struct cli_tree *tree, int fnum, char *buf, off_t offset, size_t size1) { union smb_write parms; @@ -136,7 +138,7 @@ ssize_t cli_smbwrite(struct cli_state *cli, parms.write.in.remaining = 0; do { - size_t size = MIN(size1, cli->transport->negotiate.max_xmit - 48); + size_t size = MIN(size1, tree->session->transport->negotiate.max_xmit - 48); if (size > 0xFFFF) size = 0xFFFF; parms.write.in.fnum = fnum; @@ -144,7 +146,7 @@ ssize_t cli_smbwrite(struct cli_state *cli, parms.write.in.count = size; parms.write.in.data = buf + total; - if (NT_STATUS_IS_ERR(smb_raw_write(cli->tree, &parms))) + if (NT_STATUS_IS_ERR(smb_raw_write(tree, &parms))) return -1; size = parms.write.out.nwritten; -- cgit From f88bf54c7f6d1c2ef833047eb8327953c304b5ff Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 25 May 2004 17:24:24 +0000 Subject: r889: convert samba4 to use [u]int16_t instead of [u]int16 metze (This used to be commit af6f1f8a01bebbecd99bc8c066519e89966e65e3) --- source4/libcli/clireadwrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index 7b47281e2c..e9c8b80c4f 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -83,7 +83,7 @@ ssize_t cli_read(struct cli_tree *tree, int fnum, char *buf, off_t offset, 0x0008 start of message mode named pipe protocol ****************************************************************************/ ssize_t cli_write(struct cli_tree *tree, - int fnum, uint16 write_mode, + int fnum, uint16_t write_mode, const char *buf, off_t offset, size_t size) { union smb_write parms; -- cgit From c5fbb6f23c2d399c7510bc552cdb1a27b1ef66a8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 4 Aug 2004 13:23:35 +0000 Subject: r1654: rename cli_ -> smbcli_ rename CLI_ -> SMBCLI_ metze (This used to be commit 8441750fd9427dd6fe477f27e603821b4026f038) --- source4/libcli/clireadwrite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index e9c8b80c4f..dd9f8d44cc 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -24,7 +24,7 @@ /**************************************************************************** Read size bytes at offset offset using SMBreadX. ****************************************************************************/ -ssize_t cli_read(struct cli_tree *tree, int fnum, char *buf, off_t offset, +ssize_t smbcli_read(struct smbcli_tree *tree, int fnum, char *buf, off_t offset, size_t size) { union smb_read parms; @@ -82,7 +82,7 @@ ssize_t cli_read(struct cli_tree *tree, int fnum, char *buf, off_t offset, 0x0004 use raw named pipe protocol 0x0008 start of message mode named pipe protocol ****************************************************************************/ -ssize_t cli_write(struct cli_tree *tree, +ssize_t smbcli_write(struct smbcli_tree *tree, int fnum, uint16_t write_mode, const char *buf, off_t offset, size_t size) { @@ -128,7 +128,7 @@ ssize_t cli_write(struct cli_tree *tree, /**************************************************************************** write to a file using a SMBwrite and not bypassing 0 byte writes ****************************************************************************/ -ssize_t cli_smbwrite(struct cli_tree *tree, +ssize_t smbcli_smbwrite(struct smbcli_tree *tree, int fnum, char *buf, off_t offset, size_t size1) { union smb_write parms; -- cgit From e64fce8b883a49a8ecb6f0e4d326d3b5f11d2282 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 30 Aug 2004 05:32:00 +0000 Subject: r2101: fixed a signed/unsigned char warning (This used to be commit f5fd90848d350ba1016282a6ee9ea3c83a6e4a63) --- source4/libcli/clireadwrite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index dd9f8d44cc..45c99f4f89 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -83,8 +83,8 @@ ssize_t smbcli_read(struct smbcli_tree *tree, int fnum, char *buf, off_t offset, 0x0008 start of message mode named pipe protocol ****************************************************************************/ ssize_t smbcli_write(struct smbcli_tree *tree, - int fnum, uint16_t write_mode, - const char *buf, off_t offset, size_t size) + int fnum, uint16_t write_mode, + const uint8_t *buf, off_t offset, size_t size) { union smb_write parms; int block = (tree->session->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)) & ~1023; -- cgit From b2df91639065168643ea8b921f24b879daf2e71f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 29 Oct 2004 05:31:35 +0000 Subject: r3352: make smbcli_read() and smbcli_write() work with very small negotiated SMB buffer sizes (This used to be commit 320ca0214d97dc6cebb00ddc98a1eb71e2b4c917) --- source4/libcli/clireadwrite.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index 45c99f4f89..f8220526e3 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -42,8 +42,7 @@ ssize_t smbcli_read(struct smbcli_tree *tree, int fnum, char *buf, off_t offset, * Set readsize to the maximum size we can handle in one readX, * rounded down to a multiple of 1024. */ - readsize = (tree->session->transport->negotiate.max_xmit - - (MIN_SMB_SIZE+32)) & ~1023; + readsize = (tree->session->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)); if (readsize > 0xFFFF) readsize = 0xFFFF; while (total < size) { @@ -87,7 +86,7 @@ ssize_t smbcli_write(struct smbcli_tree *tree, const uint8_t *buf, off_t offset, size_t size) { union smb_write parms; - int block = (tree->session->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)) & ~1023; + int block = (tree->session->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)); ssize_t total = 0; if (size == 0) { -- cgit From 9f1210a243654fd6d94acdef83f468a33c1b3b3f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 1 Nov 2004 01:03:22 +0000 Subject: r3419: moved the libcli/raw structures into libcli/raw/libcliraw.h and made them private (This used to be commit 386ac565c452ede1d74e06acb401ca9db99d3ff3) --- source4/libcli/clireadwrite.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index f8220526e3..6b6cb2f2a2 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -20,6 +20,7 @@ */ #include "includes.h" +#include "libcli/raw/libcliraw.h" /**************************************************************************** Read size bytes at offset offset using SMBreadX. -- cgit From 9112a632f6791ffc3c3c1aadd214cbaba8fe816e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 4 Dec 2004 13:56:25 +0000 Subject: r4063: - change char * -> uint8_t in struct request_buffer - change smbcli_read/write to take void * for the buffers to match read(2)/write(2) all this fixes a lot of gcc-4 warnings metze (This used to be commit b94f92bc6637f748d6f7049f4f9a30b0b8d18a7a) --- source4/libcli/clireadwrite.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index 6b6cb2f2a2..4248ac4286 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -25,9 +25,10 @@ /**************************************************************************** Read size bytes at offset offset using SMBreadX. ****************************************************************************/ -ssize_t smbcli_read(struct smbcli_tree *tree, int fnum, char *buf, off_t offset, +ssize_t smbcli_read(struct smbcli_tree *tree, int fnum, void *_buf, off_t offset, size_t size) { + uint8_t *buf = _buf; union smb_read parms; int readsize; ssize_t total = 0; @@ -84,8 +85,9 @@ ssize_t smbcli_read(struct smbcli_tree *tree, int fnum, char *buf, off_t offset, ****************************************************************************/ ssize_t smbcli_write(struct smbcli_tree *tree, int fnum, uint16_t write_mode, - const uint8_t *buf, off_t offset, size_t size) + const void *_buf, off_t offset, size_t size) { + const uint8_t *buf = _buf; union smb_write parms; int block = (tree->session->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)); ssize_t total = 0; @@ -129,8 +131,9 @@ ssize_t smbcli_write(struct smbcli_tree *tree, write to a file using a SMBwrite and not bypassing 0 byte writes ****************************************************************************/ ssize_t smbcli_smbwrite(struct smbcli_tree *tree, - int fnum, char *buf, off_t offset, size_t size1) + int fnum, const void *_buf, off_t offset, size_t size1) { + const uint8_t *buf = _buf; union smb_write parms; ssize_t total = 0; -- cgit From 307e43bb5628e8b53a930c2928279af994281ba5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 10 Mar 2006 20:49:20 +0000 Subject: r14173: change smb interface structures to always use a union smb_file, to abtract - const char *path fot qpathinfo and setpathinfo - uint16_t fnum for SMB - smb2_handle handle for SMB2 the idea is to later add a struct ntvfs_handle *ntvfs so that the ntvfs subsystem don't need to know the difference between SMB and SMB2 metze (This used to be commit 2ef3f5970901b5accdb50f0d0115b5d46b0c788f) --- source4/libcli/clireadwrite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index 4248ac4286..afffba968a 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -38,7 +38,7 @@ ssize_t smbcli_read(struct smbcli_tree *tree, int fnum, void *_buf, off_t offset } parms.readx.level = RAW_READ_READX; - parms.readx.in.fnum = fnum; + parms.readx.file.fnum = fnum; /* * Set readsize to the maximum size we can handle in one readX, @@ -100,7 +100,7 @@ ssize_t smbcli_write(struct smbcli_tree *tree, parms.writex.level = RAW_WRITE_WRITEX; - parms.writex.in.fnum = fnum; + parms.writex.file.fnum = fnum; parms.writex.in.wmode = write_mode; parms.writex.in.remaining = 0; @@ -144,7 +144,7 @@ ssize_t smbcli_smbwrite(struct smbcli_tree *tree, size_t size = MIN(size1, tree->session->transport->negotiate.max_xmit - 48); if (size > 0xFFFF) size = 0xFFFF; - parms.write.in.fnum = fnum; + parms.write.file.fnum = fnum; parms.write.in.offset = offset; parms.write.in.count = size; parms.write.in.data = buf + total; -- cgit From 7f0c7702f6b9db216fcd6c29165b2a11ea1f24a9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 11 Mar 2006 12:58:36 +0000 Subject: r14208: removed use of req->flags2 inside the ntvfs layer. This should help metze on his quest to unify the ntvfs strucures for the smb and smb2 servers. The only place we needed flags2 inside ntvfs was for the FLAGS2_READ_PERMIT_EXECUTE bit, which only affects readx, so I added a readx.in.read_for_execute flag instead. (This used to be commit b78abbbce60ab0009da19a72dd769800c44298a2) --- source4/libcli/clireadwrite.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index afffba968a..03d1864a5d 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -56,6 +56,7 @@ ssize_t smbcli_read(struct smbcli_tree *tree, int fnum, void *_buf, off_t offset parms.readx.in.mincnt = readsize; parms.readx.in.maxcnt = readsize; parms.readx.in.remaining = size - total; + parms.readx.in.read_for_execute = False; parms.readx.out.data = buf + total; status = smb_raw_read(tree, &parms); -- cgit From a1b295ed4823ce8d06f830b8db9a5d965c934b54 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 12 Mar 2006 22:48:25 +0000 Subject: r14256: - rename smb_file -> smb_handle - move it into the in/out substructs again - allow file.path only on smb_fileinfo/smb_setfileinfo metze (This used to be commit be6d5298a2cdb7e7c61d70471bad445645af5963) --- source4/libcli/clireadwrite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index 03d1864a5d..afffeadeff 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -38,7 +38,7 @@ ssize_t smbcli_read(struct smbcli_tree *tree, int fnum, void *_buf, off_t offset } parms.readx.level = RAW_READ_READX; - parms.readx.file.fnum = fnum; + parms.readx.in.file.fnum = fnum; /* * Set readsize to the maximum size we can handle in one readX, @@ -101,7 +101,7 @@ ssize_t smbcli_write(struct smbcli_tree *tree, parms.writex.level = RAW_WRITE_WRITEX; - parms.writex.file.fnum = fnum; + parms.writex.in.file.fnum = fnum; parms.writex.in.wmode = write_mode; parms.writex.in.remaining = 0; @@ -145,7 +145,7 @@ ssize_t smbcli_smbwrite(struct smbcli_tree *tree, size_t size = MIN(size1, tree->session->transport->negotiate.max_xmit - 48); if (size > 0xFFFF) size = 0xFFFF; - parms.write.file.fnum = fnum; + parms.write.in.file.fnum = fnum; parms.write.in.offset = offset; parms.write.in.count = size; parms.write.in.data = buf + total; -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/libcli/clireadwrite.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index afffeadeff..10a1c75308 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From 6cf69fee189857ae6f85cd3f81a6a58364839942 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Sep 2007 13:31:15 +0000 Subject: r24994: Fix some C++ warnings. (This used to be commit 925abf74fa1ed5ae726bae8781ec549302786b39) --- source4/libcli/clireadwrite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index 10a1c75308..e6e66ef36e 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -27,7 +27,7 @@ ssize_t smbcli_read(struct smbcli_tree *tree, int fnum, void *_buf, off_t offset, size_t size) { - uint8_t *buf = _buf; + uint8_t *buf = (uint8_t *)_buf; union smb_read parms; int readsize; ssize_t total = 0; @@ -87,7 +87,7 @@ ssize_t smbcli_write(struct smbcli_tree *tree, int fnum, uint16_t write_mode, const void *_buf, off_t offset, size_t size) { - const uint8_t *buf = _buf; + const uint8_t *buf = (const uint8_t *)_buf; union smb_write parms; int block = (tree->session->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)); ssize_t total = 0; @@ -133,7 +133,7 @@ ssize_t smbcli_write(struct smbcli_tree *tree, ssize_t smbcli_smbwrite(struct smbcli_tree *tree, int fnum, const void *_buf, off_t offset, size_t size1) { - const uint8_t *buf = _buf; + const uint8_t *buf = (const uint8_t *)_buf; union smb_write parms; ssize_t total = 0; -- cgit From dccf3f99e45137b6cd18c1de1c79808ad67130d1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 13:27:14 +0000 Subject: r25027: Fix more warnings. (This used to be commit 5085c53fcfade614e83d21fc2c1a5bc43bb2a729) --- source4/libcli/clireadwrite.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index e6e66ef36e..89ae157042 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -20,6 +20,7 @@ #include "includes.h" #include "libcli/raw/libcliraw.h" +#include "libcli/libcli.h" /**************************************************************************** Read size bytes at offset offset using SMBreadX. -- cgit From 2151cde58014ea2e822c13d2f8a369b45dc19ca8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:28:14 +0000 Subject: r25554: Convert last instances of BOOL, True and False to the standard types. (This used to be commit 566aa14139510788548a874e9213d91317f83ca9) --- source4/libcli/clireadwrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index 89ae157042..f5ba799bbc 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -56,7 +56,7 @@ ssize_t smbcli_read(struct smbcli_tree *tree, int fnum, void *_buf, off_t offset parms.readx.in.mincnt = readsize; parms.readx.in.maxcnt = readsize; parms.readx.in.remaining = size - total; - parms.readx.in.read_for_execute = False; + parms.readx.in.read_for_execute = false; parms.readx.out.data = buf + total; status = smb_raw_read(tree, &parms); -- cgit From afe3e8172ddaa5e4aa811faceecda4f943d6e2ef Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Apr 2008 04:53:27 +0200 Subject: Install public header files again and include required prototypes. (This used to be commit 47ffbbf67435904754469544390b67d34c958343) --- source4/libcli/clireadwrite.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index f5ba799bbc..ae2367918c 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -20,6 +20,7 @@ #include "includes.h" #include "libcli/raw/libcliraw.h" +#include "libcli/raw/raw_proto.h" #include "libcli/libcli.h" /**************************************************************************** -- cgit