Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
|
|
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
|
|
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
|
|
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
|
|
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed May 18 17:22:15 CEST 2011 on sn-devel-104
|
|
This is common code, and we can't assume a talloc_stackframe() so we
must create it.
Andrew Bartlett
|
|
No DOS client used UTF8, and this creates subtle, difficult to
disagnose breakage of schannel (domain membership).
Andrew Bartlett
|
|
Guenther
Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue May 17 16:16:59 CEST 2011 on sn-devel-104
|
|
This removes the 'charset' subsystem and allows these modules to be
used across the whole of Samba.
Andrew Bartlett
|
|
|
|
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu May 5 00:59:40 CEST 2011 on sn-devel-104
|
|
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
|
|
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
|
|
|
|
These were copied from source3/lib/charcnv.c
Andrew Bartlett
|
|
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Apr 28 04:13:44 CEST 2011 on sn-devel-104
|
|
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>
|
|
This confirms that we do include a null terminator in all non-failed
conversions.
Andrew Bartlett
Signed-off-by: Andrew Tridgell <tridge@samba.org>
|
|
This brings another layer of the charcnv library in common.
Andrew Bartlett
Signed-off-by: Andrew Tridgell <tridge@samba.org>
|
|
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>
|
|
|
|
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
|
|
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
|
|
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Apr 14 09:21:59 CEST 2011 on sn-devel-104
|
|
Signed-off-by: Jeremy Allison <jra@samba.org>
|
|
This is the first step to this being the common convert_string
implementation.
Andrew Bartlett
Signed-off-by: Andrew Tridgell <tridge@samba.org>
|
|
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>
|
|
This adds an interface that matches the source3/ convert string code.
Andrew Bartlett
Signed-off-by: Andrew Tridgell <tridge@samba.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Andrew Tridgell <tridge@samba.org>
|
|
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>
|
|
This file (largely) contains functions to deal with UTF16 strings.
Andrew Bartlett
Signed-off-by: Andrew Tridgell <tridge@samba.org>
|
|
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
|
|
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
|
|
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
|
|
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Mar 31 04:09:09 CEST 2011 on sn-devel-104
|
|
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
|
|
This convers a few more cases for convert_string_talloc() and
introduces tests for strlen_m_ext() across complex multibyte strings.
Andrew Bartlett
|
|
This allows test routines to force in particular character sets, and
not rely on the smb.conf.
Andrew Bartlett
|
|
Characters between 0x800 0x0FFFF are 3 bytes long.
Andrew Bartlett
|
|
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
|
|
Andrew Bartlett
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Mar 30 13:02:47 CEST 2011 on sn-devel-104
|
|
|
|
use _handle for handle based functions
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Mar 25 05:22:24 CET 2011 on sn-devel-104
|
|
This better reflects what this structure is
Andrew Bartlett
|