summaryrefslogtreecommitdiffstats
path: root/source/libsmb/clireadwrite.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Add async cli_pull support"Volker Lendecke2008-03-031-425/+0
| | | | | This reverts commit 844a163458c7585e4306a21ffdae5d08e03d6e4d. (cherry picked from commit 5ab1cfda500de07ff3c712442ab2fc74eecc8886)
* Revert "Convert cli_read to use cli_pull"Volker Lendecke2008-03-031-15/+163
| | | | | This reverts commit 719527f55e88f0c5fdceda5c807475aba299c79f. (cherry picked from commit ac301fada257e2d3b50148109a3d44fa1421b0b4)
* Convert cli_read to use cli_pullVolker Lendecke2008-02-281-163/+15
|
* Add async cli_pull supportVolker Lendecke2008-02-281-0/+425
| | | | | | | | | | | | This is the big (and potentially controversial) one. It took a phone call to explain to metze what is going on inside cli_pull_read_done, but I would really like everybody to understand this function. It is a very good and reasonably complex example of async programming. If we want more asynchronism in s3, this is what we will have to deal with :-) Make use of it in the smbclient "get" command. Volker
* Fix bug found by Derrell - windows returns an read returnJeremy Allison2008-01-161-21/+28
| | | | | | offset of zero if return size is zero. Should fix testread libsmbclient code. Jeremy.
* Windows insists on write sizes < max_xmit on signed connections.Jeremy Allison2008-01-141-3/+6
| | | | Jeremy.
* Add SMB encryption. Still fixing client decrypt butJeremy Allison2007-12-261-14/+17
| | | | | negotiation works. Jeremy.
* Ensure we don't use massive writes in pipe mode.Jeremy Allison2007-11-061-2/+3
| | | | Jeremy.
* Change the client library to write directly out ofJeremy Allison2007-11-021-32/+74
| | | | | | | the incoming buffer in the non-signed case. Speeds up writes by over 10% or so. Complete the server recvfile implementation. Jeremy.
* Our userlevel SMBwriteX call is non-standard in that itJeremy Allison2007-10-301-8/+10
| | | | | | | | | sometimes uses a 12-word write and doesn't include a pad byte (as Windows does). Fix this so that we are identical to Windows clients. This will make recvfile processing much easier to detect (as we can just read a standard writeX header length to decide). Jeremy.
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-7/+7
| | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy.
* [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.samba-misc-tags/initial-v3-2-testGerald (Jerry) Carter2007-10-101-8/+6
|
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
|
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | Jeremy.
* r23148: Fix old old bug in cli_smbwrite() (not incrementingJeremy Allison2007-10-101-1/+1
| | | | | data being sent). Patch from mnix@wanm.com.au. Jeremy.
* r22920: Add in the UNIX capability for 24-bit readX, as discussedJeremy Allison2007-10-101-10/+40
| | | | | | with the Apple guys and Linux kernel guys. Still looking at how to do writeX as there's no recvfile(). Jeremy.
* r22391: Looks bigger than it is. Make "inbuf" availableJeremy Allison2007-10-101-5/+5
| | | | | | | to all callers of smb_setlen (via set_message() calls). This will allow the server to reflect back the correct encryption context. Jeremy.
* r17333: Some C++ warningsVolker Lendecke2007-10-101-2/+2
|
* r15162: Patch for bug #3668. Windows has a bug with LARGE_READXJeremy Allison2007-10-101-1/+5
| | | | | where if you ask for exactly 64k bytes it returns 0. Jeremy.
* r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison2007-10-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | realloc can return NULL in one of two cases - (1) the realloc failed, (2) realloc succeeded but the new size requested was zero, in which case this is identical to a free() call. The error paths dealing with these two cases should be different, but mostly weren't. Secondly the standard idiom for dealing with realloc when you know the new size is non-zero is the following : tmp = realloc(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } However, there were *many* *many* places in Samba where we were using the old (broken) idiom of : p = realloc(p, size) if (!p) { return error; } which will leak the memory pointed to by p on realloc fail. This commit (hopefully) fixes all these cases by moving to a standard idiom of : p = SMB_REALLOC(p, size) if (!p) { return error; } Where if the realloc returns null due to the realloc failing or size == 0 we *guarentee* that the storage pointed to by p has been freed. This allows me to remove a lot of code that was dealing with the standard (more verbose) method that required a tmp pointer. This is almost always what you want. When a realloc fails you never usually want the old memory, you want to free it and get into your error processing asap. For the 11 remaining cases where we really do need to keep the old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR, which can be used as follows : tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the pointer p, even on size == 0 or realloc fail. All this is done by a hidden extra argument to Realloc(), BOOL free_old_on_error which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR macros (and their array counterparts). It remains to be seen what this will do to our Coverity bug count :-). Jeremy.
* r13119: Fix for #1779 from William Jojo <jojowil@hvcc.edu>Jeremy Allison2007-10-101-4/+6
| | | | Jeremy.
* r10656: BIG merge from trunk. Features not copied overGerald Carter2007-10-101-6/+6
| | | | | | | * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck)
* r8572: Remove crufty #define NO_SYSLOG as it's not used at all anymore.Tim Potter2007-10-101-2/+0
|
* r4212: Ensure we only look at the bottom bit of large_readx.Jeremy Allison2007-10-101-5/+6
| | | | | | Set the 14 word version of write if size > 0xffff as well as 64-bit offset. Jeremy.
* r4188: Ensure we add in the upper length in the right place !Jeremy Allison2007-10-101-1/+1
| | | | Jeremy.
* r4186: Fix client & server to allow 127k READX calls.Jeremy Allison2007-10-101-1/+7
| | | | Jeremy.
* r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison2007-10-101-2/+2
| | | | | | | | | allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy.
* r2959: If we want to support writes >= 65536 with cli_write, then it had betterRichard Sharpe2007-10-101-4/+4
| | | | | return a size_t, not an ssize_t, and we had better left shift the upper part of the write count, not right shift it.
* r2373: Fix typo.Jeremy Allison2007-10-101-3/+3
| | | | Jeremy.
* r2371: Fix for talking to OS/2 clients (max_mux ignored) by Guenter Kukkukk ↵Jeremy Allison2007-10-101-1/+7
| | | | | | | <guenter.kukkukk@kukkukk.com>. Bugid #1590. Jeremy.
* RPC fix from Ronan Waide <waider@waider.ie>. Tested with rpcecho.Jeremy Allison2003-08-081-1/+1
| | | | Jeremy.
* *lots of small merges form HEADGerald Carter2003-01-151-2/+5
| | | | | | *sync up configure.in *don't build torture tools in make all *make sure to remove torture tools as part of make clean
* Merge from HEAD - make Samba compile with -Wwrite-strings without additionalAndrew Bartlett2003-01-031-2/+3
| | | | | | warnings. (Adds a lot of const). Andrew Bartlett
* Merge Richard's write > 4Gb fix.Jeremy Allison2002-12-301-2/+12
| | | | Jeremy.
* merge from 2.2 fix for smbclient large filesHerb Lewis2002-12-191-1/+9
|
* Test was reversed for ERRmoredata in cli_read.Jeremy Allison2002-11-271-0/+10
| | | | Jeremy.
* sync'ing up for 3.0alpha20 releaseGerald Carter2002-09-251-1/+1
|
* updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell2002-07-151-26/+38
|
* Correctly increment offset in cli_smbwrite.Jeremy Allison2002-03-201-0/+2
| | | | Jeremy.
* Test against W2K that we're doing large read/writes correctly (we are).Jeremy Allison2002-03-201-0/+9
| | | | | At least with 14 word writes. Jeremy.
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Same fix as went into 2.2 (I'm waiting for jerry to finish some code).Jeremy Allison2002-01-111-6/+6
| | | | Jeremy.
* use cli_is_error() instead of looking in smb_rcls, otherwise NT statusAndrew Tridgell2001-09-051-2/+2
| | | | codes don't work correctly
* started converting NTSTATUS to be a structure on systems with gcc in order ↵Andrew Tridgell2001-08-271-4/+5
| | | | to make it type incompatible with BOOL so we catch errors sooner. This has already found a number of bugs
* Re-added readbraw call to test with smbtorture. This code not yetJeremy Allison2001-08-241-1/+88
| | | | | tested... Jeremy.
* A rewrite of the error handling in the libsmb client code. I've separatedTim Potter2001-08-101-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | out the error handling into a bunch of separate functions rather than all being handled in one big function. Fetch error codes from the last received packet: void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *num); uint32 cli_nt_error(struct cli_state *); Convert errors to UNIX errno values: int cli_errno_from_dos(uint8 eclass, uint32 num); int cli_errno_from_nt(uint32 status); int cli_errno(struct cli_state *cli); Detect different kinds of errors: BOOL cli_is_dos_error(struct cli_state *cli); BOOL cli_is_nt_error(struct cli_state *cli); BOOL cli_is_error(struct cli_state *cli); This also means we now support CAP_STATUS32 as we can decode and understand NT errors instead of just DOS errors. Yay! Ported a whole bunch of files in libsmb to use this new API instead of the just the DOS error.
* cli_read() was reading too many bytes.Andrew Tridgell2001-07-011-2/+1
|
* Use a logical cli_read(), removed the cli_read_one() hack.Jeremy Allison2001-06-291-124/+61
| | | | Jeremy.
* Merged cli_read_one() function for reading DCE/RPC reply fragments.Tim Potter2001-06-221-0/+46
|
* added some comments to make the cli read code clearerAndrew Tridgell2001-06-221-4/+14
|