summaryrefslogtreecommitdiffstats
path: root/lib/util/charset
Commit message (Collapse)AuthorAgeFilesLines
* lib/util/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* iconv: Use a static buffer in iconf not to spoil the talloc_poolVolker Lendecke2013-12-141-15/+1
| | | | | | | | | | | This is a buffer that is strictly used like a stack variable. This patch makes it one and while there it fixes an error path memleak. In the "pull_failed" case we did not talloc_free(cvtbuf). With talloc_tos(), this does not really matter, but for code without this it does. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib/util/charset: We do not use fucntions from wchar.h any moreAndrew Bartlett2012-09-261-7/+1
| | | | | Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Sep 26 02:13:10 CEST 2012 on sn-devel-104
* lib/util/charset: Try to find iconv on HP-UXAndrew Bartlett2012-09-261-0/+3
|
* lib/util: Fix typo in comment.Jelmer Vernooij2012-06-151-1/+1
|
* charset: Remove unused strcmp_w()Andrew Bartlett2012-02-102-15/+0
| | | | | | | | Found by callcatcher. Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html Andrew Bartlett
* charset: Remove unused iconv_talloc()Andrew Bartlett2012-02-103-120/+1
| | | | | | Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html Andrew Bartlett
* charset/tests: Add prototypes for test functions.Jelmer Vernooij2012-02-072-0/+7
|
* lib/charset: Remove an unused variableVolker Lendecke2011-12-251-0/+2
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sun Dec 25 15:07:56 CET 2011 on sn-devel-104
* s3: Fix fn signatures in charset_macosx.cVolker Lendecke2011-12-252-6/+6
|
* lib/util/charset Remove unused header smb_common.hAndrew Bartlett2011-10-241-1/+0
| | | | | | | | This should fix a compile issue on hosts without gssapi/gssapi.h. Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
* Fix const warnings.Jeremy Allison2011-10-141-4/+4
|
* build: Fix waf build on MacOS XAndrew Bartlett2011-09-231-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
* lib/util/charset: remove charset module loadingAndrew Bartlett2011-09-209-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
* lib/util/charcnv: Remove broken internal CP850 and CP464 modulesAndrew Bartlett2011-09-204-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
* lib/util/charset: the comparsion must be against our charset modulesAndrew Bartlett2011-09-101-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
* lib/util/charset Use name of ISO-8859-1 that matches our internal implementationAndrew Bartlett2011-09-101-44/+44
|
* lib/util/charset: Improve toture assertions in iconv testAndrew Bartlett2011-09-101-1/+14
|
* lib/util/charset Run charset sets with and without the system iconvAndrew Bartlett2011-09-103-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
* lib/util/charset: add back loading of charset modulesAndrew Bartlett2011-09-102-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
* Fix bug 8433, segfault in iconv.cVolker Lendecke2011-09-011-1/+0
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Thu Sep 1 18:25:34 CEST 2011 on sn-devel-104
* charset: Make name lowercase everywhere.Jelmer Vernooij2011-07-231-5/+5
|
* Second part of fix for bug 8310 - toupper_ascii() is broken on big-endian ↵Jeremy Allison2011-07-192-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
* First part of fix for bug 8310 - toupper_ascii() is broken on big-endian systemsJeremy Allison2011-07-192-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.
* lib: Allow NULL converted_size in convert_string_tallocVolker Lendecke2011-06-241-2/+6
|
* lib/util/charset: Remove autodetection of charset from LOCALEAndrew Bartlett2011-06-231-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
* lib/util/charset: Remove 'display charset'Andrew Bartlett2011-06-234-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
* Fix numerous missing dependencies in WAF build scriptsSean Finney2011-05-251-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
* lib/util/charset: Remove unused strcasecmp_w and strncasecmp_wAndrew Bartlett2011-05-181-32/+0
| | | | | Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed May 18 17:22:15 CEST 2011 on sn-devel-104
* lib/util/charset use talloc_stackframe() rather than talloc_tos()Andrew Bartlett2011-05-181-12/+12
| | | | | | | This is common code, and we can't assume a talloc_stackframe() so we must create it. Andrew Bartlett
* lib/util/charset Don't allow invalid 'dos charset = utf8'Andrew Bartlett2011-05-181-0/+5
| | | | | | | No DOS client used UTF8, and this creates subtle, difficult to disagnose breakage of schannel (domain membership). Andrew Bartlett
* lib/util/charset: fix the toplevel MacOS X build.Günther Deschner2011-05-171-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
* lib/util/charset Move built-in charset modules to the top levelAndrew Bartlett2011-05-136-1/+1028
| | | | | | | This removes the 'charset' subsystem and allows these modules to be used across the whole of Samba. Andrew Bartlett
* Fix many const compiler warnings.Jeremy Allison2011-05-052-4/+4
|
* Clean up some const and other compiler warnings.Jeremy Allison2011-05-052-6/+6
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu May 5 00:59:40 CEST 2011 on sn-devel-104
* lib/util/charset Use push_string and talloc_strupper/strlower from common codeAndrew Bartlett2011-05-032-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
* Remove strlower_m() and strupper_m() from source4 and common code.Andrew Bartlett2011-05-032-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
* lib/util/charset Move strstr_m() to the top levelAndrew Bartlett2011-04-292-0/+84
|
* lib/util/charset Merge talloc-based pull and push charset functionsAndrew Bartlett2011-04-283-95/+151
| | | | | | These were copied from source3/lib/charcnv.c Andrew Bartlett
* lib/util/charset Add copyright headersAndrew Bartlett2011-04-281-1/+2
| | | | | Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Thu Apr 28 04:13:44 CEST 2011 on sn-devel-104
* lib/util/charset Make fast path from UTF16 to '8 bit' charsets clearerAndrew Tridgell2011-04-281-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>
* lib/util/charset Add tests for srclen=-1 behaviour.Andrew Bartlett2011-04-281-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>
* lib/util/charset use convert_string.c in commonAndrew Bartlett2011-04-284-204/+5
| | | | | | | | This brings another layer of the charcnv library in common. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* lib/util/charset Fix string termination conditions for UTF16 stringsAndrew Bartlett2011-04-281-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>
* dynconfig: Have only one dynconfig.o in the common code.Andrew Bartlett2011-04-271-1/+1
|
* lib/util/charset Always set *converted_size even on failureAndrew Bartlett2011-04-201-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
* lib/util/charset create _handle functions for convert_string() et alAndrew Bartlett2011-04-201-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
* lib/util Move alpha_strcpy() from s3 into common codeAndrew Bartlett2011-04-141-46/+0
| | | | | Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Thu Apr 14 09:21:59 CEST 2011 on sn-devel-104
* lib: Move next_token next to next_token_tallocVolker Lendecke2011-04-131-47/+0
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3-charcnv: Move convert_string() et al to lib/util/charsetAndrew Bartlett2011-04-131-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>