summaryrefslogtreecommitdiff
path: root/source4/lib
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r2646: - use a talloc destructor to ensure that sockets from the new socketAndrew Tridgell2-7/+27
library are closed on abnormal termination - convert the service.h structures to the new talloc methods (This used to be commit 2dc334a3284858eb1c7190f9687c9b6c879ecc9d)
2007-10-10r2644: removed an unused functionAndrew Tridgell1-18/+0
(This used to be commit bc779cb2ce6bc13157f9d046400ce99d107ccd52)
2007-10-10r2642: smb_iconv_t is a pointer, so checks against -1 errors should use a castAndrew Tridgell1-1/+1
(This used to be commit 28dcd2202948b003f8d13951395baa4a722593f4)
2007-10-10r2641: talloc_p() now produces a named talloc pointer, with the nameAndrew Tridgell1-3/+31
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-10r2640: valgrind does a great job on some types of memory leaks, but is slowAndrew Tridgell2-5/+80
and can't properly handle leaks of doubly linked lists which we use a lot (as the memory is always reachable). Even with --show-reachable its hard to track leaks down sometimes. I realised that talloc does have the necessary information to track these, and by using the cascading property of the new talloc it can report on leaks in a much more succinct fashion than valgrind can. I have added a new samba option --leak-check that applies to all Samba tools. When enabled it prints a leak report summarising all top level contexts that are present when the program exits. A typical report looks like this: talloc report on 'null_context' (total 1071 bytes in 52 blocks) iconv(CP850,UTF8) contains 43 bytes in 3 blocks UNNAMED contains 24 bytes in 1 blocks UNNAMED contains 24 bytes in 1 blocks dcesrv_init contains 604 bytes in 26 blocks server_service contains 120 bytes in 6 blocks UNNAMED contains 24 bytes in 1 blocks UNNAMED contains 24 bytes in 1 blocks server_service contains 104 bytes in 4 blocks server_context contains 12 bytes in 2 blocks iconv(UTF8,UTF-16LE) contains 46 bytes in 3 blocks iconv(UTF-16LE,UTF8) contains 46 bytes in 3 blocks the numbers are recursive summaries for all the memory hanging off each context. this option is not thread safe when used, but the code is thread safe if the option is not given, so I don't think thats a problem. (This used to be commit 96d33d36a5639e7fc46b14a470ccac674d87c62a)
2007-10-10r2639: we doon't need the valid_table code, so get rid of itAndrew Tridgell1-56/+0
(This used to be commit 480636ebbca102172621609496bdab682d4bda8a)
2007-10-10r2638: do lazy initialisation of iconv handles, so we don't initialise aAndrew Tridgell1-39/+29
handle unless we use it. This saves quite a bit of memory (libc chews a lot loading a handle). Typically smbd now loads 3 handles, instead of 36. (This used to be commit 60e8d154fda548862cd6f8e8c1dadd64b3c4bd9c)
2007-10-10r2634: use discard_const_p() in a few placesAndrew Tridgell3-6/+9
(This used to be commit 56ecda2178e33508c55c6195ccec41c06e099d6f)
2007-10-10r2632: a new approach to handling const errors. We have had huge numbers ofAndrew Tridgell2-2/+22
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-10r2631: the strchr family of functions should not return const strings.Andrew Tridgell1-3/+3
(This used to be commit 2a7e5f07086ef4aebbb2be35acbf9c7c39b13c75)
2007-10-10r2628: got rid of some warnings and converted a few more places to use ↵Andrew Tridgell1-1/+1
hierarchical memory allocation (This used to be commit 26da45a8019a2d6c9ff2ac2a6739c7d0b42b00de)
2007-10-10r2623: don't do pointer arithmetic on void*, as it doesn't work with non-GNU ↵Andrew Tridgell1-1/+1
compilers (This used to be commit c2be7b696ccb338df06a5212ed1f7b78e4c116c2)
2007-10-10r2622: to implement the SOCKET_FLAG_BLOCK option in the socket library weAndrew Tridgell1-0/+4
need to add MSG_WAITALL to the recv() flags. This is needed by the current server code or sometimes it will fail with a receive error. (This used to be commit 4cb11fb77acf74ab53bf5782a114151965c558f0)
2007-10-10r2621: - now that the client code is non-blocking, we no longer needAndrew Tridgell1-73/+0
write_data and read_data, which are inherently blocking operations - got rid of some old NBT keepalive routines that are not needed (This used to be commit e73b4ae4e500d3b7ee57e160e0f8b63c99b2542a)
2007-10-10r2601: avoid free()ing unallocated memory by mistakeSimo Sorce1-1/+6
(This used to be commit e502b276ae5e4e22e31a522c4d9e346996d6e29f)
2007-10-10r2581: added "hosts allow" and "hosts deny" checking in smbd. I needed thisAndrew Tridgell5-0/+386
as my box keeps getting hit by viruses spreading on my companies internal network, which screws up my debug log badly (sigh). metze, I'm not sure if you think access.c should go in the socket library or not. It is closely tied to the socket functions, but you may prefer it separate. The access.c code is a port from Samba3, but with some cleanups to make it (slighly) less ugly. (This used to be commit 058b2fd99e3957d7d2a9544fd27071f1122eab68)
2007-10-10r2577: - I recently found out that charaters below 0x3F are guaranteed not toAndrew Tridgell1-45/+12
occur as secondary bytes in any multi-byte character set. This allows for a very simple optimisation in strchr_m() and strrchr_m(). It might be a good idea to pick this up for Samba3. - the horrible toktocliplist() is only used in clitar.c, so move it there, to prevent anyone else from being tempted to use it. (This used to be commit 663b7b75ddd838ce547425b07d7ce4d4606fb479)
2007-10-10r2556: fixed the -s one bug that jelmer pointed outAndrew Tridgell1-1/+1
(This used to be commit 03c38477add0c5f78072700615b2c1513cbc7663)
2007-10-10r2554: added a test for a bug that jelmer pointed out (handling of -s one)Andrew Tridgell1-0/+7
(This used to be commit 74d7bc1948961a24837d966416db12be192382ff)
2007-10-10r2553: fixed ldbtest so it passes the ldap schema restrictions and thus can ↵Andrew Tridgell1-18/+11
be used on the ldap backend (This used to be commit 9f230425a0c926209887006ab1e3fec0998e7961)
2007-10-10r2552: Character set conversion and string handling updates.Andrew Bartlett3-444/+267
The intial motivation for this commit was to merge in some of the bugfixes present in Samba3's chrcnv and string handling code into Samba4. However, along the way I found a lot of unused functions, and decided to do a bit more... The strlen_m code now does not use a fixed buffer, but more work is needed to finish off other functions in str_util.c. These fixed length buffers hav caused very nasty, hard to chase down bugs at some sites. The strupper_m() function has a strupper_talloc() to replace it (we need to go around and fix more uses, but it's a start). Use of these new functions will avoid bugs where the upper or lowercase version of a string is a different length. I have removed the push_*_allocate functions, which are replaced by calls to push_*_talloc. Likewise, pstring and other 'fixed length' wrappers are removed, where possible. I have removed the first ('base pointer') argument, used by push_ucs2, as the Samba4 way of doing things ensures that this is always on an even boundary anyway. (It was used in only one place, in any case). (This used to be commit dfecb0150627b500cb026b8a4932fe87902ca392)
2007-10-10r2542: I really don't like the 'substitute' code, and I particularly don'tAndrew Bartlett1-25/+0
like it in the mainline code (outside the smb.conf magic). We will need to have a more useful 'helper' routine for this, but for now we at least get a reliable IP address. Also remove the unused 'socket' structure in the smb server - it seems to have been replaced by the socket library. Andrew Bartlett (This used to be commit d8fd19a2020da6cce691c0db2b00f42e31d672cc)
2007-10-10r2518: Some long overdue changes:Jelmer Vernooij16-1254/+795
- 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-10r2514: Remove unused funcions, and add static.Andrew Bartlett1-55/+1
Andrew Bartlett (This used to be commit fd10c9dd536bde497829aaed9e0ba2d51ffe2315)
2007-10-10r2506: Add more printf attributes for format checking.Andrew Bartlett1-3/+5
Andrew Bartlett (This used to be commit 1640272dc36a0cb5bc8e647d06c7cee46022f077)
2007-10-10r2493: allow tdb to build standaloneAndrew Tridgell1-0/+4
(This used to be commit 0d5af5b70bd010e7107b18f73a4b899e05c4f025)
2007-10-10r2485: - add a test case in ldbtest for a bug pointed out by Jon Haswell.Andrew Tridgell2-3/+88
- fixed the bug shown with the above test, by initialising the sequence number to something different from the value used in ltdb_cache_free() (This used to be commit 856cdf82f24aada074ee5c605cccb2e8ceeea487)
2007-10-10r2484: allow ldb to build standalone againAndrew Tridgell1-0/+7
(This used to be commit 05601a4c6f7c7a019fcac8743e2e4775a498b26a)
2007-10-10r2454: fixed the accelerated StrCaseCmp() so it compares in the right orderAndrew Tridgell1-2/+2
(This used to be commit 4b795cbf12108e56e5e84e3073c24ce6b625e3c3)
2007-10-10r2446: implement socket_get_<peer|my>_<addr|port>() for ipv4Stefan Metzmacher1-5/+40
metze (This used to be commit a8ebb5c5bc6a8651867b46e87cf223cddf444e89)
2007-10-10r2441: set exit code correct when we got EBADF from select()Stefan Metzmacher1-0/+1
metze (This used to be commit 36bf2f3eaf2e7568563cd98dc941d20f4574d271)
2007-10-10r2439: - function that return just an int don't need a TALLOC_CTXStefan Metzmacher3-21/+22
- fix some return and state bugs metze (This used to be commit 2757c593ab746b9dd7090f2cf5fcc31686adf67f)
2007-10-10r2437: implemented a suggestion from abartlet that if we cannot convertAndrew Tridgell1-2/+5
strings to UTF16 in StrCaseCmp() that we fall back to a simpler comparison. (This used to be commit 2fa6ab9fe30aeacd7b1421fd83c409acf31c98aa)
2007-10-10r2430: got rid of StrnCaseCmp and added an accelerated version of StrCaseCmp()Andrew Tridgell1-29/+78
for places where known ascii strings are being compared we should just use strncasecmp() and other standard library functions (with replacements via lib/replace.c if needed) (This used to be commit 869b757bba729c9ecd720e3956958efc7541f353)
2007-10-10r2402: to make ms_fnmatch() case-insensitive we need toupper_w() exposedAndrew Tridgell1-1/+1
(This used to be commit 69413bdcfcf40e9ae2e5bcb00863cc7ef0ee8da1)
2007-10-10r2400: make ms_fnmatch() case insensitive. This is much more efficient thanAndrew Tridgell1-2/+4
uppercasing the two whole strings before the call is made, is less error-prone, and also copes with strings where the upper case version is longer than the lower case version due to different multi-byte lengths. (This used to be commit e227ac1edfd48596a9d5096b6965ddd0beb969a5)
2007-10-10r2381: added a -v debugging option to ldbeditAndrew Tridgell1-1/+31
(This used to be commit 03d4a7832cd3670a8166820a1b9b4aaf2307bd1a)
2007-10-10r2380: nicer error reporting in convert_string()Andrew Tridgell1-6/+9
(This used to be commit 6807d336c2365e4e7f45605d75667dbf05715b34)
2007-10-10r2365: remove MSG_NOSIGNALStefan Metzmacher1-1/+1
metze (This used to be commit 8ade8ab65fffea9172a768a60fe2bd32493c068f)
2007-10-10r2343: - make socket_get_*_addr() return char * not const char *Stefan Metzmacher3-28/+87
- add some error mappings - use some flags SOCKET_FLAG_PEEK ans SOCKET_FLAG_BLOCK metze (This used to be commit a375c6b0b1ec4d63251f63993f7798c1f2e7c717)
2007-10-10r2328: add the start of a new system and protocolStefan Metzmacher5-0/+621
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-10r2319: let event_merge_contexts() return a pointer to the final contextStefan Metzmacher1-1/+3
metze (This used to be commit 71aa5eeea73ea42e04ae224914b6815d72c1690a)
2007-10-10r2308: make talloc_vasprintf() available outside talloc.cAndrew Tridgell1-2/+1
(This used to be commit a3a15f9d1a3b51cb7099b5f3adb8401dfc37793d)
2007-10-10r2302: added a '--option' option, allowing any global or default option inAndrew Tridgell1-3/+15
smb.conf to be set on the command line. For example, you can use: smbtorture --option 'unicode=false' or smbtorture --option 'netbios name=myname' (This used to be commit 360a6b530e2295976ddefc138d1333411a94484d)
2007-10-10r2283: Change from tridge (in his ntlm2 patch).Andrew Bartlett1-3/+7
I think the idea here is to bail out correctly when we get signing broken on TCP, rather than keeping on hammering the socket. Andrew Bartlett (This used to be commit 553b529a0991ccf2f1be14cc6a27695223f02e65)
2007-10-10r2272: fixed another couple of errors in the popt option arraysAndrew Tridgell1-2/+2
(This used to be commit 89acbf4f02ae03f0546e1633c030765a563ce958)
2007-10-10r2257: Tab completion support in regshell (complete command names and key namesJelmer Vernooij2-1/+125
in the current key) (This used to be commit 83f9f8eaa4825bb49e2b160a1a810080ecae4d39)
2007-10-10r2254: Fix a couple of compiler warnings...Jelmer Vernooij4-16/+7
(This used to be commit 8056f4a9a7f5065eeb3a3bec81977c5e4163bf8e)
2007-10-10r2238: the tdb_debug() function was totally bogus - remove it (you can'tAndrew Tridgell3-36/+23
convert a ... varargs function to a va_list by just a cast!!) also mark the tdb log function with PRINTF_ATTRIBUTE() and fixed some bad format errors in tdb.c that jim found. (This used to be commit c26c92eb8f538748fcbb2ae5a0a8a02bffbbbf86)
2007-10-10r2212: Optimisation. Passes masktest against W2K3.Jeremy Allison1-0/+3
Jeremy. (This used to be commit fb7a529c4c65788c307c1043cf2b664059ed8c2a)