summaryrefslogtreecommitdiff
path: root/source4/include
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r3064: - use UINT8_MAX and UINT16_MAX instead of hex values for ↵Andrew Tridgell1-0/+8
idr_get_new() limits - change idr_get_new() to use > instead of >= in the limit check (This used to be commit 834b09929bcb8aabdd151b7c2306001497cabdb4)
2007-10-10r3052: added talloc_zero_p() and talloc_zero_array_p() calls, for allocating ↵Andrew Tridgell1-1/+5
zeroed memory (This used to be commit 65b7316e9b4589b02a8bd94150ccbfe526f6d159)
2007-10-10r3029: implemented byte range lock timeouts.Andrew Tridgell2-46/+2
This adds a pvfs_wait_message() routine which uses the new messaging system, event timers and talloc destructors to give a nice generic async event handling system with a easy to use interface. The extensions to pvfs_lock.c are based on calls to pvfs_wait_message() routines. We now pass all of our smbtorture locking tests, although while writing this code I have thought of some additonal tests that should be added, particularly for lock cancel operations. I'll work on that soon. This commit also extends the smbtorture lock tests to test the rather weird 0xEEFFFFFF locking semantics that I have discovered in win2003. Win2003 treats the 0xEEFFFFFF boundary as special, and will give different error codes on either side of it. Locks on both sides are allowed, the only difference is which error code is given when a lock is denied. Anyone like to hazard a guess as to why? It has me stumped. (This used to be commit 4395c0557ab175d6a8dd99df03c266325949ffa5)
2007-10-10r3017: nicer memory handling for event_context_merge()Andrew Tridgell1-1/+2
(This used to be commit 1cef44505e5de9b8ae5206522b624082ad2343b2)
2007-10-10r3012: added initial support for byte range locking in the posix vfs. This isAndrew Tridgell2-2/+4
enough for us to pass locktest, but does not yet support lock timeouts and some of the other esoteric features. (This used to be commit 58a92abd88f190bc60894a68e0528e95ae33fe39)
2007-10-10r3005: added talloc wrappers around tdb_open() and ldb_connect(), so that theAndrew Tridgell2-0/+39
caller doesn't have to worry about the constraint of only opening a database a single time in a process. These wrappers will ensure that only a single open is done, and will auto-close when the last instance is gone. When you are finished with a database pointer, use talloc_free() to close it. note that this code does not take account of the threads process model, and does not yet take account of symlinks or hard links to tdb files. (This used to be commit 04e1171996612ddb15f84134cadded68f0d173b2)
2007-10-10r2992: drsuapi uses WERROR not NTSTATUSStefan Metzmacher1-0/+3
metze (This used to be commit 757f67c08b0b1309d8a0b900539111c7bc430b0e)
2007-10-10r2961: fixed a silly typoAndrew Tridgell1-2/+2
(This used to be commit f76a1cf640a909aa2a4e26e65f59020f9ab575f4)
2007-10-10r2960: during a lunchtime discussion I found out that all powerpc processorsAndrew Tridgell1-2/+47
can correctly (and quickly!) handle unaligned little endian memory accesses, just like i386. This should reduce code size and speeds things up quite a lot on ppc, at the expense of some inline asm code (whcih means it only works with gcc) (This used to be commit 2a0c427c2bf2f8b0739f12c78151b819388c44d4)
2007-10-10r2951: fixed the intptr_t test for discard_const()Andrew Tridgell1-0/+4
(This used to be commit 3318cf2722597e57d1731152b2607f6b167e45b9)
2007-10-10r2900: rusty pointed out to me that discard_const() can be done via a macroAndrew Tridgell1-2/+22
on systems that have the intptr_t type, and for systems that don't have it, they also almost certainly won't have -Wcast-qual, so we can use a void* cast. (This used to be commit 2132d38f9c5ba59825558d5ba084a514ebc2626b)
2007-10-10r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots ↵Andrew Tridgell3-50/+4
of associated functions. The motivation for this change was to avoid having to convert to/from ucs2 strings for so many operations. Doing that was slow, used many static buffers, and was also incorrect as it didn't cope properly with unicode codepoints above 65536 (which could not be represented correctly as smb_ucs2_t chars) The two core functions that allowed this change are next_codepoint() and push_codepoint(). These functions allow you to correctly walk a arbitrary multi-byte string a character at a time without converting the whole string to ucs2. While doing this cleanup I also fixed several ucs2 string handling bugs. See the commit for details. The following code (which counts the number of occuraces of 'c' in a string) shows how to use the new interface: size_t count_chars(const char *s, char c) { size_t count = 0; while (*s) { size_t size; codepoint_t c2 = next_codepoint(s, &size); if (c2 == c) count++; s += size; } return count; } (This used to be commit 814881f0e50019196b3aa9fbe4aeadbb98172040)
2007-10-10r2791: got rid of talloc_unreference() and instead created talloc_unlink(),Andrew Tridgell1-1/+1
which is much clearer and simpler to use. It removes a specific parent from a pointer, no matter whether that parent is a "reference" or a direct parent. This gives complete control over the free process. (This used to be commit 6c563887f1b9b8c842309a523e88b6f2a32db10f)
2007-10-10r2744: ben elliston taught me about gcov today, which allows you to measureAndrew Tridgell2-1/+42
the % coverage in terms of lines of code of a test suite. I thought a good first place to start with gcov was the talloc test suite. When I started the test suite covered about 60% of all lines of code in talloc.c, and now it covers about 99%. The only lines not covered are talloc corruption errors, as that would cause smb_panic() to fire. It will be interesting to try gcov on the main Samba test suite for smbd. We won't achieve 100% coverage, but it would be nice to get to 90% or more. I also modified the talloc.c sources to be able to be build standalone, using: gcc -c -D_STANDALONE_ -Iinlcude lib/talloc.c that should make it much easier to re-use talloc in other projects (This used to be commit 8d4dc99b82efdf24b6811851c7bdd4af5a4c52c9)
2007-10-10r2678: from_name and to_name aren't needed in smb_iconv_tAndrew Tridgell1-1/+0
(This used to be commit f3844cc0a5ad6b03f166435d44db02763df345d7)
2007-10-10r2674: I have realised that talloc() should have its context marked const, asAndrew Tridgell1-0/+1
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-10r2671: we're getting too many errors caused by the talloc_realloc() API notAndrew Tridgell1-2/+2
taking a context (so when you pass a NULL pointer you end up with memory in a top level context). Fixed it by changing the API to take a context. The context is only used if the pointer you are reallocing is NULL. (This used to be commit 8dc23821c9f54b2f13049b5e608a0cafb81aa540)
2007-10-10r2660: - converted the libcli/raw/ library to use talloc_increase_ref_count()Andrew Tridgell1-12/+0
rather than manual reference counts - properly support SMBexit in the cifs and posix backends - added a logoff method to all backends With these changes the RAW-CONTEXT test now passes against the posix backend (This used to be commit c315d6ac1cc40546fde1474702a6d66d07ee13c8)
2007-10-10r2653: - data_blob() and data_blob_talloc() now get automatic namesAndrew Tridgell1-0/+3
- 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-2/+12
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-10r2641: talloc_p() now produces a named talloc pointer, with the nameAndrew Tridgell1-1/+1
auto-derived from the type you are allocating. This is done with basically zero overhead by relying on the stringify operator in cpp producing string constants. the result is that --leak-check nicely names all pointers that come from talloc_p() (This used to be commit bd86ebe2972af4d424df20db1e422919aa6203d0)
2007-10-10r2632: a new approach to handling const errors. We have had huge numbers ofAndrew Tridgell1-0/+2
const warnings for a long time, and no real way to approach a solution. Some of them are unavoidable due to the way the C standard works (for example, any function that provides strchr() like functionality _must_ produce a const warning) I will be converting a bunch of places that currently produce const warnings to use the discard_const_p(). Some of these will be unavoidable const problems, some of them will be ones we will fix up over time. At least this change means we will no longer be swamped with const warnings, and we will easily be able to see when new problems emerge. (This used to be commit fec3288ad6ce58e8273e3f16e88037db49ecf046)
2007-10-10r2618: before we had refererence counts in talloc I added a hack in theAndrew Tridgell1-1/+0
server side request structure to prevent a structing being freed in some circumstances. This change replaces this with the much more robust mechanism of talloc_increase_ref_count(). (This used to be commit 3f7741f178b359f81cc98ef18cd69bf976123e9f)
2007-10-10r2582: Merge checks for xattr and acl libraries from Samba3 so the ↵Tim Potter1-0/+11
{get,set}ntacl programs can build on non-xattr machines. (This used to be commit daad76207dbb4060c231a58c99970e837e1e858f)
2007-10-10r2520: - finished implementing the server side of the old style search requestsAndrew Tridgell1-1/+1
(This used to be commit 4e4859c06b9de5fe60ebd17cfb09eed480b79ec1)
2007-10-10r2518: Some long overdue changes:Jelmer Vernooij1-5/+113
- Samba4-style code in lib/registry (struct registry_key instead of REG_KEY, etc) - Use hives (like Windows has drives) instead of one root key (like a Unix FS) - usability fixes in the GTK utilities (autodetect the username, enable/disable options, etc) - fix gwsam compile - several bugfixes in the registry rpc code - do charset conversion in nt4 registry backend (This used to be commit 2762ed3b9bf1d67dd54d63e02cddbfd71ea89892)
2007-10-10r2510: Make C++ compilers happy, use ifdef instead of ifJelmer Vernooij1-5/+5
(This used to be commit 7c31998da148cca53e798e3d89b9b754de2e64ac)
2007-10-10r2469: complete overhaul of the old-style RAW_SEARCH_ calls (the OS/2 andAndrew Tridgell1-21/+28
original core level calls). The old code was completely wrong in many respects. also fixed the EA_SIZE level in the server extended the RAW-SEARCH test suite to test the new code properly (This used to be commit 71480271ad84b57fcdde264a54bb2408cf783255)
2007-10-10r2459: added STATUS_NO_MORE_FILES nt status codeAndrew Tridgell1-1/+2
(This used to be commit 3bf55c9e1129d8036a968c49ac2de7260e657f53)
2007-10-10r2456: got rid of some outdated global macrosAndrew Tridgell1-13/+0
(This used to be commit ea7eac5e3fb8f0db8d412a95ef4dc7889a07bc73)
2007-10-10r2434: separate "attrib" and "ex_attrib" elements for DOS attributes is ↵Andrew Tridgell1-2/+1
pointless (This used to be commit 5fcad57128e47d4d6c0f387d5563d9de2fc08351)
2007-10-10r2404: the first large lump of posix vfs stuff.Andrew Tridgell1-0/+5
this is still very much a skeleton (with many limbs missing too!). I am committing this early to get some feedback on the approach taken. (This used to be commit 40d5cae5ebbfe328e193eadb685df6a370730299)
2007-10-10r2386: fixed some indentationAndrew Tridgell1-1/+1
(This used to be commit 1de5aa5b1d6a9b4b3ed18935c562b0bf03a4d94e)
2007-10-10r2328: add the start of a new system and protocolStefan Metzmacher1-0/+1
independent socket library. this is not used, but compiled currently there're maybe some api changes later... metze (This used to be commit de4447d7a57c614b80d0ac00dca900ea7e1c21ea)
2007-10-10r2321: add complately untested LDAP server startStefan Metzmacher1-0/+1
based on volker's patch this is compiled by default but not started by default metze (This used to be commit 5387bc423d4dc669cbac6626f8dd3a5498a6519d)
2007-10-10r2242: some older versions of gcc don't properly handle theAndrew Tridgell1-2/+3
PRINTF_ATTRIBUTE() format checking magic, so only enable it for gcc versions >= 3.0 (This used to be commit 9c7100e3c770fca163d3788fc6b735457f74d7e9)
2007-10-10r2159: converted samba4 over to UTF-16.Andrew Tridgell1-1/+1
I had previously thought this was unnecessary, as windows doesn't use standards compliant UTF-16, and for filesystem operations treats bytes as UCS-2, but Bjoern Jacke has pointed out to me that this means we don't correctly store extended UTF-16 characters as UTF-8 on disk. This can be seen with (for example) the gothic characters with codepoints above 64k. This commit also adds a LOCAL-ICONV torture test that tests the first 1 million codepoints against the system iconv library, and tests 5 million random UTF-16LE buffers for identical error handling to the system iconv library. the lib/iconv.c changes need backporting to samba3 (This used to be commit 756f28ac95feaa84b42402723d5f7286865c78db)
2007-10-10r2039: got rid of the free() ptr in DATA_BLOBAndrew Tridgell1-1/+0
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-10r2005: fix compiler warningsStefan Metzmacher1-1/+1
metze (This used to be commit 71992c90cc35179ea8783d770c89b16618e1adc6)
2007-10-10r1985: take advantage of the new talloc in a few more placesAndrew Tridgell1-10/+0
(This used to be commit 6ffdfd779936ce8c5ca49c5f444e8da2bbeee0a8)
2007-10-10r1984: this change is what you should read to understand the new talloc()Andrew Tridgell1-3/+0
It simplifies our structure handling a lot, making the code shorter and easier to understand. Look at the diff carefully and see if you can understand it. If you're still confused then please ask. (This used to be commit 03c341aca7f09cb1f0d33ec65e074e6a00caa30f)
2007-10-10r1983: a completely new implementation of tallocAndrew Tridgell1-30/+9
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-10r1912: move popt_common.hStefan Metzmacher2-52/+1
metze (This used to be commit ecf6be894fc47f9e00f46531e06ef20e11115c0f)
2007-10-10r1911: merge a few popt parameters from 3.0 move some to better placesStefan Metzmacher1-2/+3
and deal with users DOMAIN and lp_workgroup() of the local workstation metze (This used to be commit 1fc0100e44a8640cfc15effb99f5824cb7817da8)
2007-10-10r1903: hmm a better solution is to include popt.h where it is neededStefan Metzmacher2-1/+2
metze (This used to be commit 64d61ef4a5b44e76c90914ebaeaafac58228d78c)
2007-10-10r1902: we need to include popt.h before popt_common.hStefan Metzmacher2-2/+1
metze (This used to be commit edde7497e9e06be0e51e886981725271a85bd9e5)
2007-10-10r1895: added a note about OPEN_BY_FILE_ID to the ntcreatex interface definitionAndrew Tridgell1-0/+3
(This used to be commit e50fc00671ace0085632f35ec99ad1125cd4d546)
2007-10-10r1894: Convert // to /* */Volker Lendecke1-1/+1
(This used to be commit 5dc793b2b4b5c54df4aa3b0c98c248bdd671bbb1)
2007-10-10r1877: since make proto catches all functionsStefan Metzmacher1-0/+1
the inlcude has to move to includes.h metze (This used to be commit 97fe38183b6a03c01f6ac2d28a958d632eb4ff8a)
2007-10-10r1836: - as abartlet said to me, we need to contact the users domain pdcfor ↵Stefan Metzmacher1-0/+2
doing a password change - add start of libnet_SetPassword - use KRB5 and LDAP instead of ADS as ADS isn't a protocol - add start of lib_rpc_connect() metze (This used to be commit 05c40dca8ad1ab020aa75282da046f1dbce2a52a)