summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison1-40/+39
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-10r13675: * patch from Bjoern JACKE <samba@j3e.de> to remove theGerald Carter1-15/+4
artificial RO bit on directories in user profiles when profile acls = yes. (This used to be commit b698e83a82f96db4a4a6ffa4b61af50c943deff0)
2007-10-10r13563: Fix bug #3526 found and diagnosed by corinna@vinschen.de.Jeremy Allison1-0/+2
trans2findfirst recognises two info levels *not* recognised by trans2findnext. Add them. Needed for 3.0.21c. Jeremy. (This used to be commit bcb87271d60acd4efe666dd061ea2c09b72fd497)
2007-10-10r13293: Rather a big patch I'm afraid, but this should fix bug #3347Jeremy Allison1-7/+7
by saving the UNIX token used to set a delete on close flag, and using it when doing the delete. libsmbsharemodes.so still needs updating to cope with this change. Samba4 torture tests to follow. Jeremy. (This used to be commit 23f16cbc2e8cde97c486831e26bcafd4ab4a9654)
2007-10-10r12877: Stop passing structs around in smb messages, insteadJeremy Allison1-2/+2
always linearize into little-endian. Should fix all Solaris issues with this, plus provide a cleaner base moving forward for cluster-aware Samba where smbd's can communicate across different compilers/architectures (eventually these message will have to go cross-machine). Jeremy. (This used to be commit d01824b78576a034428e1cef73868d1169057991)
2007-10-10r12376: Second patch from Martin Koeppe <mkoeppe@gmx.de>Jeremy Allison1-2/+2
for #3287. Jeremy. (This used to be commit 8680eebbba220eea257c9ea093d5a463afe7bd94)
2007-10-10r12250: Patch from Martin Koeppe <mkoeppe@gmx.de> for #3287Jeremy Allison1-6/+6
to make the dev/inode numbers match what SFU expects. If we're using 8 byte inodes we'll lose the top 4 bytes and replace them with a dev_t instead, but this seem reasonable to ensure uniqueness. Jeremy. (This used to be commit e53574d0b43e5525029c89e56331701399013d91)
2007-10-10r12203: Add the share path into the sharemode db. This involvesJeremy Allison1-11/+3
revving the minor version number for libsmbsharemodes (we now have a new _ex interface that takes the share path as well as the filename). Needed for #3303. Some code written by SATOH Fumiyasu <fumiya@samba.gr.jp> included in the changes to locking/locking.c. The smbstatus output is a bit of a mess and needs overhauling... Jeremy. (This used to be commit 9d93af713f8520ca506730dd32aa2b994937eaba)
2007-10-10r11511: A classic "friday night check-in" :-). This moves muchJeremy Allison1-18/+18
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-10r11428: Fix bug #3192 by actually hooking up the dfree cachingJeremy Allison1-3/+3
function. Oops. Jeremy. (This used to be commit 7edb26e7657fc01710abe563b941779749409ef2)
2007-10-10r11420: Fix issue pointed out by Dina Fine <dina@exanet.com>. We canJeremy Allison1-12/+16
only tell at parse time from the wire if an incoming name has wildcards or not. If it's a mangled name and we demangle the demangled name may contain wildcard characters. Ensure these are ignored. Jeremy. (This used to be commit 4cd8e2a96b98ff711905e8c6f416b22440c16062)
2007-10-10r11389: Attempt to fix bug #3212 - ignore bogus OS/2 EA set values onJeremy Allison1-4/+25
trans2_mkdir/trans2_open/trans2_setfilepathingo. Jeremy. (This used to be commit 71c037dfbb0b51e750f2e14533b03d9932778cb0)
2007-10-10r11232: Added ab's POSIX statvfs vfs call. Sorry for the delay ab.Jeremy Allison1-0/+33
Jeremy. (This used to be commit af8545806770a7530eecc184bdd230ca14999884)
2007-10-10r10921: BUG 3070: fix crash bug in qfsinfo when retrieving quota infoGerald Carter1-1/+0
(This used to be commit 1599fc38ab2f2beb5d1a240941b879603ce27ae6)
2007-10-10r10656: BIG merge from trunk. Features not copied overGerald Carter1-124/+8
* \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3)
2007-10-10r10182: Starting to stamp out warnings on a 64-bit box.Jeremy Allison1-5/+5
More to follow. Jeremy. (This used to be commit aa882646854325aa201b66d0ba27026946ce8dcb)
2007-10-10r9246: Patch from Marcel samba.10.maazl@spamgourmet.com for OS/2 trans2 openJeremy Allison1-2/+3
reply bugs. Jeremy. (This used to be commit 3ec6fc8d1e34c344f59b8c1a22f3bab556e7fa07)
2007-10-10r8959: Make msdfs code talloc based. Fix leaks.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 076023df8ea7c0f03baf8102e55d347e05542c7b)
2007-10-10r8552: Warning fix from jason@ncac.gwu.edu.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 8558001b38786b7ff16d90d80d183b0277d74e16)
2007-10-10r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the tortureJeremy Allison1-111/+146
tests on this as it's very late NY time (just wanted to get this work into the tree). I'll test this over the weekend.... Jerry - in looking at the difference between the two trees there seem to be some printing/ntprinting.c and registry changes we might want to examine to try keep in sync. Jeremy. (This used to be commit c7fe18761e2c753afbffd3a78abff46472a9b8eb)
2007-10-10r7963: Add aio support to 3.0.Jeremy Allison1-0/+3
Jeremy. (This used to be commit 1de27da47051af08790317f5b48b02719d6b9934)
2007-10-10r7893: Add in the extra parameters to opendir() to fix the large ↵Jeremy Allison1-15/+9
directory/insane app problem. Rev vfs version. Doesn't change the normal codepath. Jeremy. (This used to be commit 0f03a6bdcdbdf60da81e0aeffa84ac6e48fc6a04)
2007-10-10r7842: With the patch I sent Steve yesterday this gives us complete POSIX ↵Jeremy Allison1-2/+6
pathnames. ie. files containing : and \ can be accessed from Linux. Jeremy. (This used to be commit e9b8d23d6138d909a65ea70b2e801881e8333b38)
2007-10-10r7821: Don't check permissions for setting POSIX pathname request.Jeremy Allison1-53/+56
Jeremy. (This used to be commit 06b40024f3784778a81ae7c69881a516d183a1c3)
2007-10-10r7798: CIFSFS client assumes wcnt == 10 for successful trans2 reply.Jeremy Allison1-9/+8
Jeremy. (This used to be commit aea58e6bb60565430aec69598c47b2a8f4667e89)
2007-10-10r7796: Prepare for client setting capabilities to select posix pathnames onJeremy Allison1-19/+48
the wire. Jerry do not merge this please. New SMB_SET_FS_INFO - level 0x200 as was discussed on the mailing list. Jeremy. (This used to be commit 55029b1a0c9ae5b941eecd699dd905ea3d42b99c)
2007-10-10r7412: Now we're not memset'ing ensure we're valgrind clean.Jeremy Allison1-0/+1
Jeremy. (This used to be commit 0d303ab2f30f6047fc3f2f6fc4916e93704959d2)
2007-10-10r7191: Squeezing out more unnecessary memset's gets us up 20% over older ↵Jeremy Allison1-28/+45
code :-). Getting medieval on our ass about memset.... Jeremy. (This used to be commit d0c804bc353afa1712de3885071712af1daffb11)
2007-10-10r7190: I *love* valgrind/cachegrind.....Jeremy Allison1-10/+9
By removing unneeded memsets in qfilepathinfo I just improved our netbench performance by *********15%**********. Check it out :-). Jeremy. (This used to be commit c20a7b10b6a82db6df349fa5e6f2fcf3eeefec58)
2007-10-10r6979: Tidyups.Jeremy Allison1-8/+2
Jeremy. (This used to be commit 619d0aeebba66624ea0f5c7cff1c637738275b84)
2007-10-10r6715: We don't need to wrap the setfsinfo call in HAVE_QUOTAJeremy Allison1-4/+1
as they'll just return ENOSYS if we don't. Add new CAP for POSIX pathnames, prepare to allow FSINFO set for client POSIX caps. Jeremy. (This used to be commit 4d99b57aedba8431ef5827d1e75413a10b35e1ce)
2007-10-10r6631: More typo's. Sorry.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 2673ccd19f194d1f7756a154afe4200e386ca1b3)
2007-10-10r6625: Remove another global variable left over from a long time ago (magic ↵Jeremy Allison1-6/+6
char). Jeremy. (This used to be commit b1bfa9cb37deb22d1d08bc60ba44d61334f6446e)
2007-10-10r6302: OS/2 fix from Marcel Müller <mueller@maazl.de>. Don't check for ↵Jeremy Allison1-1/+2
mangled names if mangled names is off. Jeremy. (This used to be commit b2330c38881baceaafe1ef6b7ce00d1b5cd8d5c7)
2007-10-10r6297: Fix bug in our trans2 secondary processing. We need to pass in theJeremy Allison1-4/+4
trans2 call info from the primary trans2 packet as it isn't present in secondary transs packets. We only need to do this for functions that satisfy more than one case in the switch statement. Found by Marcel Müller <mueller@maazl.de>. Jeremy. (This used to be commit 62edc3d5dc68fbfe6cd77c588791453e29274dd9)
2007-10-10r6269: With help from Marcel Müller <mueller@maazl.de> in tracking down the ↵Jeremy Allison1-2/+5
bug, fix trans2 and nttrans secondary packet processing. We were being too strict checking the incoming packet (by 1 byte). Jeremy. (This used to be commit 3eea1ff4b7428325c7f304bcac61d6297209a4b8)
2007-10-10r6261: Tidyup message str printf. Ensure tvs struct is zeroed.Jeremy Allison1-0/+1
Jeremy. (This used to be commit 6c9f227ef400f32def85268f411691b569d29889)
2007-10-10r6258: Fix found by OS/2 set_ea call. When setting specific info remember to ↵Jeremy Allison1-5/+20
terminate once we've done that and not "break" into the generic file metadata set code. Jeremy. (This used to be commit f1e12be9ed0ca0077bac8e5f32051758e1d84ad7)
2007-10-10r6242: after talking to jeremy, we can actually consolidateGerald Carter1-1/+1
the 2 BOOL flags in dfs_redirect() down to one since they both are used in essentially the same context (from what we can tell). Tested Win98SE, WinXP sp 1 & 2, Win2k3 sp1, and WIn2k Sp4. All dfs operations still seem to work. (This used to be commit 59ffacf59c98f2f8277d76ec22712e438fd40618)
2007-10-10r6237: fix my breakage of WinXP sp2 msdfs support.Gerald Carter1-1/+1
We did need the special case for RESOLVE_DFSPATH in the findfirst() code. Jeremy, please verify I haven't broken the allow_wcard code you added to resolve_dfs_path() (This used to be commit 29983398e2f7f1dc609d4d981e20f594918243bb)
2007-10-10r6225: get rid of warnings from my compiler about nested externsHerb Lewis1-1/+1
(This used to be commit efea76ac71412f8622cd233912309e91b9ea52da)
2007-10-10r6203: Fix attribute return on creating a directory with nttrans_create.Jeremy Allison1-3/+11
Fix strange allocation semantics of openX. Jeremy. (This used to be commit da5a8b539d39d2765de22c3e55e9f284992ff966)
2007-10-10r6199: Only do the strange DOS error for openX, not trans2open.Jeremy Allison1-3/+0
Jeremy. (This used to be commit 65970dfc5b8f174fe29201789d6ddcf8802ad48c)
2007-10-10r6174: Fixup T2 open call - we were returning 2 bytes short.Jeremy Allison1-7/+24
Jeremy. (This used to be commit 0c7de7615bf0edbb36a3afee445db13a71e26d2e)
2007-10-10r6172: Tidy up error processing significantly. Remove unix_ERR_XXX global ↵Jeremy Allison1-1/+0
nastyness. Jeremy. (This used to be commit d3379fe61bb934082b51a37adac232a96bafcf46)
2007-10-10r6163: Well I never, all this time the t2open code was incorrectly dectingJeremy Allison1-1/+5
oplock requests and no one noticed. Hmmm. Don't think this is a commonly used codepath :-). Jeremy. (This used to be commit 75a0c11de4b7baf693e5c62e690e4bb26554f8e2)
2007-10-10r6146: Added OS/2 EA support in trans2_open and trans2_mkdir. Fixed in ↵Jeremy Allison1-5/+90
nttrans_create. Jeremy. (This used to be commit 989fcb4c084c63f1e3b114af68ef5bc0a2fbc09e)
2007-10-10r6141: Fix OS/2 EA's for NTcreate. OpenX and mkdir to follow.Jeremy Allison1-53/+60
Jeremy. (This used to be commit 106f91ff65acd23a7dda4d0ec89ae41ecb28153e)
2007-10-10r6138: Refactor length reading out of EA code so we can read lengthJeremy Allison1-15/+22
external to buffer. Needed to add EA code to create calls. Jeremy. (This used to be commit 7c4262d6ba48695c2622ea2eba8da6ac889ce543)
2007-10-10r6122: Added "hack" fix for broken SMB_INFO_VOLUME level - used by OS/2Jeremy Allison1-1/+7
I believe. Reported as fixed by Marcel Müller <mueller@maazl.de>. Jeremy. (This used to be commit 14eab937a54dd9f02f289d7e2f47c78c834714a3)