1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

96 Commits

Author SHA1 Message Date
Jeremy Allison
16e6d22408 Fix valgrind-found read of uninit variable (ensure length is right).
Jeremy.
(This used to be commit 6fc0e529f7)
2003-09-08 21:26:30 +00:00
Jeremy Allison
966b0fc7c9 More cachegrind tuning, plus fix an error message.
Jeremy.
(This used to be commit 8cb9ec5d53)
2003-09-05 21:30:50 +00:00
Jeremy Allison
94f59f5492 More tuning from cachegrind. Change most trim_string() calls to trim_char(0,
as that's what they do. Fix string_replace() to fast-path ascii.
Jeremy.
(This used to be commit f35e9a8b90)
2003-09-05 19:59:55 +00:00
Jeremy Allison
0e8c2a4133 More hand-tuning of the fastpath. Don't do strlen() when we're doing
to walk to the end anyway.
Jeremy.
(This used to be commit 467cafdb1f)
2003-09-04 23:03:58 +00:00
Jeremy Allison
22831019dc Remove convert_string_internal completely from fast path when processing
NBENCH calls. Requires fixed buffer size for strdup_upper().
Jeremy.
(This used to be commit e98fbfaf38)
2003-09-04 18:40:55 +00:00
Jeremy Allison
245fbf7efb Used cachegrind to track down some bottlenecks.
Removed calls to clobber_region when not compiling with developer as
they were hiding speed problems.
Added fast path to convert_string() when dealing with ascii -> ascii,
ucs2-le to ascii and ascii to ucs2-le with values <= 0x7F. This
gives a speedup of 22% on my nbench tests.
Next I will do this on convert_string_allocate.
Jeremy.
(This used to be commit ef140d15ea)
2003-09-04 01:12:39 +00:00
Jeremy Allison
dac11b890b Half-way though the big conversion of all nmbd access to wire elements being
converted to pull/push_ascii. This will not work right at the moment for non
English codepages, but compiles - I will finish the work over the weekend.
Then nmbd should be completely codepage correct.
Jeremy.
(This used to be commit 236d6adadf)
2003-08-23 01:59:14 +00:00
Jeremy Allison
a8eda05d75 Shut conversion errors up when initialising tables.
Jeremy.
(This used to be commit 94d0f888c9)
2003-08-21 23:55:29 +00:00
Jeremy Allison
ecddae8bf0 Attempt to fix the charcnv issues causing nmbd to crash. If we get a failed
conversion simply copy as is. Also fixed the horrid malloc-twice-copy code
in the convert alloc path.
Jeremy.
(This used to be commit cfde7477fd)
2003-08-20 22:06:19 +00:00
Andrew Bartlett
4b3e0268b5 Use push_ucs2_allocate(), rather than convert_string_allocate() directly.
Remove strdup_upper/strdup_lower from their old file, now that they have
been moved to charcnv.c

Note that string_replace assumes that s is a pstring.  (doco change only)

Andrew Bartlett
(This used to be commit 6c9056029b)
2003-07-27 02:40:06 +00:00
Andrew Bartlett
455bb6de90 Some small fixes to our charset conversion code:
- Treat the NMB names in the 'session request' packet as 'ASCII'.  This means
   that we do not get invalid multibyte from the wire, even if we truncate
   in the conversion.  (Otherwise we panic when we try to strupper_m it).

 - Remove acnv_uxu2(), as it was duplicated by push_ucs2_allocate()
 - Remove acnv_dosu2(), as it is not used.

 - In push_ucs2(), with the STR_UPPER flag, do the case conversion *after*
   the UCS2 conversion, when it we know that the length can't change.  Also
   faster, as we don't need to do another 2 UCS2 conversions.

Andrew Bartlett
(This used to be commit 912035af11)
2003-07-27 02:28:25 +00:00
Tim Potter
7d833de662 More printf portability fixes. Got caught out by some gcc'isms last
time.  )-:
(This used to be commit 59dae1da66)
2003-07-25 04:24:40 +00:00
Tim Potter
77373f1f8e More printf fixes - size_t is long on some architectures.
(This used to be commit ba4d334b82)
2003-07-24 23:46:27 +00:00
Jeremy Allison
ce72beb2b5 Removed strupper/strlower macros that automatically map to strupper_m/strlower_m.
I really want people to think about when they're using multibyte strings.
Jeremy.
(This used to be commit ff222716a0)
2003-07-03 19:11:31 +00:00
Andrew Tridgell
0a4959d48d - added LOCALE patch from vorlon@debian.org (Steve Langasek) (bug #122)
- changed --enable-developer debug to use -gstabs as it makes the
  samba binaries about 10x smaller and is still quite functional for
  samba debugging
(This used to be commit 53bfcd478a)
2003-06-30 02:11:13 +00:00
Andrew Tridgell
8cd67d7668 reverted locale patch put in by jht (originally from vorlon).
There are lots of things wrong with this patch, including:

1) it overrides a user chosen configuration option

2) it adds lots of complexity inside a loop when a tiny piece of code
   outside the loop would do the same thing

3) it does no error checking, and is sure to crash on some systems

If you want this functionality then try something like this at the end
of charset_name():

#ifdef HAVE_NL_LANGINFO
	if (strcasecmp(ret, "LOCALE") == 0) {
		const char *ln = nl_langinfo(CODESET);
		if (ln) {
			DEBUG(5,("Substituting charset '%s' for LOCALE\n", ln));
			return ln;
		}
	}
#endif

then users can set 'display charset = LOCALE' to get the locale based
charset. You could even make that the default for systems that have
nl_langinfo().
(This used to be commit 382b9b806b)
2003-06-16 02:22:52 +00:00
John Terpstra
489956c823 Patch from vorlon@debian.org, see bugzilal #122
Samba should preferentially use the locale information from the native system,
and only fall back on 'display charset' if this is unavailable or unsupported.
(This used to be commit 1e445fb422)
2003-06-15 06:07:53 +00:00
Jeremy Allison
0bbbe382a5 Fix for valgrind - when doing a srvstr_push we must zero fill
any extra bytes, not clobber region them - otherwise valgrind
thinks they are invalid on send() or write().
Jeremy.
(This used to be commit 8aa5f7a65c)
2003-06-06 07:56:23 +00:00
Andrew Tridgell
6b943b5b21 - the 8.3 name in BOTH_DIRECTORY_INFO is supposed to be always unicode
(to match win2003 behaviour)

- added the STR_TERMINATE_ASCII flag from samba4 so we can get the
  string termination right for the case where it is supposed to be
  non-terminated for UCS2 and terminated when ASCII
(This used to be commit 791a4cc7cf)
2003-06-06 05:15:28 +00:00
Gerald Carter
27d68a306d fixed bug #75; add check for non-zero destlen
(This used to be commit 83bb84f131)
2003-05-08 20:19:10 +00:00
Tim Potter
bbdc326f15 Another attempt at undoing my bogus patch 1.55.2.19
(This used to be commit 05a684b3be)
2003-05-08 05:10:44 +00:00
Tim Potter
22fb803b39 Whoops - that wasn't a whitespace syncup after all.
(This used to be commit 42d0414ed2)
2003-05-07 05:52:44 +00:00
Tim Potter
03412f056d Whitespace syncup.
(This used to be commit 7fd7af121e)
2003-04-28 05:47:07 +00:00
Andrew Bartlett
66468d2315 Patch by Metze to ensure that we always at least initialize our output string
for rpc_pull_string.  If we had a NULL or zero-length string, we would use
uninitialised data in the result string.

Andrew Bartlett
(This used to be commit df10aee451)
2003-04-23 14:07:33 +00:00
Andrew Bartlett
bc83d3a4ed Merge (HEAD->3.0) mbp's fixes to our charcnv code - don't use a staic buffer,
which can restrict things like unix_strupper() to 512 byte strings.

Andrew Bartlett
(This used to be commit 341d6affa4)
2003-04-22 13:15:24 +00:00
Jeremy Allison
ee7f29a9f8 Merge across tridge's Realloc fix.
Jeremy.
(This used to be commit df214d1881)
2003-04-14 11:04:57 +00:00
Martin Pool
4127c455c8 Export lazy_initialize_conv so that it can be called from
check_dos_char.

init_iconv: Call init_doschar_table when reinitializing conversions.
(This used to be commit d0b2c5d7ba)
2003-04-04 08:25:05 +00:00
Martin Pool
b5e7b9dbea lazy_initialize_conv: Remove redundant call to init_valid_table,
because init_iconv calls it for us.

init_iconv: Add documentation about how this is reintialized when
configuration is reloaded.
(This used to be commit 0ee80a9018)
2003-04-04 07:50:59 +00:00
Jelmer Vernooij
0b72dd8325 Patch from Samuel Thibault to convert messages from dos to unix charset
when sending(and vice versa when receiving).
(This used to be commit 5310447ec6)
2003-03-20 16:44:14 +00:00
Jeremy Allison
d332200c25 Merge in the developer string options from HEAD. We need to ensure 3.0
is as stable as possible in the string department and some pain now
will help later :-).
Jeremy.
(This used to be commit 86e3eddac6)
2003-03-18 01:48:11 +00:00
Martin Pool
1a2035a8f5 Merge documentation from HEAD
(This used to be commit 3761f8ebe3)
2003-02-24 04:49:10 +00:00
Andrew Bartlett
266ec4aac0 Merge doxygen, signed/unsigned, const and other small fixes from HEAD to 3.0.
Andrew Bartlett
(This used to be commit 9ef0d40c3f)
2003-02-24 03:09:08 +00:00
Martin Pool
0fc93128b8 Add comment about Samba character sets, from explanation by abartlet.
(This used to be commit 822f6c2f38)
2003-02-24 01:10:15 +00:00
Jeremy Allison
cba08587d3 Merge from HEAD - pull_ucs2_talloc() should pull to a char**, not a void**
Jeremy.
(This used to be commit 81437e2ad0)
2003-02-12 01:09:35 +00:00
Andrew Bartlett
3b2244526c Merge of signed/unsigned fixes from HEAD.
(This used to be commit e9f56a157b)
2003-02-01 07:25:53 +00:00
Andrew Bartlett
634c54310c Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
(This used to be commit 3a7458f947)
2003-01-03 08:28:12 +00:00
Jeremy Allison
da45fbf635 Fix all returns to be size_t (they are all unsigned). Fixup strlen being
done on ucs2 strings.
Jeremy.
(This used to be commit 9a6c694619)
2002-11-11 22:13:05 +00:00
Gerald Carter
f2d1f19a66 syncing up with HEAD. Seems to be a lot of differences creeping in
(i ignored the new SAMBA stuff, but the rest of this looks like it should
have been merged already).
(This used to be commit 3de09e5cf1)
2002-10-01 18:26:00 +00:00
Gerald Carter
a834a73e34 sync'ing up for 3.0alpha20 release
(This used to be commit 65e7b5273b)
2002-09-25 15:19:00 +00:00
Jelmer Vernooij
b2edf254ed sync 3.0 branch with head
(This used to be commit 3928578b52)
2002-08-17 17:00:51 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Andrew Bartlett
62098eade3 add {push,pull}_ucs2{allocate,talloc}() functions.
Andrew Bartlett
(This used to be commit ce7990b4a4)
2002-03-25 07:41:42 +00:00
Andrew Bartlett
fbdf45721b Patch from Hasch@t-online.de (Juergen Hasch) to add allocate and talloc
push/pull utf8 functions.  To be used for international ADS support.

Andrew Bartlett
(This used to be commit 9ab144810e)
2002-03-23 08:39:04 +00:00
Andrew Bartlett
e4235f6b84 Fix up the pull_utf8_fstring/pstring functions, and add their push eqivilants.
patch by Hasch@t-online.de (Juergen Hasch)

Andrew Bartlett
(This used to be commit ba2570f518)
2002-03-01 01:11:02 +00:00
Andrew Bartlett
121d3238d7 This should kill off the 'cannot convert' error messages on non-iconv hosts.
(This used to be commit 2a30960276)
2002-03-01 00:57:47 +00:00
Andrew Bartlett
efa1571b8b Patch from Hasch@t-online.de (Juergen Hasch) to add UTF-8 as an explict
character set for conversion.  To be used in Winbind and the 'net ads'
commands.

Andrew Bartlett
(This used to be commit fa9d3060ff)
2002-02-19 23:02:39 +00:00
Simo Sorce
407cd42143 better debug messages!
(This used to be commit e3bb686745)
2002-02-04 00:59:23 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Martin Pool
c4fe824c42 We have to do some initialization before the string conversion
routines can work.  The code was copied into both convert_string and
convert_string_allocate -- I split it into a little static function,
and removed an apparently duplicate call to init_valid_table().
(This used to be commit 7f7d22880d)
2002-01-22 03:51:28 +00:00
Andrew Tridgell
84ecd95dba more irix -64 portability fixes
(This used to be commit 65e857b36e)
2001-12-31 14:05:22 +00:00