summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* lib/util/charset Rename convert_string test to allow a 'non_handle' testAndrew Bartlett2011-04-131-3/+2
| | | | | | | | | A future commit will test (with a subset of tests) the varient of this function without _handle. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* lib/util/charset Add more tests for convert_string_error_handle()Andrew Bartlett2011-04-131-0/+101
| | | | | | | | | This helps define the semantics of this function very clearly, particularly for partial and invalid inputs. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* lib/util/charset Preserve 'pull' errors even when converting via UTF16Andrew Bartlett2011-04-131-3/+8
| | | | | | | | | | | | | | When we do not have a direct iconv handle between any two charsets, we must go iva UTF16. However, we should still return the same buffer and error code as if we were able to go direct - including the partial conversion and the error code. This is important for locating the invalid multibyte character in the stream, for example. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* lib/util/charset Add tests for convert_string_error_handleAndrew Bartlett2011-04-131-1/+68
| | | | | | | | | These confirm that the errno is set correctly and that we stop on a partial multibyte character Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* lib/util/charset Add expected values for upper/lower case testsAndrew Bartlett2011-04-131-0/+16
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* lib/util/charset Fix and add public interface for convert_string_error_handleAndrew Bartlett2011-04-132-7/+14
| | | | | | | | | It makes much more sense for this to match the source3/ interface and return a bool. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* lib/util: Make string_replace from s3 commonAndrew Bartlett2011-04-132-10/+43
| | | | | | | | | The s4 implementation didn't do multibyte strings, so was only good for '/' which is known to be safe in all multibyte charsets. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* lib/util ucs2_align is identical, put it in commonAndrew Bartlett2011-04-132-7/+7
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* lib/util Move simple string routines into common code.Andrew Bartlett2011-04-134-55/+82
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* lib/util/charset Move source3/lib/util_unistr.c to the common code.Andrew Bartlett2011-04-133-1/+345
| | | | | | | | This file (largely) contains functions to deal with UTF16 strings. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* lib/util make UTIL_TDB a libraryAndrew Bartlett2011-04-131-2/+3
|
* talloc/testsuite: avoid memory leak reported by valgrindStefan Metzmacher2011-04-081-1/+1
| | | | | | | | | metze Signed-off-By: Andrew Tridgell <tridge@samba.org> Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Fri Apr 8 10:15:41 CEST 2011 on sn-devel-104
* talloc/testsuite: test more talloc_pool related thingsStefan Metzmacher2011-04-081-0/+55
| | | | | | metze Signed-off-By: Andrew Tridgell <tridge@samba.org>
* talloc: include valgrind headers if availableStefan Metzmacher2011-04-081-0/+9
| | | | | | metze Signed-off-By: Andrew Tridgell <tridge@samba.org>
* talloc: add TC_INVALIDATE_POOL marcoStefan Metzmacher2011-04-081-3/+38
| | | | | | metze Signed-off-By: Andrew Tridgell <tridge@samba.org>
* talloc: add TC_UNDEFINE_GROW_CHUNK() marcoStefan Metzmacher2011-04-081-0/+21
| | | | | | metze Signed-off-By: Andrew Tridgell <tridge@samba.org>
* talloc: add TC_INVALIDATE_SHRINK_CHUNK() marcoStefan Metzmacher2011-04-081-0/+28
| | | | | | | | This invalidates the unused bytes if we shrink memory. metze Signed-off-By: Andrew Tridgell <tridge@samba.org>
* talloc: add TC_INVALIDATE_FULL_CHUNK() macroStefan Metzmacher2011-04-081-12/+36
| | | | | | | | | This makes it easier to mark a talloc pointer as invalid. metze Signed-off-By: Andrew Tridgell <tridge@samba.org>
* talloc: use VALGRIND_MAKE_MEM_UNDEFINED() before memmove()Stefan Metzmacher2011-04-081-0/+12
| | | | | | metze Signed-off-By: Andrew Tridgell <tridge@samba.org>
* talloc: optimize talloc_free() and talloc_realloc() for talloc poolsStefan Metzmacher2011-04-081-22/+138
| | | | | | metze Signed-off-By: Andrew Tridgell <tridge@samba.org>
* talloc: add TC_POOL_FIRST_CHUNK() macroStefan Metzmacher2011-04-081-2/+5
| | | | | | metze Signed-off-By: Andrew Tridgell <tridge@samba.org>
* talloc: add TC_POOL_SPACE_LEFT() macroStefan Metzmacher2011-04-081-2/+5
| | | | | | metze Signed-off-By: Andrew Tridgell <tridge@samba.org>
* talloc: add TC_ALIGN16() macroStefan Metzmacher2011-04-081-2/+3
| | | | | | metze Signed-off-By: Andrew Tridgell <tridge@samba.org>
* talloc: use TC_HDR_SIZE instead of sizeof(struct talloc_chunk)Stefan Metzmacher2011-04-081-1/+1
| | | | | | | | As this includes the padding to 16 bytes. metze Signed-off-By: Andrew Tridgell <tridge@samba.org>
* lib/crypto: rename the SHA256_ functions to samba_SHA256_Andrew Tridgell2011-04-063-18/+18
| | | | | | | this prevents a symbol duplication with the openssl library, which may be linked in via a secondary library dependency Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* lib: make asn1_util a private libraryAndrew Tridgell2011-04-061-4/+5
| | | | | | | this prevents symbol duplication of the asn1 symbols in the service and ntvfs subsystems Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* lib: moved data_blob.c into samba-util-commonAndrew Tridgell2011-04-061-2/+2
| | | | | | | this avoids a duplication of the data_blob symbols some binaries (eg. smbtorture) Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* talloc - some documentation changesMatthias Dieter Wallnöfer2011-04-042-53/+48
| | | | | | | | | | | - Fix some typos - Document better the differences in the behaviour between talloc 1.X and 2.X. Previously this seemed a bit spongy to me. Reviewed-by: Jelmer + Tridge Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Mon Apr 4 11:05:42 CEST 2011 on sn-devel-104
* debug: default debug to stderr Andrew Tridgell2011-04-041-1/+2
| | | | | | | if setup_logging() hasn't been called then default to sending debug to stderr Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* debug: Restore the s3-style check in check_log_size()Volker Lendecke2011-03-311-1/+6
| | | | | | | This has caused me considerable grief. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Thu Mar 31 19:42:38 CEST 2011 on sn-devel-104
* lib/util/charset Add tests for strcasecmp_m(), talloc_strupper() et alAndrew Bartlett2011-03-314-15/+241
| | | | | | | | | | | | | | | | | | This adds tests for: strncasecmp_m strcasecmp_m strupper_talloc_n strlower_talloc strhaslower strhasupper The tests can certainly be improved with pre-calculated upper and lower case text, but this at least puts them though their paces. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Thu Mar 31 14:24:22 CEST 2011 on sn-devel-104
* charconv: Use talloc_tos() in the S3 buildVolker Lendecke2011-03-311-1/+9
| | | | | | | | In S3 we put a talloc_pool on top of the stack so that an allocation from talloc_tos() normally is just a pointer increment. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Thu Mar 31 09:14:01 CEST 2011 on sn-devel-104
* Arg. I hate the "if (xxx) return foo" all on one line style of code.Jeremy Allison2011-03-311-2/+8
| | | | | | | Fix the talloc leaks I introduced by not spotting these returns. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Mar 31 05:19:34 CEST 2011 on sn-devel-104
* Don't burn 2k of stack on every iconv, use the heap when it's a slow call.Jeremy Allison2011-03-311-16/+25
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Mar 31 04:09:09 CEST 2011 on sn-devel-104
* lib/util/charset smb_panic() on incorrect use of strlen_m_extAndrew Bartlett2011-03-311-0/+18
| | | | | | | | | This may save a developer some time in the future. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Thu Mar 31 02:40:31 CEST 2011 on sn-devel-104
* lib/util/charset Add tests for strlen_m_ext() and convert_string_talloc()Andrew Bartlett2011-03-311-2/+87
| | | | | | | This convers a few more cases for convert_string_talloc() and introduces tests for strlen_m_ext() across complex multibyte strings. Andrew Bartlett
* lib/util/charset Add wrapper to allow testing of strlen_m_ext()Andrew Bartlett2011-03-312-2/+22
| | | | | | | This allows test routines to force in particular character sets, and not rely on the smb.conf. Andrew Bartlett
* lib/util/charset correct calculation of UTF8 character sizesAndrew Bartlett2011-03-311-1/+1
| | | | | | Characters between 0x800 0x0FFFF are 3 bytes long. Andrew Bartlett
* Fix convert_string() to take a *converted_size arg. and return a bool.Jeremy Allison2011-03-304-39/+51
| | | | | | | | Makes these interfaces much harder to misuse and easier to ensure error checking. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Mar 30 23:59:37 CEST 2011 on sn-devel-104
* lib/util/charset Add tests for convert_string_talloc_handle()Andrew Bartlett2011-03-303-0/+431
| | | | | | | Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed Mar 30 13:02:47 CEST 2011 on sn-devel-104
* lib/util Move base64 functions into lib/util/base64.cAndrew Bartlett2011-03-304-3/+155
| | | | Andrew Bartlett
* lib/util/charset Remove pointless static bool initialisedAndrew Bartlett2011-03-301-5/+0
|
* tdb: Fix Coverity ID 2238: SECURE_CODINGVolker Lendecke2011-03-301-24/+24
|
* talloc - improve doxygen comment of "talloc_move"Matthias Dieter Wallnöfer2011-03-301-3/+3
| | | | | | Express better that this should be a pointer of a pointer. Reviewed-by: Tridge
* s3-messages: only include messages.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* lib/util/util_pw: share more code between lib/util/util_pw.c and ↵Günther Deschner2011-03-302-8/+12
| | | | | | source3/lib/username.c Guenther
* lib/util/util_pw: share sys_get{pw,gr} group of calls.Günther Deschner2011-03-303-0/+94
| | | | Guenther
* lib/util/util_pw: temporary rename of getpwnam_alloc and getpwuid_alloc.Günther Deschner2011-03-301-2/+2
| | | | Guenther
* debug: ignore debug_set_logfile() with a blank stringAndrew Tridgell2011-03-291-1/+5
| | | | | | | Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Tue Mar 29 07:03:58 CEST 2011 on sn-devel-104
* lib: removed a spurios declaration of 'logfile'Andrew Tridgell2011-03-291-1/+0
| | | | | | we don't have a global logfile variable any more Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>