summaryrefslogtreecommitdiffstats
path: root/source/lib/charcnv.c
Commit message (Collapse)AuthorAgeFilesLines
* don't rely on realloc() working on NULLAndrew Tridgell2003-04-061-3/+3
|
* Patch from Samuel Thibault to convert messages from unix to dos charset. WorksJelmer Vernooij2003-03-201-1/+1
| | | | | on 2000. sending messages to 9x needs to be fixed, but that didn't work anyway
* Remove an unused function and fix the build.Andrew Bartlett2003-03-151-36/+0
| | | | Andrew Bartlett
* String handling parinoia fixes.Andrew Bartlett2003-03-151-69/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables the compile-time checking of strings assable by means of sizeof(). (Original code had the configure check reversed). This is extended to all safe_strcpy() users, push_string and pull_string, as well as the cli and srv derivitives. There is an attempt to cap strings at the end of the cli buffer, and clobber_region() of the speified length (when not -1 :-). Becouse of the way they are declared, the 'overmalloc a string' users of safe_strcpy() have been changed to use overmalloc_safe_strcpy() (which skips some of the checks). This whole ball of mud worked fine, until I pulled out my 'fix' for our statcache. When jeremy fixes that, we should be able to get back to testing this stuff. This patch also includes a 'marker' of the last caller to clobber_region (ie, the function that called pstrcpy() that called clobber_region) to assist in debugging problems that may have smashed the stack. This is printed at smb_panic() time. (Original idea and patch by metze). It also removes some unsused functions, and #if 0's some others that are unused but probably should be used in the near future. For now, this patch gives us some confidence on one class of trivial parsing error in our code. Andrew Bartlett
* Merge documentation from 3_0.Martin Pool2003-02-241-6/+13
|
* Remove obsolete comment.Martin Pool2003-02-181-2/+0
|
* Doxygen janitor and some doc typo fixes.Martin Pool2003-02-181-68/+92
|
* pull_ucs2_talloc() should pull to a char**, not a void**Andrew Tridgell2003-02-121-2/+2
|
* Make it clear that the magic value is (size_t)-1.Andrew Bartlett2003-02-011-2/+2
| | | | Andrew Bartlett
* BIG patch...Andrew Bartlett2003-01-021-6/+6
| | | | | | | | | | | | | | | | This patch makes Samba compile cleanly with -Wwrite-strings. - That is, all string literals are marked as 'const'. These strings are always read only, this just marks them as such for passing to other functions. What is most supprising is that I didn't need to change more than a few lines of code (all in 'net', which got a small cleanup of net.h and extern variables). The rest is just adding a lot of 'const'. As far as I can tell, I have not added any new warnings - apart from making all of tdbutil.c's function const (so they warn for adding that const string to struct). Andrew Bartlett
* Fix all returns to be size_t (they are all unsigned). Fixup strlen beingJeremy Allison2002-11-111-213/+244
| | | | | done on ucs2 strings. Jeremy.
* Some small cleanups to the libads code (mainly error checking), and give aAndrew Bartlett2002-09-271-2/+2
| | | | | | sane prototype for the push_utf8_allocate code. Andrew Bartlett
* Updates!Andrew Bartlett2002-08-261-4/+4
| | | | | | | | | | | - Don't print an uninitialised buffer in service.c - Change some charcnv.c functions to take smb_ucs2_t ** instead of void ** - Update NTLMv2 code to use dynamic buffers - Update experimental SMB signing code - still more work to do - Move sys_getgrouplist() to SAFE_FREE() and do a DEBUG() on initgroups() failure. Andrew Bartlett
* Clarify function commentsAndrew Bartlett2002-08-251-0/+2
|
* Make some of the charconv code a bit easier to read and work with - when weAndrew Bartlett2002-07-301-8/+8
| | | | | | | are dealing with utf8 we may as well specify char** for the pointer, save otherwise casting in the caller. Andrew Bartlett
* Another bug found by valgrind. Don't AND a src length of -1.Jeremy Allison2002-07-181-1/+2
| | | | Jeremy.
* The changes in make_sec_desc to make us match W2K broke the ↵Jeremy Allison2002-07-121-1/+1
| | | | | | | | | marshalling/unmarshalling of security descriptors. We need to calculate the maximum offset and set the offset back after reading/writing every field in the SEC_DESC. This was *nasty* to find.... Jeremy.
* make suure we get the return value from the pull_*() functions rightAndrew Tridgell2002-04-171-6/+12
| | | | for both null terminated and buffer length terminated strings
* stricter conditions on termination in stringsAndrew Tridgell2002-04-161-6/+6
| | | | | this was a very nasty bug with filename corruption and NT4 clients. The exact termination conditions are quite critical ...
* fixed the handling of STR_TERMINATEAndrew Tridgell2002-04-161-3/+21
|
* i forgot to commit these parts of the string handling patch earlier. Sorry.Andrew Tridgell2002-04-161-5/+5
|
* add {push,pull}_ucs2{allocate,talloc}() functions.Andrew Bartlett2002-03-251-0/+58
| | | | Andrew Bartlett
* Patch from Hasch@t-online.de (Juergen Hasch) to add allocate and tallocAndrew Bartlett2002-03-231-1/+86
| | | | | | push/pull utf8 functions. To be used for international ADS support. Andrew Bartlett
* Fix up the pull_utf8_fstring/pstring functions, and add their push eqivilants.Andrew Bartlett2002-03-011-4/+14
| | | | | | patch by Hasch@t-online.de (Juergen Hasch) Andrew Bartlett
* This should kill off the 'cannot convert' error messages on non-iconv hosts.Andrew Bartlett2002-03-011-1/+1
|
* Patch from Hasch@t-online.de (Juergen Hasch) to add UTF-8 as an explictAndrew Bartlett2002-02-191-1/+67
| | | | | | | character set for conversion. To be used in Winbind and the 'net ads' commands. Andrew Bartlett
* better debug messages!Simo Sorce2002-02-041-0/+1
|
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* We have to do some initialization before the string conversionMartin Pool2002-01-221-13/+15
| | | | | | 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().
* more irix -64 portability fixesAndrew Tridgell2001-12-311-1/+0
|
* much better auto-init of valid_table[]. This should just about removeAndrew Tridgell2001-12-201-1/+12
| | | | the need for valid.dat
* fixed some krb5 ifdefsAndrew Tridgell2001-11-281-2/+2
|
* More better now.Martin Pool2001-11-231-4/+4
|
* Quieten gcc const warning.Martin Pool2001-11-231-17/+21
| | | | doxyfy.
* messed up with patches, this should be the right one,Simo Sorce2001-11-121-2/+1
| | | | sorry
* some bugfix and new functions,Simo Sorce2001-11-121-5/+43
| | | | | modified mangle.c to use mosltly acnv_????() functions. this should make also build farm happy
* fixed, moved and added some functionsSimo Sorce2001-11-101-5/+41
| | | | note the useful acnv_uxu2 and acnv_u2ux functions in charcnv.c
* add convert_string_allocate() functionSimo Sorce2001-11-071-5/+86
|
* a big one:Simo Sorce2001-11-041-1/+7
| | | | | | | | | | | | | | | | | - 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.
* More spelling and grammer from Vance. <vance@digital-host.net>Andrew Bartlett2001-10-291-6/+6
| | | | | | Thanks! Andrew Bartlett
* get rid of compiler warnings (casts and delete unused variables)Herb Lewis2001-10-231-7/+5
|
* switched over to a new method of handling uppercase/lowercase mappingsAndrew Tridgell2001-10-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | for unicode strings. The new method relies on 3 files that are mmap'd at startup to provide the mapping tables. The upcase.dat and lowcase.dat tables should be the same on all systems. The valid.dat table says what characters are valid in 8.3 names, and differs between systems. I'm committing the japanese valid.dat here, in future we need some way of automatically installing and choosing a appropriate table. This commit also adds my mini tdb based gettext replacement in intl/lang_tdb.c. I have not enabled this yet and have not removed the old gettext code as the new code is still being looked at by Monyo. Right now the code assumes that the upcase.dat, lowcase.dat and valid.dat files are installed in the Samba lib directory. That is not a good choice, but I'll leave them there until we work out the new install directory structure for Samba 3.0. simo - please look at the isvalid_w() function and think about using it in your new mangling code. That should be the final step to correctly passing the chargen test code from monyo.
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-2/+0
|
* make strupper() and strlower() not modify the string if it doesn'tAndrew Tridgell2001-09-301-2/+2
| | | | | | need modifying that makes constant strings OK
* Add a few const statements to various odd bits of the tree. (Fixes someAndrew Bartlett2001-09-291-1/+1
| | | | warnings)
* added a little smbtorture test for dumping the unicode table of aAndrew Tridgell2001-09-251-1/+0
| | | | | | | | | server. This is just a framework right now - I want this to eventually replace the win32 test code from monyo The interesting this about this test is that it shows up a really horrible performance bug in our stat cache code. I'll see if I can fix it.
* fixed a silly off by 1 bugAndrew Tridgell2001-09-241-0/+3
|
* added "display charset" option in smb.conf, along with d_printf()Andrew Tridgell2001-09-071-34/+61
| | | | | | | | | which should now be used instead of DEBUG(0) or printf() for interactive messages I have only converted client.c to use d_printf(), and the code hasn't had much testing yet. Eventually we want all interactive code to use d_printf(), plus SWAT
* ucs2 is always a multiple of 2 bytesAndrew Tridgell2001-07-251-0/+6
| | | | this gets rid of a bunch of iconv warnings
* changed the iconv interface to go via ucs2 for all conversions. ThisAndrew Tridgell2001-07-221-2/+0
| | | | | | fixes some problems wih some character sets and allows for using internal charsets in conjunction with ionv charsets this makes us slower but more correct. speed will come later.