summaryrefslogtreecommitdiffstats
path: root/source/smbd/mangle.c
Commit message (Collapse)AuthorAgeFilesLines
* Removed a patch that Andrew had added because 'insure' was incorrectlyChristopher R. Hertel2000-06-131-9/+0
| | | | | 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.
* avoided a memory leak in the ubi code by deleting a mangled cacheAndrew Tridgell2000-04-231-1/+11
| | | | | | entry before adding to ensure that we don't ever add a duplicate entry this code can be removed when ubi gets fixed
* Second set of inline optimisation fixes from Ying Chen <ying@almaden.ibm.com>.Jeremy Allison2000-01-261-4/+4
| | | | | | Stop makeing function calls for every use of skip_multibyte_char. This function is called several *million* times during a NetBench run :-). Jeremy.
* smbd/mangle.cJeremy Allison2000-01-081-1/+1
| | | | | | smbd/negprot.c: Tidyup of static initializers. smbd/server.c: Fix -l option. Jeremy.
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-30/+71
|
* removed comment line at end of fileLuke Leighton1998-11-021-1/+0
|
* Added back groupname map stuff removed by Andrew's "slash 'n' burn"Jeremy Allison1998-09-081-3/+4
| | | | | | | | | | | | | | | | | 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.
* fixed a bug in the name mangling code. It implicitly assumed thatAndrew Tridgell1998-09-031-39/+39
| | | | | | | | 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).
* this is the bug change to using connection_struct* instead of cnum.Andrew Tridgell1998-08-141-25/+0
| | | | | | | | Connections[] is now a local array in server.c I might have broken something with this change. In particular the oplock code is suspect and some .dll files aren't being oplocked when I expected them to be. I'll look at it after I've got some sleep.
* Noticed that I was using the strlen() of a string that I had strdup()'dChristopher R. Hertel1998-07-251-1/+1
| | | | before testing that the strdup() worked. Fixed.
* I've put the ubiqx headers back into includes.h, and removed them fromChristopher R. Hertel1998-05-221-1/+0
| | | | | | | | | dir.c & mangle.c. This was possible after I checked the tree code to make sure that the tree code did not reference functions by macro name. Also, note that the AVL module has been removed to prevent conflict with the SplayTree macro defines. Chris -)-----
* This is a security audit change of the main source.Jeremy Allison1998-05-121-8/+8
| | | | | | | | | | | | | | | | | | It removed all ocurrences of the following functions : sprintf strcpy strcat The replacements are slprintf, safe_strcpy and safe_strcat. It should not be possible to use code in Samba that uses sprintf, strcpy or strcat, only the safe_equivalents. Once Andrew has fixed the slprintf implementation then this code will be moved back to the 1.9.18 code stream. Jeremy.
* Andrew redefines the free() function to do some memory management testing.Christopher R. Hertel1998-05-061-1/+19
| | | | | | | He also suggested that some systems may implement free() as a macro (but I think he was looking for an excuse ;). Anyway, I've added a function to mangle.c that calls free(). Chris -)-----
* Fixed aggregate initializer problem for gcc.Jeremy Allison1998-04-131-1/+1
| | | | Jeremy.
* Changes include:Christopher R. Hertel1998-04-131-409/+694
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | proto.h: The unusual. ;) reply.c: I changes some function names, and updated reply.c to match. See mangle.c below for more. server.c: Changed function names and parameters in file mangle.c, so changed server.c calls to match. See mangle.c below for more. mangle.c: I replaced the caching mechanism used for caching reverse mangled name maps. The old method was a large array of 256-byte strings. Movement in the stack (including push and pop) was done by memcpy()ing whole chunks of memory around. The new system uses the ubi_Cache module which, in turn, uses a splay tree. Entries are dynamically allocated using a minimum amount of memory. Searches are non-linear, which should speed things up a bit, too. Overall, this should save memory and be faster. Other changes: I streamlined the is_mangled() test and made other speed enhancements including replacing some static functions with macros. Added comments, etc. Note: Per an E'mail conversation with Andrew, the 'mangled stack' parameter in smb.conf doesn't do anything anymore. The cache is now set for 16K bytes maximum memory usage. The mangle stack parameter is silently ignored. This can easily be changed, but I'd rather introduce a 'mangled cache memory' parameter and remove 'mangled stack'. Remaining problems: While testing the module, I noticed that something is calling name_map_mangle() twice. The result is that names which contain illegal characters are getting mangled twice. Also, the entire module works by overwriting the input string. This has a variety of nasty side effects. Summary: There's a lot still to be done, but the changes I have in place *should* work in exactly the same way (except for the mangle stack parameter). The rest of the bugs and other issues are separate. Chris -)-----
* Removed broken change I made to mangle.c (ooops. Andrew's originalJeremy Allison1998-03-041-1/+1
| | | | | | | | | algorithm was correct). Finally (I think) fixed the mangled directory stack issue in scan_directory() correctly. Mangled & non-mangled names are now being checked correctly. Hurrah to Ulrik Dickow <ukd@kampsax.dk> who helped isolate this one. Jeremy.
* Change the multibyte character set support so thatJeremy Allison1998-03-031-88/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kanji support is one case of multibyte character support, rather than being a specific case in single byte character support. This allows us to add Big5 Chinese support (code page 950) and Korean Hangul support (code page 949) at very little cost. Also allows us to easily add future multibyte code pages. Makefile: Added codepages 949, 950 as we now support more multibyte codepages. asyncdns.c: Fixed problem with child being re-spawned when parent killed. charcnv.c charset.c client.c clitar.c kanji.c kanji.h smb.h util.c loadparm.c: Generic multibyte codepage support (adding Big5 Chinese and Korean Hangul). nmbd.c: Fixed problem with child being re-spawned when parent killed. mangle.c: Modified str_checksum so that first 15 characters have more effect on outcome. This helps with short name mangling as most 'long' names are still shorter than 15 chars (bug was foobar_mng and foobar_sum would hash to the same value, with the modified code they hash differently. Jeremy.
* This is *not* a big change (although it looks like one).Jeremy Allison1998-01-221-1/+1
| | | | | | | This is merely updating the Copyright statements from 1997 to 1998. It's a once a year thing :-). NO OTHER CHANGES WERE MADE. Jeremy.
* Modified Files:Christopher R. Hertel1997-11-071-241/+316
| | | | | | | | | | | | | | | | | | | | | | | | mangle.c server.c proto.h mangle.c I am planning to replace the mangled_stack array with a proper stack, but found many style inconsistencies (no, really). As you might expect, I have standardized on my own preferences. ;) I also found a potential problem in create_mangled_stack (which I've renamed as reset_mangled_stack). If the stack size were passed into the function as 0 or less, there was the possibility that the array would have been freed twice. I doubt that this ever happens, but I don't like to leave holes. Of course, the fix will be irrelevent once I replace the array with a linked-list-based stack. server.c Changed the call to create_mangled_stack() to a call to reset_mangled_stack(). proto.h Regenerated to match the above changes. (A real comment! How unusual!)
* remove { and } from the list of illegal characters in filenames. TheAndrew Tridgell1997-10-121-1/+1
| | | | | | | CIFS3 spec does not list them as illegal. This allows things like the control panel icon to be placed on a Samba drive.
* Adding Andrews buffer overflow fixes into the main branch.Jeremy Allison1997-09-261-4/+4
| | | | Jeremy (jallison@whistle.com)
* charcnv.c client.c clitar.c kanji.c kanji.h loadparm.cJeremy Allison1997-09-111-96/+109
| | | | | | | | | | | | | | mangle.c smb.h util.c: Big merge to allow KANJI support to be in the main binary without explicitly compiling with it. locking.c: Fix for smbstatus not being able to read files. namepacket.c: Removed unneccesary debug statement. trans2.c: Added Luke's proposed fix (ifdefed out until further testing). nmblookup.c: Fixed bug where query fails and status is done on bogus IP. Jeremy (jallison@whistle.com)
* mangle.c: Fixed bug that caused string to run off the end of the mangled map.Jeremy Allison1997-08-281-1/+1
| | | | | | | | server.c: Changed comparison from dname to name2 - seems correct - don't know why I changed it originally. hmmmmm. trans2.c: Made lanman2 code more similar to scan_directory(). I should make the trans2 code call scan_dir as they are so similar. Jeremy(jallison@whistle.com).
* 'The mother of all checkins' :-). Jeremy Allison (jallison@whistle.com)Samba Release Account1997-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wed May 7 1997: Update for 1.9.17alpha1 release - 'browsefix release' designed to make browsing across subnets work. byteorder.h: Updated copyright to 1997. charcnv.c: Updated copyright to 1997. charset.c Updated copyright to 1997. charset.h Updated copyright to 1997. client.c Updated copyright to 1997. clientutil.c Updated copyright to 1997. dir.c Updated copyright to 1997. fault.c Updated copyright to 1997. includes.h Updated copyright to 1997. interface.c Updated copyright to 1997. ipc.c Updated copyright to 1997. kanji.c Updated copyright to 1997. kanji.h Updated copyright to 1997. loadparm.c Updated copyright to 1997. locking.c Updated copyright to 1997. mangle.c Updated copyright to 1997. message.c Updated copyright to 1997. nameannounce.c Made use of WINS subnet explicit. Added reset_announce_timer() so announcement can be made immediately when we become a master. Expanded code to do sync with dmb. namebrowse.c Removed redundent checks for AM_MASTER in sync code. Made use of WINS subnet explicit. namedbname.c Made use of WINS subnet explicit. namedbresp.c Made use of WINS subnet explicit. namedbserver.c Made use of WINS subnet explicit. namedbsubnet.c Explicitly add workgroup to WINS subnet when we become a dmb. Made use of WINS subnet explicit. namedbwork.c Made use of WINS subnet explicit. Removed redundent check_work_servertype() function. nameelect.c Explicitly add workgroup to WINS subnet when we become a master browser. Made use of WINS subnet explicit. namelogon.c Updated copyright to 1997. namepacket.c Updated copyright to 1997. namequery.c Updated copyright to 1997. nameresp.c Made use of WINS subnet explicit. Made nmbd fail if configured as master browser and one exists already. nameserv.c Made use of WINS subnet explicit. Remove redundent logon server and domain master code. nameserv.h Add emumerate subnet macros. nameservreply.c Made use of WINS subnet explicit. nameservresp.c Updated copyright to 1997. namework.c Made use of WINS subnet explicit. Updated code to add sync browser entries to add subnet parameter. nmbd.c Added sanity check for misconfigured nmbd. nmblib.c Updated copyright to 1997. nmblookup.c Updated copyright to 1997. nmbsync.c Removed redundent AM_ANY_MASTER check. params.c Updated copyright to 1997. password.c Updated copyright to 1997. pipes.c Updated copyright to 1997. predict.c Updated copyright to 1997. printing.c Updated copyright to 1997. proto.h Changed protos for new nmbd code. quotas.c Updated copyright to 1997. replace.c Updated copyright to 1997. reply.c Updated copyright to 1997. server.c Updated copyright to 1997. shmem.c Updated copyright to 1997. smb.h Updated copyright to 1997. smbencrypt.c Updated copyright to 1997. smbpasswd.c Updated copyright to 1997. smbrun.c Updated copyright to 1997. status.c Updated copyright to 1997. system.c Updated copyright to 1997. testparm.c Updated copyright to 1997. testprns.c Updated copyright to 1997. time.c Updated copyright to 1997. trans2.c Updated copyright to 1997. trans2.h Updated copyright to 1997. uid.c Updated copyright to 1997. username.c Updated copyright to 1997. util.c Updated copyright to 1997. version.h Changed to 1.9.17alpha1.
* Replaced YOST code with more functionally equivalent code thatSamba Release Account1997-02-111-8/+3
| | | | | changes a bit less. Also added fix to tricky reply_mv case. jra@cygnus.com
* JHT ===> William Yost patches integrated to fix leading path on 8.3Samba Release Account1997-02-101-0/+5
| | | | | | | | | | | | | | | | | | filename problem. Problem conditions: case sensitive = no default case = lower mangle case = yes preserve case = yes short preserve case = yes Problem: Win95 still writes upper case file names. Patches supplied have been incorporated into mangle.c and server.c but needs YOSTW to be defined for it to take effect. Action: ======= If we are happy with the patch, delete old code in mangle.c, then remove all YOSTW #ifdefs.
* - replace the base36 function with one that works on more systemsAndrew Tridgell1996-10-051-6/+3
| | | | | | | | | | | (compiler bugs were the problem) - minor password cleanups (catch WfWG bug where it sets the password to a space instead of a NULL) - fix printing problem for kanji users - minor cleanups
* - sequent-ptx support from bressler@iftccu.ca.boeing.com (RickAndrew Tridgell1996-08-131-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | Bressler) - machten support from Trevor Strohman (trev@figment.tenon.com) - added qinfo command to client as part of drag-and-drop printer support for win95 from David Chappell <chappell@mouse.cc.trincoll.edu> He also added the "printer driver" option - use sigblock() on more systems and use sigsetmask(0) instead of sigunblock() as its more portable. This beats a problem with zombies on heavilily loaded systems. - added internals.doc written by David Chappell into the source tree - get rid of PRINT_COMMAND options from local.h as they are no longer relevent - new kanji code from Fujita - don't set the recursion_available flag on queries in nmbd - fix a potential bug with pointer subtraction in printing.c - got rid of error_count code as the real fix (the EOF problem) is now in
* got rid of a lot of redundent header files as we now globally generateAndrew Tridgell1996-06-101-1/+0
| | | | | prototypes automatically using "make proto". This is much less prone to error than the old method of manually adding prototypes
* move the dot_pos calculation down a bitAndrew Tridgell1996-05-041-2/+2
|
* Initial version imported to CVS Samba Release Account1996-05-041-0/+610