1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-28 17:47:29 +03:00

73 Commits

Author SHA1 Message Date
Jeremy Allison
5e2571f424 Merge in mangle fixes from 2.2.
Jeremy.
-
Simo Sorce
77dc498b6f move to the FNV1 hash alghorithm seem good
the test revealed 15 collision with 1 Million long file names :-)

Simo.
-
Andrew Tridgell
51b4de0ae3 don't try to return a void -
Andrew Tridgell
bb173c1a7e this adds a completely new hash based mangling scheme
the hash for this scheme is *much* larger (approximately 31 bits) and
the code is written to be very fast, correctly handling multibyte
while not doing any actual multi-byte conversions in the vast majority
of cases

you can select this scheme using "mangling method = hash2", although I
may make it the default if it works out well.
-
Andrew Tridgell
be23d87a17 This split the mangling code up to allow for the possibility of multiple
mangling implementation, selectable using "mangling method = " in smb.conf

It also tidies the interface a little, although it is still nasty.
-
Simo Sorce
aff7073dab a fix yet committed to 2.2 sometimes ago and reintroduced here! -
Andrew Bartlett
ad8aa47057 Reintroduce the 2.2 name mangling code, until we get are more flexible solution.
Even for a hash/cache setup, this code needs some more work, in particular
it needs to use mangle_get_prefix() etc and to move to unicode internals.

Andrew Bartlett
-
Andrew Bartlett
9c8de8c6cf Actually include some *information* in the mangle debug messages.
In particular this shows the filename, prefix and counters involved.

The unicode -> unix converion only occours for the error case.

Andrew Bartlett
-
Andrew Bartlett
15b9b63db5 in dos_unmangle() the only function call was to *mangle()*. Adding the
'un' dramaticly increses the functionality of this code :-).

Andrew Bartlett
-
Simo Sorce
e3bb686745 better debug messages! -
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
Andrew Bartlett
56be51d648 Fix a 'const' warning. -
Simo Sorce
8929f07a15 micro fix :-) -
Simo Sorce
04f492980b minor fixes -
Andrew Tridgell
05adb30eab handle filenames like .bashrc better in the new mangling code -
Andrew Tridgell
ad7afbfdea removed unused function -
Simo Sorce
8bb5cb27c2 some bugfix and new functions,
modified mangle.c to use mosltly acnv_????() functions.
this should make also build farm happy
-
Simo Sorce
64dde3b64f fixed, moved and added some functions
note the useful acnv_uxu2 and acnv_u2ux functions in charcnv.c
-
Tim Potter
54e40b2702 Fixed compiler warnings. -
Simo Sorce
ee19f7efb6 a big one:
- old mangle code has gone, the new one based on tdb seem resonably ok
   probably the valid.dat table need to be updated to treat wild chars as
   invalid ones (work ok without it)
 - a LOT of new string manipulation function for unicode, they are somewhat
   tested but a review would not be bad
 - some new function I will need for the new unix_convert function I'm writing,
   this will be renamed filename_convert and use only unicode strings.
 - charconv, I attached a comment, if someone wnat to look if I'm right or
   just was hacking to late in the night to make a sane one :)

of course any bug is my responsibility an will be pleased to see patches if
you find any. :-)

Simo.
-
Simo Sorce
8b9302b707 - fix string len for an ucs2_to_dos function as any ucs2 char may be up to 4 dos hars...
- addedd ascii compatibility functions
-
Simo Sorce
5246d7609c fix a logic bug on max size of a returned string,
this fixes also the bug with file renaming.
-
Tim Potter
320c21b7a9 Fixed compile warning. -
Herb Lewis
51cb4411df get rid of compiler warnings (casts and delete unused variables) -
Simo Sorce
e48eb7b572 ops, some testing code in compat function let only mangled name come back. -
Simo Sorce
1ffacd2068 lets try the new mangling code
all the calls go through a compatibility interface will
change that soon
a new mangle.tdb file will be set in the lock directory
it contains a static mapping longname<->manglename
-
Simo Sorce
7264d611ef introduce mangle backward compatibility functions
add talloc_asprintf()
-
Simo Sorce
39409a20f6 remove unused function in mangle.c
fix some alloc leaks spotted by andreas moroder.
-
Tim Potter
c9b3e6c714 Fixed some compile warnings. -
Simo Sorce
c0bb484e0f tim suggested to add a copyright note :) -
Simo Sorce
74f746fee2 more fixing and testing.
added ucs2_to_dos83 function.
the code should be ok now.
further test with japanese and other languages is needed at this point.
-
Simo Sorce
c82cf58ae2 init only in test code.
remove unused structure for tdb data.
fixes.
-
Tim Potter
2d0922b0ea Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. -
Simo Sorce
5ab220efd7 undef the code for now -
Simo Sorce
a4c746ac47 further devel and test kit.
first tests show it still does not work.
work in progress...
-
Simo Sorce
2d1aabb6d4 get out unicode_from_buffer and buffer_from_unicode, unneeded.
store mangled filename in dos charset and unmangled in unicode.
clean ups
still lot to do.
againg compiled but not yet tested.
-
Simo Sorce
57e639bbdd minor fixes -
Simo Sorce
4ade36446e - the inactive core of the new mangling code that use tdb
- some more utils for unicode string manipulation
-
Simo Sorce
a95943fde0 move to SAFE_FREE() -
Andrew Tridgell
c41fc06376 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn. -
Andrew Tridgell
debb471267 The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
-
Christopher R. Hertel
c2977be340 Very minor cleanup. I was looking for another problem and found some bits
of code that were unclear.

Chris -)-----
-
Christopher R. Hertel
50599b0fa2 Removed a patch that Andrew had added because 'insure' was incorrectly
reporting a memory leak in the cache module.  I've modified the cache
code to prevent insure getting confused, so the patch can now be removed.
-
Andrew Tridgell
062d79bf8b avoided a memory leak in the ubi code by deleting a mangled cache
entry before adding to ensure that we don't ever add a duplicate entry

this code can be removed when ubi gets fixed
-
Jeremy Allison
e5a3deba46 Second set of inline optimisation fixes from Ying Chen <ying@almaden.ibm.com>.
Stop makeing function calls for every use of skip_multibyte_char. This function
is called several *million* times during a NetBench run :-).
Jeremy.
-
Jeremy Allison
d120f22fef smbd/mangle.c
smbd/negprot.c: Tidyup of static initializers.
smbd/server.c: Fix -l option.
Jeremy.
-
Andrew Tridgell
453a822a76 first pass at updating head branch to be to be the same as the SAMBA_2_0 branch -
Luke Leighton
5e2fc8b7cc removed comment line at end of file -
Jeremy Allison
0de01f4598 Added back groupname map stuff removed by Andrew's "slash 'n' burn"
tactics :-). Protected by #ifdef until used.

Fixed bug in fd_attempt_close() where a pointer to potentially
free'd memory was returned. I hate that.

Added "blocking locks" as a per-share option for performance testing.

Changed is_mangled() so it will return true if called with a pathname
and any component of the pathname was mangled (it was already attempting
to do this, but not checking for a '/' as end-of-mangle).

This should be a better fix for the wierd stat cache bug Andrew identified.

Jeremy.
-
Andrew Tridgell
c319d8ea3f fixed a bug in the name mangling code. It implicitly assumed that
mangling a name can't increase it's size which isn't true. (imagine a
file called "L B" which mangles to "LB~XX")

The symptoms were that users couldn't run batch files from short
directory names that contained non 8.3 characters (such as spaces).
-