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

59 Commits

Author SHA1 Message Date
Volker Lendecke
6c64e698f0 smbd: Move fast_string_hash() to mangle_hash.c, the only user
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-01-05 00:11:37 +00:00
Volker Lendecke
2c1201eb7a smbd: Convert valid.dat to C code
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-24 00:00:20 +01:00
Volker Lendecke
e914c2c52d smbd: Properly initialize mangle_hash
[Bug 10782] mangle_hash() can fail to initialize charset (smbd crash).

https://bugzilla.samba.org/show_bug.cgi?id=10782

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 26 01:30:38 CEST 2014 on sn-devel-104
2014-08-26 01:30:38 +02:00
Garming Sam
7c0f3ea130 param: rename lp function and variable from 'magicchar' to 'mangling_char'
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:10 -08:00
Jeremy Allison
526e875cec Check error returns from strupper_m() (in all reasonable places). 2012-08-09 12:06:54 -07:00
Andrew Bartlett
f3562424b6 lib/param: Move all enum declarations to lib/param
This is in preperation for the parameter table being made common.

Andrew Bartlett

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
2012-07-24 11:01:17 +02:00
Rusty Russell
6244f668a3 TDB2: make SAMBA use tdb1 again for the moment.
Otherwise the following surgery will break the SAMBA build and testsuite.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:05 +02:00
Jeremy Allison
ee34c25c8a First part of fix for bug 8310 - toupper_ascii() is broken on big-endian systems
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.
2011-07-19 13:19:29 -07:00
Andrew Bartlett
ecc0177f2c s3-smbd Remove set but unused variables
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Jun 28 10:43:26 CEST 2011 on sn-devel-104
2011-06-28 10:43:26 +02:00
Rusty Russell
ca1936fbb2 tdb_compat: use tdb_open_compat.
This is a helper for the common case of opening a tdb with a logging
function, but it doesn't do all the work, since TDB1 and TDB2's log
functions are different types.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Andrew Bartlett
de46ad9084 lib/util use modules_path(), data_path() and shlib_ext() from source3
This brings these helpful utility functions in common, as they are not
based on either loadparm system.

(The 'modules dir' parameter from Samba4 will shortly be removed, so
there is no loss in functionality)

Andrew Bartlett
2011-06-06 17:37:51 +10:00
Günther Deschner
d8cfca3a9b s3: only include tdb headers where needed.
Guenther
2011-05-06 10:48:10 +02:00
Jeremy Allison
cabd9e70e2 Simple +1 changes in hardcoded lengths when changing from safe_strcpy to strlcpy. 2011-05-04 12:12:14 -07:00
Andrew Bartlett
9d62ee2a81 s3-lib Move strisnormal to it's only user in mangle_hash.c 2011-04-14 12:31:18 +10:00
Andrew Bartlett
ce2f217bd2 s3-lib Move strdup_w to it's only user in mangle_hash.c
Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
e3138f2ffe s3-lib Move isvalid83_w to mangle_hash.c
This means that there is no need for the 'valid.dat' table to be
loaded by anything other than smbd, so the unloader is also removed.

The concept of a 'valid dos character' has been replaced by the hash2
mangle method.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Günther Deschner
8c24ebf371 s3: include smbd/smbd.h where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
184339825d s3-build: include mangle.h only where needed.
Guenther
2010-08-26 00:20:29 +02:00
Jeremy Allison
a4e8210ba7 Fix bug #7155 - valgrind Conditional jump or move depends on uninitialised value(s) error when "mangling method = hash"
The charset array allocated in init_chartest() is allocated
by MALLOC, but only some elements of it being set after allocation. Fix is to
memset to zero after allocation.

Jeremy.
2010-02-18 12:21:10 -08:00
Jeremy Allison
df13b1303a Fix bug #7154 - mangling method = hash can crash storing a name not containing a '.'
Fix use of uninitialized variable. This can lead to crashes if
mangling = hash processes names with no '.'.

Jeremy.
2010-02-18 11:22:44 -08:00
Jeremy Allison
100168dfec Fix bug reported in mangle_hash code (no bugid yet).
Don't change the contents of a const string via a pointer
alias (or if you do, change it back.....).

Jeremy.
2009-12-21 17:46:32 -08:00
Jeremy Allison
159c1b860a Fix bug #6939 - mangling method = hash breaks long filenames.
We were returning the wrong sense of the bool. must_mangle()
has to return !NT_STATUS_IS_OK, not NT_STATUS_IS_OK.

Jeremy.
2009-12-17 16:14:30 -08:00
Andrew Bartlett
3b3e21bd9b Convert Samba3 to use the common lib/util/charset API
This removes calls to push_*_allocate() and pull_*_allocate(), as well
as convert_string_allocate, as they are not in the common API

To allow transition to a common charcnv in future, provide Samba4-like
strupper functions in source3/lib/charcnv.c

(the actual implementation remains distinct, but the API is now shared)

Andrew Bartlett
2009-04-14 12:53:56 +10:00
Volker Lendecke
19ce90b90e Just for fun: Move some bytes from bss to text 2009-02-01 14:34:22 +01:00
Stefan Metzmacher
3dde0cbb76 s3:smbd: move all globals and static variables in globals.[ch]
The goal is to move all this variables into a big context structure.

metze
2009-01-08 12:22:21 +01:00
Stefan Metzmacher
d9e81664e5 s3:smbd: it's pointless to have a global magic_char
We call magic_char = lp_magicchar(p) each time it's used.

metze
2009-01-08 12:22:18 +01:00
Stefan Metzmacher
7f2cf6b166 s3:smbd: make mangle_fns const
metze
2009-01-08 12:22:17 +01:00
Tim Prouty
fb37f15600 Cleanup size_t return values in callers of convert_string_allocate
This patch is the second iteration of an inside-out conversion to cleanup
functions in charcnv.c returning size_t == -1 to indicate failure.
(This used to be commit 6b189dabc5)
2008-05-20 22:40:13 +02:00
Volker Lendecke
4cdce5b50e Remove a static array
This might be worth it, mangle_hash is hardly used these days
(This used to be commit 44775ea38b)
2007-12-28 17:02:07 +01:00
Volker Lendecke
cc1664416d Move stuff from data to text
(This used to be commit 49f06a2fa7)
2007-12-10 12:22:01 +01:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Jeremy Allison
132ee3990a r25009: Large patch discussed with Volker. Move unix_convert to a talloc-based
interface. More development will come on top of this. Remove the
"mangled map" parameter.
Jeremy.
(This used to be commit dee8beba7a)
2007-10-10 12:30:32 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Stefan Metzmacher
bc2b6436d0 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
(This used to be commit 3a28443079)
2007-10-10 12:19:00 -05:00
Stefan Metzmacher
f61062b31d r21980: make use of tdb_*_bystring() and string_term_tdb_data() in smbd/
to avoid creating the TDB_DATA struct from strings "by hand"

metze
(This used to be commit 09b477ed85)
2007-10-10 12:18:55 -05:00
Jeremy Allison
fbdcf2663b r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
Jeremy Allison
5a4881bf39 r12522: Try and fix bug #2926 by removing setlocale(LC_ALL, "C")
and replace calls to isupper/islower/toupper/tolower with
ASCII equivalents (mapping into _w variants).
Jeremy.
(This used to be commit c2752347eb)
2007-10-10 11:05:58 -05:00
Jeremy Allison
4850bc6310 r10600: Fix bug #2769 (mangle filenames ending in a space)
and an old bug where mangle mathod hash wasn't mangling
file names with more than one dot which also end in a dot.
Jeremy.
(This used to be commit 105e38847d)
2007-10-10 11:04:47 -05:00
Jeremy Allison
78257e3433 r9532: Fix for bug #2152, championed by Neil Hoggarth <neil.hoggarth@physiol.ox.ac.uk>.
Jeremy.
(This used to be commit d29a45565d)
2007-10-10 11:01:12 -05:00
Jeremy Allison
75f109bc81 r6977: Fix bug #2735 (not mangling control characters) plus
ensure we don't create files with control characters
either.
Jeremy.
(This used to be commit 0ca2423c70)
2007-10-10 10:56:59 -05:00
Jeremy Allison
0419e24287 r6965: Remove some dead code from util_unistr.c.
Start of fix for #2735 - we are not mangling some
names we should. More fixes to follow.
Jeremy.
(This used to be commit ac0fa97377)
2007-10-10 10:56:59 -05:00
Jeremy Allison
02e3717ee9 r6625: Remove another global variable left over from a long time ago (magic char).
Jeremy.
(This used to be commit b1bfa9cb37)
2007-10-10 10:56:47 -05:00
Jeremy Allison
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Jeremy Allison
f1688d61df r2112: Simplify the mangle hash code to use an in-memory tdb.
Should be ready for the new directory code now...
Jeremy.
(This used to be commit c2eff8ef1b)
2007-10-10 10:52:32 -05:00
Gerald Carter
0c6d7f28d6 r1570: merging changes from 3.0.5
(This used to be commit 430cf63b91)
2007-10-10 10:52:15 -05:00
Jeremy Allison
b04c782281 r1301: Fix bogus error message when using "mangling method = hash" rather
than hash2. We are already calculating lengths so just use memcpy
not safe_strcpy().
Jeremy.
(This used to be commit a5a3df7853)
2007-10-10 10:52:05 -05:00
Jeremy Allison
e0da56a848 r570: Remove lots of globals to handle case issues - move them
to connection struct entries (as they should have been from
the start). Jerry, once you've cut over to 3.0.4 release
branch I'll add this to 3.0 also.
- Jerry cut over :-).
Jeremy.
(This used to be commit 578a508509)
2007-10-10 10:51:30 -05:00
Jeremy Allison
8a31a346ef Fix for "hash" (not hash2) type mangling. Noticed by "Forrest W. Christian" <fwc@mt.net>
Jeremy.
(This used to be commit 3a8fe3b2ef)
2003-12-03 23:16:27 +00:00