summaryrefslogtreecommitdiff
path: root/source4/lib/data_blob.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r6980: added data_blob_append(), which I use in the web serverAndrew Tridgell1-0/+13
(This used to be commit 822e2e5abeba8343e9e8165c14f4371c30cc13b1)
2007-10-10r6528: - in tdb_fetch() we effectively disallowed zero length records byAndrew Tridgell1-1/+1
returning NULL/0, which is the same as we used for a failure. Having to look at tdb->ecode (which we never do) is too error prone. Instead, tdb_fetch() should behave like malloc() and talloc(), where zero length is not special and malloc(0) returns a valid pointer. - similarly in data_blob(), asking for data_blob(NULL, 0) should return a zero blob, but asking for data_blob(ptr, 0) should return a zero length blob with a valid pointer, just like talloc() and malloc() This change fixes the SummaryInformation stream stored in the tdb backend when manipulated from w2k. The w2k client was using SET_EOF_INFORMATION to create a zero-length stream, which we return STATUS_NOT_FOUND on, as the tdb_fetch() gave us back a NULL/0 blob, which we returned as not-found (This used to be commit 162bbe4402b9de6ac06103df904b9fc204fbff29)
2007-10-10r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for theAndrew Tridgell1-1/+1
large commit. I thought this was worthwhile to get done for consistency. (This used to be commit ec32b22ed5ec224f6324f5e069d15e92e38e15c0)
2007-10-10r4549: got rid of a lot more uses of plain talloc(), instead usingAndrew Tridgell1-1/+1
talloc_size() or talloc_array_p() where appropriate. also fixed a memory leak in pvfs_copy_file() (failed to free a memory context) (This used to be commit 89b74b53546e1570b11b3702f40bee58aed8c503)
2007-10-10r4327: add usefull function if you don't want that the data will ↵Stefan Metzmacher1-0/+7
talloc_memdup()'ed metze (This used to be commit 1f01e370b192fc8fa51eb3a46e7b45c993aa9b80)
2007-10-10r4263: added support for the trans2 RAW_SEARCH_EA_LIST informationAndrew Tridgell1-0/+13
level. This is quite a strange level that we've never seen before, but is used by the os2 workplace shell. note w2k screws up this level when unicode is negotiated, so it only passes the RAW-SEARCH test when you force non-unicode (This used to be commit 25189b8fbf6515d573e3398dc9fca56505dc37b9)
2007-10-10r4027: add a useful function for debuggingStefan Metzmacher1-0/+18
metze (This used to be commit 41b1ba53fc201b7b9f9d806dccef6258b2a1d157)
2007-10-10r3572: Thanks to tridge for his patience with my build breakage.Andrew Bartlett1-3/+8
This concludes the proper fixes. Andrew Bartlett (This used to be commit c1d025793f2994c8f1cab304c3394ab186654071)
2007-10-10r3571: rough guesses at what abartlet really wanted to do in his last commitAndrew Tridgell1-0/+12
(which I suspect was missing some pieces) this at least fixes the build so i can keep going on pvfs. Please review/fix Andrew. (This used to be commit bffd18d09df04c1e492ef12f744ff4b6c561d53c)
2007-10-10r2674: I have realised that talloc() should have its context marked const, asAndrew Tridgell1-8/+3
a const pointer really means that "the data pointed to by this pointer won't change", and that is certainly true of talloc(). The fact that some behind-the-scenes meta-data can change doesn't matter from the point of view of const. this fixes a number of const warnings caused by const data structures being passed as talloc contexts. That will no longer generate a warning. also changed the talloc leak reporting option from --leak-check to --leak-report, as all it does is generate a report on exit. A new --leak-report-full option has been added that shows the complete tree of memory allocations, which is is quite useful in tracking things down. NOTE: I find it quite useful to insert talloc_report_full(ptr, stderr) calls at strategic points in the code while debugging memory allocation problems, particularly before freeing a major context (such as the connection context). This allows you to see if that context has been accumulating too much data, such as per-request data, which should have been freed when the request finished. (This used to be commit c60ff99c3129c26a9204bac1c6e5fb386114a923)
2007-10-10r2653: - data_blob() and data_blob_talloc() now get automatic namesAndrew Tridgell1-1/+2
- talloc_strdup() and related functions get automatic names (This used to be commit 0cf427d14fe0a19cb3e85b6191be220f3d81080a)
2007-10-10r2649: - used some cpp tricks to make users of talloc() and talloc_realloc()Andrew Tridgell1-0/+5
to get auto-naming of pointers very cheaply. - fixed a couple of memory leaks found with the new tricks A typical exit report for smbd is now: talloc report on 'null_context' (total 811 bytes in 54 blocks) auth/auth_sam.c:334 contains 20 bytes in 1 blocks struct auth_serversupplied_info contains 498 bytes in 33 blocks UNNAMED contains 8 bytes in 1 blocks lib/data_blob.c:40 contains 16 bytes in 1 blocks iconv(CP850,UTF8) contains 61 bytes in 4 blocks iconv(UTF8,CP850) contains 61 bytes in 4 blocks iconv(UTF8,UTF-16LE) contains 67 bytes in 4 blocks iconv(UTF-16LE,UTF8) contains 67 bytes in 4 blocks UNNAMED contains 13 bytes in 1 blocks which is much better than before (This used to be commit 6e721393d03afd3c2f8ced8422533547a9e33342)
2007-10-10r2043: data_blob() now returns a talloc'd pointer. If everyone has beenAndrew Tridgell1-40/+10
following the data_blob() API properly then this will cause no problems. I'm expecting chaos. this is part of the general move towards using talloc for everything in samba4 (This used to be commit 3f6b3c21e4d538aeb30b7906a75995b8f4c11223)
2007-10-10r2039: got rid of the free() ptr in DATA_BLOBAndrew Tridgell1-17/+2
I plan on replacing the concept by adding a generic destructor in all talloc ptrs, so you can do: talloc_set_destructor(ptr, my_destructor); to setup a function that will be called on free. (This used to be commit 957b260621c091830c01e9e8c370c199350342ec)
2007-10-10r1983: a completely new implementation of tallocAndrew Tridgell1-1/+1
This version does the following: 1) talloc_free(), talloc_realloc() and talloc_steal() lose their (redundent) first arguments 2) you can use _any_ talloc pointer as a talloc context to allocate more memory. This allows you to create complex data structures where the top level structure is the logical parent of the next level down, and those are the parents of the level below that. Then destroy either the lot with a single talloc_free() or destroy any sub-part with a talloc_free() of that part 3) you can name any pointer. Use talloc_named() which is just like talloc() but takes the printf style name argument as well as the parent context and the size. The whole thing ends up being a very simple piece of code, although some of the pointer walking gets hairy. So far, I'm just using the new talloc() like the old one. The next step is to actually take advantage of the new interface properly. Expect some new commits soon that simplify some common coding styles in samba4 by using the new talloc(). (This used to be commit e35bb094c52e550b3105dd1638d8d90de71d854f)
2007-10-10r1452: Thanks to Volker for spotting that this code was certainly not tested...Andrew Bartlett1-0/+1
(make sure to actually return the result). Andrew Bartlett (This used to be commit 8d449bbe2b9aa29315e894be1400a9475ef99468)
2007-10-10r1435: talloc_steal is very useful - add a function to do it with a DATA_BLOBAndrew Bartlett1-0/+15
Andrew Bartlett (This used to be commit 66d6e2611084d579a20833a4c0daa5d72ef9393c)
2007-10-10r607: When our code is looking for an 'empty' data blobAndrew Bartlett1-0/+1
some of it tests the .length, other code checks the .data. Ensure that we always NULL the .data, so that talloc-based blobs behave just like their direct malloc equivalents. Andrew Bartlett (This used to be commit 64121aa1a9d037d3969f24be62f4521611c89888)
2003-12-13added a basic dcerpc endpoint mapper to Samba4. Currently onlyAndrew Tridgell1-0/+12
implements the epm_Lookup() call, I'll add the other important calls soon. I was rather pleased to find that epm_Lookup() worked first time, which is particularly surprising given its complexity. This required quite a bit of new infrastructure: * a generic way of handling dcerpc policy handles in the rpc server * added type checked varients of talloc. These are much less error prone. I'd like to move to using these for nearly all uses of talloc. * added more dcerpc fault handling code, and translation from NTSTATUS to a dcerpc fault code * added data_blob_talloc_zero() for allocating an initially zero blob * added a endpoint enumeration hook in the dcerpc endpoint server operations (This used to be commit 3f85f9b782dc17417baf1ca557fcae22f5b6a83a)
2003-12-12 * the RPC-ECHO pipe now works in smbd, as long as the data sizesAndrew Tridgell1-1/+1
don't cause fragmented pdus (I'll add fragments shortly) * change data_blob_talloc() to not zero memory when the 2nd argument is NULL. The zeroing just masks bugs, and can't even allow a DOS attack * modified pidl to ensure that [ref] arguments to the out side of functions are allocated when parsing the in side. This allows rpc backends to assume that [ref] variables are all setup. Doesn't work correctly for [ref] arrays yet * changed DLIST_ADD_END() to take the type instead of a tmp variable. This means you don't need to declare a silly tmp variable in the caller (This used to be commit 46e0a358198eeb9af1907ee2a29025d3ab23b6d1)
2003-11-26fixed some memory leaks in the dcerpc use of ntlmssp signingAndrew Tridgell1-3/+2
(This used to be commit abbc9993b8f7eb9f57e079db1d0b170d0b9aa443)
2003-11-26signed DCERPC over TCP now works !Andrew Tridgell1-0/+2
* moved ntlmssp code into libcli/auth/, and updated to latest ntlmssp code from samba3 (thanks Andrew! the new interface is great) * added signing/ntlmssp support in the dcerpc code * added a dcerpc_auth.c module for the various dcerpc auth mechanisms (This used to be commit c18c9b5585a3e5f7868562820c14f7cb529cdbcd)
2003-08-13first public release of samba4 codeAndrew Tridgell1-0/+141
(This used to be commit b0510b5428b3461aeb9bbe3cc95f62fc73e2b97f)