summaryrefslogtreecommitdiff
path: root/source3/libsmb/clilist.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r15997: Fix bug in OS/2 Warp - it doesn't set the ff_lastJeremy Allison1-1/+1
offset correctly when doing info level 1 directory scans. Thanks to Guenter Kukkukk <Guenter.Kukkukk@kukkukk.com> for reporting this problem and testing the fix. Jeremy. (This used to be commit 65d4dfbd6045a4e3f9eaf520c70ef29ff7ddee82)
2007-10-10r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison1-11/+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. (This used to be commit 1d710d06a214f3f1740e80e0bffd6aab44aac2b0)
2007-10-10r13316: Let the carnage begin....Gerald Carter1-1/+5
Sync with trunk as off r13315 (This used to be commit 17e63ac4ed8325c0d44fe62b2442449f3298559f)
2007-10-10r12758: r12127@cabra: derrell | 2006-01-03 15:22:18 -0500Derrell Lipman1-5/+1
remove old superfluous comment and ifdef (This used to be commit ee7fcb43ad456929f1f005f47c52a4b4d46c5087)
2007-10-10r12275: Fix memory leak found by Mikhail Kshevetskiy <kl@laska.dorms.spbu.ru>Jeremy Allison1-2/+14
and followed up by derrell@samba.org. Jeremy. (This used to be commit 5cab88f1444177129bb5521ccc4afd8869e9bf25)
2007-10-10r11511: A classic "friday night check-in" :-). This moves muchJeremy Allison1-7/+7
of the Samba4 timezone handling code back into Samba3. Gets rid of "kludge-gmt" and removes the effectiveness of the parameter "time offset" (I can add this back in very easily if needed) - it's no longer being looked at. I'm hoping this will fix the problems people have been having with DST transitions. I'll start comprehensive testing tomorrow, but for now all modifications are done. Splits time get/set functions into srv_XXX and cli_XXX as they need to look at different timezone offsets. Get rid of much of the "efficiency" cruft that was added to Samba back in the day when the C library timezone handling functions were slow. Jeremy. (This used to be commit 414303bc0272f207046b471a0364fa296b67c1f8)
2007-10-10r8572: Remove crufty #define NO_SYSLOG as it's not used at all anymore.Tim Potter1-2/+0
(This used to be commit 985dbb47d925e79c1195ca219f7ab5d6648b22b8)
2007-10-10r7157: Ensure we abort a directory listing if we see the sameJeremy Allison1-0/+7
name twice between packets. Jeremy. (This used to be commit f9063b383ed2c53841ac27691b6a593b80c20b12)
2007-10-10r7151: Fix for bug #2698. If a unicode to unix charset conversion fails (due ↵Jeremy Allison1-10/+40
to buggy iconv?) we can be left with a filename that doesn't exist on the remote machine. If we then do a findnext with this file the server gets confused and restarts from the beginning of the directory, causing directory listing loops. Fix this by keeping a copy of the "raw" filename data and length and using this as the argument to findnext. This won't fix the incorrect iconv conversion into the finfo struct but at least it ensures that directory listings always terminate. Tested against NTFS and FAT directories. Jeremy. (This used to be commit 848940d5a91b310e58d0631ead293418ea4186f0)
2007-10-10r6994: Fix for bugid #2729 - it turns out resume keys are *mandatory* forJeremy Allison1-5/+11
a search when listing a W2K and above server from a FATxx filesystem only. Thanks to Steve Langasek <vorlon@debian.org> for giving me the essential info that allowed me to reproduce and thus fix this. Jeremy. (This used to be commit 8227675d3dbcd4f8bb2a24ea7e3e05c428b7c929)
2007-10-10r6225: get rid of warnings from my compiler about nested externsHerb Lewis1-2/+2
(This used to be commit efea76ac71412f8622cd233912309e91b9ea52da)
2007-10-10r5991: Fixup last entry offset correctly for level 260.Jeremy Allison1-6/+10
Should fix bug found by Derrell.Lipman@UnwiredUniverse.com. Jeremy. (This used to be commit 5ded615679e346d1ea155cde3413396d3e3c3a6b)
2007-10-10r5975: Re-arrange code and comments to make more sense.Jeremy Allison1-12/+10
Jeremy. (This used to be commit 08616ad80d96d1b7b558eec036bafb4bf3663942)
2007-10-10r5973: Fix up overwrite of last 2 bytes on clilist (could cause coredump).Jeremy Allison1-4/+1
Jeremy. (This used to be commit b0de2d761f6697ca1f4859ba098af6162ab42027)
2007-10-10r5970: Fix old bug where ff_searchcount was being compared -1 ! This caused aJeremy Allison1-1/+1
filename to be processed twice. Jeremy. (This used to be commit 2ed7e30cbb3e194a08d5d9b46993652666193bec)
2007-10-10r5967: Fix typo bug where flags overwrote info level.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 214a2cbe5aed9f0540b03350b60d0eec1c61bad8)
2007-10-10r5723: Add missing part of fix for #2271. After analysing the actions of a XPJeremy Allison1-2/+4
client against a Samba server. It never uses the "continue" flag, but always does "new search, continue from this file" instead. Change our client code to do the same (it appears that's all they test in W2K etc.). Jeremy. (This used to be commit 710bceee325005b8ca8e8ed04acc50bafa92b6e6)
2007-10-10r5702: Fix bug #2271. Correctly pull out and use resume names in aJeremy Allison1-20/+10
directory listing (we were incorrectly understanding what was returned in the "last name" entry). Jeremy. (This used to be commit 4f2da9ecf1e5cee4749839ea1b35a942d27de09e)
2007-10-10r5577: get recurse; dir working across single level dfs referralsGerald Carter1-5/+8
(This used to be commit d4443807bc7a5a8615c69517365a92709db7ce29)
2007-10-10r5520: fix last remaining dfs issues with smbclient.Gerald Carter1-2/+8
* all the unix extension commands should work * send the correct TRANS2_FINDFIRST format to 2k to get a listing from a msdfs root share (tested against smbd as well). * mkdir, rmdir, etc... all seem ok. I'm sure bugs will pop up so keep testing. Last thing I plan on doing is to clean up the horrible mess with connection management in smbclient and global variables (so i can move the cli_cm_xx() routines to a separate file). (This used to be commit 53d6a5f9d16aef4afc60b4b37b296b256da00dfd)
2007-10-10r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison1-2/+2
allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy. (This used to be commit 620f2e608f70ba92f032720c031283d295c5c06a)
2004-02-23Janitor for tpot...bugzilla #1098, msleep already exists on aixJim McDonough1-1/+1
(This used to be commit 4319df7fdc2d878c509381923cc1db4d731620ba)
2003-10-29Fixes to check for wraps which could cause coredumps.Jeremy Allison1-1/+1
Jeremy. (This used to be commit ad06edd1bb58cc5e2c38a364b1af96a933b770af)
2003-08-02Correct fix (removed the earlier band-aid) for what I thought was a signingJeremy Allison1-2/+10
bug with w2k. Turns out that when we're doing a trans/trans2/nttrans call the MID and send_sequence_number and reply_sequence_number must remain constant. This was something we got very wrong in earlier versions of Samba. I can now get a directory listing from WINNT\SYSTEM32 with the older earlier parameters for clilist.c This still needs to be fixed for the server side of Samba, client appears to be working happily now (I'm doing a signed smbtar download of an entire W2K3 image to test this :-). Jeremy. (This used to be commit 2093a3130d4087d0659b497eebd580e7a66e5aa3)
2003-07-30Fix bug we discovered in W2K client signing on secondary trans2 packets.Jeremy Allison1-2/+3
Use W2K parameters. tpot please re-test smbclient with your problem directory. Jeremy. (This used to be commit 677d3a3c4ca0b67148e5e56fa876773a067679bd)
2003-07-30Eliminate valgrind error when client gets bad sig on list. Some reformatting.Jeremy Allison1-12/+22
Jeremy. (This used to be commit b8f6b836468b3a0ae75977dc65cae8400f74734c)
2003-03-18Jeremy merged across my string parinoia fixes, but forgot to enable them! :-)Andrew Bartlett1-2/+2
This patch catches up on the rest of the work - as much string checking as is possible is done at compile time, and the rest at runtime. Lots of code converted to pstrcpy() etc, and other code reworked to correctly call sizeof(). Andrew Bartlett (This used to be commit c5b604e2ee67d74241ae2fa07ae904647d35a2be)
2003-03-13Change size parameters from signed to unsigned to fix up warnings.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 33b11d5eb53bdeb9d279d221fd5c01579253e1c7)
2003-01-15*lots of small merges form HEADGerald Carter1-1/+1
*sync up configure.in *don't build torture tools in make all *make sure to remove torture tools as part of make clean (This used to be commit 0fb724b3216eeeb97e61ff12755ca3a31bcad6ef)
2003-01-15merging some rpcclient and net functionality from HEADGerald Carter1-2/+4
(This used to be commit 7a4c87484237308cb3ad0d671687da7e0f6e733b)
2002-12-10Fix client reporting of 64 bit files.Jeremy Allison1-4/+4
Jeremy. (This used to be commit 8dcbfa4e770d74d4ce6faaf1a0597d07d0a5cc81)
2002-12-03use the new IVAL_TO_SMB_OFF_T for file_info size memberHerb Lewis1-4/+4
dir now shows correct size on large files (This used to be commit 172dccf55e972d4cc40b7e34ce433d49e738fba0)
2002-09-25sync'ing up for 3.0alpha20 releaseGerald Carter1-25/+23
(This used to be commit 65e7b5273bb58802bf0c389b77f7fcae0a1f6139)
2002-07-15updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell1-3/+7
(This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
2002-01-30Removed version number from file header.Tim Potter1-2/+1
Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2002-01-11Same fix as went into 2.2 (I'm waiting for jerry to finish some code).Jeremy Allison1-2/+2
Jeremy. (This used to be commit 01ff6ce4963e1daff019f2b936cef218e1c93f67)
2001-09-17move to SAFE_FREE()Simo Sorce1-6/+6
(This used to be commit 48fc6a6cd52e01b287030fbbf0aa08a6814c5e11)
2001-09-05use cli_is_error() instead of looking in smb_rcls, otherwise NT statusAndrew Tridgell1-2/+2
codes don't work correctly (This used to be commit 55d5828e608671f070a9e96938be0d16d50aeb26)
2001-08-24fixed shortname length in trans2 listAndrew Tridgell1-1/+2
(This used to be commit ae669720d8f434a23397deaea3371998ab6f1f54)
2001-08-22a fix for directory listing with the dave/thursby clientAndrew Tridgell1-1/+1
(This used to be commit 5a3fd3317e0fedd72450660f031b5ba42a11b875)
2001-08-20a bunch of fixes from the sflight to seattleAndrew Tridgell1-1/+1
in particular: - fixed NT status code for a bunch of ops - fixed handling of protocol levels in ms_fnmatch (This used to be commit 3eba9606f71f90bfd9820af26f8676277ed22390)
2001-08-12Fixed crash bug when attempting to list contents of non-existentTim Potter1-0/+3
directory. (This used to be commit a7863f0f033b31838a53960e9f616d9a82081ecf)
2001-08-12this is a big global fix for the ptr = Realloc(ptr, size) bug.Simo Sorce1-7/+12
many possible mem leaks, and segfaults fixed. someone should port this fix to 2.2 also. (This used to be commit fa8e55b8b465114ce209344965c1ca0333b84db9)
2001-08-10A rewrite of the error handling in the libsmb client code. I've separatedTim Potter1-2/+3
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. (This used to be commit 6dbdb0d813f3c7ab20b38baa1223b0b479aadec9)
2001-07-07fixed some unicode and LANMAN2 bugs in trans2 find firstAndrew Tridgell1-103/+77
(This used to be commit dc99b9ddf847c210c72921ba1dedcdc34fd32aab)
2001-07-04The big character set handling changeover!Andrew Tridgell1-15/+12
This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation. (This used to be commit debb471267960e56005a741817ebd227ecfc512a)
2001-03-16added STR_ASCII support to clistr_pull()Andrew Tridgell1-3/+3
(This used to be commit 797293811ef0a79eecc460c471135c89090f8c06)
2001-03-14simpler clistr interface which handles individual packets havingAndrew Tridgell1-8/+8
unicode bit set differently to capabilities (This used to be commit 34a0821e087810381996f5ff6cf3b4d7b9bb53a0)
2001-03-10to use the same macros in the client and server rename the CLISTR_Andrew Tridgell1-16/+16
macros to STR_ (This used to be commit 95c9e4e0ba8f37f565aaf136f41eb76489441ff7)
2001-02-26made some LANMAN1 wildcard progressAndrew Tridgell1-6/+12
it now handles -M LANMAN1 -f '.x' -m '?x' nicely (This used to be commit e7ccb9be6da9b1426eb136b4a0a1171232471768)