summaryrefslogtreecommitdiff
path: root/lib/util/charset
AgeCommit message (Collapse)AuthorFilesLines
2011-09-23build: Fix waf build on MacOS XAndrew Bartlett1-1/+1
The -framework CoreFoundation is required by the charset_macosxfs module The system/time.h header is required to access the replacement clock_gettime() Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Sep 23 10:58:02 CEST 2011 on sn-devel-104
2011-09-20lib/util/charset: remove charset module loadingAndrew Bartlett9-172/+105
Now that the 'table' modules are gone, there is no reason for there to be charset modules at all. This builds the macosxfs and weird modules into the binary at the appropriate times, and changes the tests to test instead the difference between the remaining internal handlers and iconv(). Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Sep 20 06:27:06 CEST 2011 on sn-devel-104
2011-09-20lib/util/charcnv: Remove broken internal CP850 and CP464 modulesAndrew Bartlett4-364/+0
These modules are now known to be faulty, and Samba 3.6.0 didn't include support for them, so we now require a system iconv if you wish to support these character sets for the non-ASCII range. Andrew Bartlett
2011-09-10lib/util/charset: the comparsion must be against our charset modulesAndrew Bartlett1-2/+2
There is little point testing this against the system iconv. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Sat Sep 10 15:45:42 CEST 2011 on sn-devel-104
2011-09-10lib/util/charset Use name of ISO-8859-1 that matches our internal implementationAndrew Bartlett1-44/+44
2011-09-10lib/util/charset: Improve toture assertions in iconv testAndrew Bartlett1-1/+14
2011-09-10lib/util/charset Run charset sets with and without the system iconvAndrew Bartlett3-14/+28
We need to know that we can load the samba-provided modules, and that they are correct. However, we must mark a number of tests as knownfail due to errors in our internal iconv modules. Andrew Bartlett
2011-09-10lib/util/charset: add back loading of charset modulesAndrew Bartlett2-34/+64
For autoconf builds these remain as modules, for waf builds they are built into the charset library. This is required to provide the CP850 charset when iconv is not available. The charset modules static for the waf builds because with proper shared libs, there isn't the same need for these to be in seperate .so files. The modules are also not produced if a system iconv is found, except for developers, to allow testing of both code paths. Andrew Bartlett
2011-09-01Fix bug 8433, segfault in iconv.cVolker Lendecke1-1/+0
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Thu Sep 1 18:25:34 CEST 2011 on sn-devel-104
2011-07-23charset: Make name lowercase everywhere.Jelmer Vernooij1-5/+5
2011-07-19Second part of fix for bug 8310 - toupper_ascii() is broken on big-endian ↵Jeremy Allison2-0/+12
systems. Re-add: smb_ucs2_t toupper_w(smb_ucs2_t v); and ensure it is called whenever we are operating on smb_ucs2_t variables. I'd like to make the definition of smb_ucs2_t incompatible with int and codepoint_t so they can't be mixed, but that's a patch for another time. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Jul 19 23:48:05 CEST 2011 on sn-devel-104
2011-07-19First part of fix for bug 8310 - toupper_ascii() is broken on big-endian systemsJeremy Allison2-42/+0
Remove int toupper_ascii(int c); int tolower_ascii(int c); int isupper_ascii(int c); int islower_ascii(int c); and replace with their _m equivalents, as they are identical.
2011-06-24lib: Allow NULL converted_size in convert_string_tallocVolker Lendecke1-2/+6
2011-06-23lib/util/charset: Remove autodetection of charset from LOCALEAndrew Bartlett1-31/+0
In the past, our LOCALE would set the display charset of Samba. The display charset has now been removed. This patch removes the support code that detected the locale from the environment. We cannot safely have 'unix charset' follow the locale (at it creates files on disk and entries in databases that must not vary), so this code is unused. As an example, imagine a database is manipulated in the administrator's locale, and then read by smbd starting up in the system default locale. Or smbd restarted by the administrator rather than a startup script. Both of these situations could corrupt databases or filenames on disk. Andrew Bartlett
2011-06-23lib/util/charset: Remove 'display charset'Andrew Bartlett4-69/+60
As discussed in 'CH_DISPLAY and gettext' on the samba-technical list: http://lists.samba.org/archive/samba-technical/2011-June/078190.html Setting this to a value other than 'unix charset' does not make sense, as any system where the filesytem charset does not equal the terminal charset will already have problems with programs as simple as 'ls'. It also means that our output could not be pasted as our input in interactive programs or onto our command line, as we never did translate in the DISPLAY -> UNIX direction. The d_printf() calls are retained in case we need to revisit this, and to support display_set_stderr(). Andrew Bartlett
2011-05-25Fix numerous missing dependencies in WAF build scriptsSean Finney1-2/+2
With the recent consolidation of code between s3 and s4, a number of new dependencies have been implicitly introduced. For example, previous s3 code gained an implicit dependency on talloc after the charset related consolidation (lib/util/charset/charset.h now includes talloc.h). When building against the embedded version of talloc this isn't a problem since the paths are automatically added to the search path, but when building against the external libraries build failures will occur for all components that don't directly or indirectly include talloc as a dependency. Since charset.h is included from util.h, which in turn is included from includes.h, this means most of the codebase (s3 and s4) has such an undeclared dependency. Therefore, samba-util-common and samba-util have been added as dependencies to the s3 and s4 code respectively, for all cases where the source would otherwise fail to build. Additionally, a few other dependencies are added in specific wscript_build files to address similar dependency-related problems. https://bugzilla.samba.org/show_bug.cgi?id=8128 Signed-off-by: Sean Finney <seanius@seanius.net> Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Wed May 25 19:22:13 CEST 2011 on sn-devel-104
2011-05-18lib/util/charset: Remove unused strcasecmp_w and strncasecmp_wAndrew Bartlett1-32/+0
Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed May 18 17:22:15 CEST 2011 on sn-devel-104
2011-05-18lib/util/charset use talloc_stackframe() rather than talloc_tos()Andrew Bartlett1-12/+12
This is common code, and we can't assume a talloc_stackframe() so we must create it. Andrew Bartlett
2011-05-18lib/util/charset Don't allow invalid 'dos charset = utf8'Andrew Bartlett1-0/+5
No DOS client used UTF8, and this creates subtle, difficult to disagnose breakage of schannel (domain membership). Andrew Bartlett
2011-05-17lib/util/charset: fix the toplevel MacOS X build.Günther Deschner1-2/+3
Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Tue May 17 16:16:59 CEST 2011 on sn-devel-104
2011-05-13lib/util/charset Move built-in charset modules to the top levelAndrew Bartlett6-1/+1028
This removes the 'charset' subsystem and allows these modules to be used across the whole of Samba. Andrew Bartlett
2011-05-05Fix many const compiler warnings.Jeremy Allison2-4/+4
2011-05-05Clean up some const and other compiler warnings.Jeremy Allison2-6/+6
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu May 5 00:59:40 CEST 2011 on sn-devel-104
2011-05-03lib/util/charset Use push_string and talloc_strupper/strlower from common codeAndrew Bartlett2-17/+10
The only caller of push_string() (not to be confused with push_string_check()) in the common code was encode_pw_buffer(), and it didn't use the alignment or STR_UPPER flags. The talloc_strupper() and talloc_strlower() functions are tested in smbtorture, and are next_codepoint() based. Andrew Bartlett
2011-05-03Remove strlower_m() and strupper_m() from source4 and common code.Andrew Bartlett2-86/+0
This function is problematic because a string may expand in size when changed into upper or lower case. This will then push characters off the end of the string in the s3 implementation, or panic in the former s4 implementation. Andrew Bartlett
2011-04-29lib/util/charset Move strstr_m() to the top levelAndrew Bartlett2-0/+84
2011-04-28lib/util/charset Merge talloc-based pull and push charset functionsAndrew Bartlett3-95/+151
These were copied from source3/lib/charcnv.c Andrew Bartlett
2011-04-28lib/util/charset Add copyright headersAndrew Bartlett1-1/+2
Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Thu Apr 28 04:13:44 CEST 2011 on sn-devel-104
2011-04-28lib/util/charset Make fast path from UTF16 to '8 bit' charsets clearerAndrew Tridgell1-14/+28
This breaks the fast path into handling for -1 and handling for specified lenghts, avoding branch operations on each character. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-28lib/util/charset Add tests for srclen=-1 behaviour.Andrew Bartlett1-0/+443
This confirms that we do include a null terminator in all non-failed conversions. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-28lib/util/charset use convert_string.c in commonAndrew Bartlett4-204/+5
This brings another layer of the charcnv library in common. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-28lib/util/charset Fix string termination conditions for UTF16 stringsAndrew Bartlett1-4/+4
This punts partial UTF16 strings to iconv() to deal with, as it's not a fast path any longer if it's got an odd length. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-27dynconfig: Have only one dynconfig.o in the common code.Andrew Bartlett1-1/+1
2011-04-20lib/util/charset Always set *converted_size even on failureAndrew Bartlett1-4/+2
The caller may wish to inspect the partially converted string. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed Apr 20 05:17:48 CEST 2011 on sn-devel-104
2011-04-20lib/util/charset create _handle functions for convert_string() et alAndrew Bartlett1-29/+86
This is now API compatible with the existing code in lib/util/charset lazy_initialize_conv() is no longer called as init_iconv() is called when the smb.conf is processed, and get_conv_handle() will auto-init with defaults if required. load_case_tables_library() is no longer requried as all binaries and libraries already load these in their entry points, as otherwise all the other string functions would fail. Andrew Bartlett
2011-04-14lib/util Move alpha_strcpy() from s3 into common codeAndrew Bartlett1-46/+0
Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Thu Apr 14 09:21:59 CEST 2011 on sn-devel-104
2011-04-13lib: Move next_token next to next_token_tallocVolker Lendecke1-47/+0
Signed-off-by: Jeremy Allison <jra@samba.org>
2011-04-13s3-charcnv: Move convert_string() et al to lib/util/charsetAndrew Bartlett1-0/+467
This is the first step to this being the common convert_string implementation. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13lib/util/charset Add many more charset testsAndrew Bartlett1-15/+444
This confirms that the behaviour of the convert_string() API (with the process-wide iconv handle). Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13lib/util/charset Add convert_string_error()Andrew Bartlett2-0/+25
This adds an interface that matches the source3/ convert string code. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13lib/util/charset Make ASCII conversion validate it's inputAndrew Bartlett1-4/+69
We should not just strip the high bits off unicode strings being converted to ASCII, we need to actually fail the conversion. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13lib/util/charset Rename convert_string test to allow a 'non_handle' testAndrew Bartlett1-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>
2011-04-13lib/util/charset Add more tests for convert_string_error_handle()Andrew Bartlett1-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>
2011-04-13lib/util/charset Preserve 'pull' errors even when converting via UTF16Andrew Bartlett1-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>
2011-04-13lib/util/charset Add tests for convert_string_error_handleAndrew Bartlett1-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>
2011-04-13lib/util/charset Add expected values for upper/lower case testsAndrew Bartlett1-0/+16
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13lib/util/charset Fix and add public interface for convert_string_error_handleAndrew Bartlett2-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>
2011-04-13lib/util/charset Move source3/lib/util_unistr.c to the common code.Andrew Bartlett3-1/+345
This file (largely) contains functions to deal with UTF16 strings. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-03-31lib/util/charset Add tests for strcasecmp_m(), talloc_strupper() et alAndrew Bartlett4-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
2011-03-31charconv: Use talloc_tos() in the S3 buildVolker Lendecke1-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