1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-04 08:23:50 +03:00
Commit Graph

15 Commits

Author SHA1 Message Date
Jelmer Vernooij
b90da2337b r2684: Free the right talloc context (don't panic when encountering illegal multibyte
sequences)
2007-10-10 12:59:22 -05:00
Andrew Tridgell
8dc23821c9 r2671: we're getting too many errors caused by the talloc_realloc() API not
taking a context (so when you pass a NULL pointer you end up with
memory in a top level context). Fixed it by changing the API to take a
context. The context is only used if the pointer you are reallocing is
NULL.
2007-10-10 12:59:20 -05:00
Andrew Tridgell
28dcd22029 r2642: smb_iconv_t is a pointer, so checks against -1 errors should use a cast 2007-10-10 12:59:15 -05:00
Andrew Tridgell
60e8d154fd r2638: do lazy initialisation of iconv handles, so we don't initialise a
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.
2007-10-10 12:59:15 -05:00
Andrew Bartlett
dfecb01506 r2552: Character set conversion and string handling updates.
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).
2007-10-10 12:59:05 -05:00
Andrew Tridgell
6807d336c2 r2380: nicer error reporting in convert_string() 2007-10-10 12:58:46 -05:00
Andrew Tridgell
756f28ac95 r2159: converted samba4 over to UTF-16.
I had previously thought this was unnecessary, as windows doesn't use
standards compliant UTF-16, and for filesystem operations treats bytes
as UCS-2, but Bjoern Jacke has pointed out to me that this means we
don't correctly store extended UTF-16 characters as UTF-8 on
disk. This can be seen with (for example) the gothic characters with
codepoints above 64k.

This commit also adds a LOCAL-ICONV torture test that tests the first
1 million codepoints against the system iconv library, and tests 5
million random UTF-16LE buffers for identical error handling to the
system iconv library.

the lib/iconv.c changes need backporting to samba3
2007-10-10 12:58:27 -05:00
Andrew Tridgell
168be7fbd7 r2106: try to cope with a wider range of UTF-16 characters when we are using
an external libiconv library.
2007-10-10 12:58:25 -05:00
Andrew Bartlett
4f06bf4ab8 r1196: Remove unused pstring/fstring functions.
Andrew Bartlett
2007-10-10 12:56:44 -05:00
Andrew Tridgell
b7935c9674 r934: on ascii strings STR_TERMINATE_ASCII should trigger STR_TERMINATE behaviour 2007-10-10 12:56:20 -05:00
Andrew Bartlett
5f5786ad5f r831: These functions duplicate the push/pull charcnv interfaces that we use
everywhere else in the Samba code, so remove them for clarity.

(ok, so  also just never liked the names  ;-)

Andrew Bartlett
2007-10-10 12:53:53 -05:00
Andrew Tridgell
a0a51af6b7 added support for big-endian ucs2 strings (as used by big-endian
msrpc).

this was easier than I expected!
-
Andrew Tridgell
02d068ba7d more fixes from the IRIX compiler (thanks herb!) -
Andrew Tridgell
c770603ac6 fixed some places where we don't brace (flags & STR_UNICODE)
this fixes the samba4 server with ascii clients
-
Andrew Tridgell
b0510b5428 first public release of samba4 code -