summaryrefslogtreecommitdiff
path: root/source3/lib/charcnv.c
AgeCommit message (Collapse)AuthorFilesLines
2003-07-16trying to get HEAD building again. If you want the codeGerald Carter1-4/+41
prior to this merge, checkout HEAD_PRE_3_0_0_BETA_3_MERGE (This used to be commit adb98e7b7cd0f025b52c570e4034eebf4047b1ad)
2003-05-28Merge of pull_ascii() and pull_ucs2() termination fixes from 3.0Tim Potter1-0/+4
(This used to be commit bd97a76388b3f16d287c25579f02afe072cdec25)
2003-05-08fixed bug #75; add check for non-zero destlenGerald Carter1-1/+1
(This used to be commit bfcec106d00355d32eb40dde99ddd5d5bed4cedb)
2003-04-09unix_strupper, unix_strlower: Remove fixed-length static buffer thatMartin Pool1-10/+31
makes these functions fail for strings over 512 characters. Now we use convert_string_allocate, which grows a buffer as necessary. (This used to be commit a55dc493ca212bde22d9e68ea8a4cc16a142c69d)
2003-04-08Merge from 3_0: Build a lookup table of valid DOS characters justMartin Pool1-5/+11
once, when init_iconv is first called. Use this in check_dos_char rather than doing the conversion every time. Much faster. (This used to be commit e8f1399323745a93ba9df97553effcf2d7629850)
2003-04-06Fix the interface of pull_ucs2_charcnv() to take a (char **) arg, not a ↵Andrew Bartlett1-2/+2
(void **) (This used to be commit dc04b732baa0848e391baf7f148218a10e0af032)
2003-04-06don't rely on realloc() working on NULLAndrew Tridgell1-3/+3
(This used to be commit bd00355c1d5ca4ce77fa28c53ea46834365f22d7)
2003-03-20Patch from Samuel Thibault to convert messages from unix to dos charset. WorksJelmer Vernooij1-1/+1
on 2000. sending messages to 9x needs to be fixed, but that didn't work anyway (This used to be commit ca066502a2a3dbdd8943d515c9c6d21e62d757b6)
2003-03-15Remove an unused function and fix the build.Andrew Bartlett1-36/+0
Andrew Bartlett (This used to be commit 67a0319d268dfc0e2154d3ab0f8bf866e3cbb6db)
2003-03-15String handling parinoia fixes.Andrew Bartlett1-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 (This used to be commit 31f4827acc2a2f00399a5528fc83a0dae5cebaf4)
2003-02-24Merge documentation from 3_0.Martin Pool1-6/+13
(This used to be commit 5002555a9719987ccdc887ffff64ea8d02c9881d)
2003-02-18Remove obsolete comment.Martin Pool1-2/+0
(This used to be commit e22465749dc7c2acd2441a897df592616fc275da)
2003-02-18Doxygen janitor and some doc typo fixes.Martin Pool1-68/+92
(This used to be commit 82414706e6659c1638936d9b9afdb9329109f58f)
2003-02-12pull_ucs2_talloc() should pull to a char**, not a void**Andrew Tridgell1-2/+2
(This used to be commit 3cf539421fa2a5c276baeedbdbf42ced29d9f1e4)
2003-02-01Make it clear that the magic value is (size_t)-1.Andrew Bartlett1-2/+2
Andrew Bartlett (This used to be commit 0676b4e35f2ab5b58c44df9fe2eef112425d6013)
2003-01-02BIG patch...Andrew Bartlett1-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 (This used to be commit 92a777d0eaa4fb3a1c7835816f93c6bdd456816d)
2002-11-11Fix all returns to be size_t (they are all unsigned). Fixup strlen beingJeremy Allison1-213/+244
done on ucs2 strings. Jeremy. (This used to be commit 205e8f03015dd533ae62753f2098505f1231e3e4)
2002-09-27Some small cleanups to the libads code (mainly error checking), and give aAndrew Bartlett1-2/+2
sane prototype for the push_utf8_allocate code. Andrew Bartlett (This used to be commit ce00a3238ed8a82639c4d0ee3e960f7000b1a7b0)
2002-08-26Updates!Andrew Bartlett1-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 (This used to be commit de1964f7fa855022258a84556b266100b917444b)
2002-08-25Clarify function commentsAndrew Bartlett1-0/+2
(This used to be commit a613dde7edab62c4439d256932b9f9b4ae2ec4e0)
2002-07-30Make some of the charconv code a bit easier to read and work with - when weAndrew Bartlett1-8/+8
are dealing with utf8 we may as well specify char** for the pointer, save otherwise casting in the caller. Andrew Bartlett (This used to be commit 46021f85b6da4ba1e7f73ee7408079219d555dde)
2002-07-18Another bug found by valgrind. Don't AND a src length of -1.Jeremy Allison1-1/+2
Jeremy. (This used to be commit a67079882dd1b924d2e007e39b06da438533ef96)
2002-07-12The changes in make_sec_desc to make us match W2K broke the ↵Jeremy Allison1-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. (This used to be commit 175d43980e57c25582d8ab859f5730283e82f3b2)
2002-04-17make suure we get the return value from the pull_*() functions rightAndrew Tridgell1-6/+12
for both null terminated and buffer length terminated strings (This used to be commit e8fbf853e0eed61bb7405be731f18fb2426f8dc4)
2002-04-16stricter conditions on termination in stringsAndrew Tridgell1-6/+6
this was a very nasty bug with filename corruption and NT4 clients. The exact termination conditions are quite critical ... (This used to be commit a538efe7d00e7a61df194ca1c22e0583dcbb7a4a)
2002-04-16fixed the handling of STR_TERMINATEAndrew Tridgell1-3/+21
(This used to be commit dbc6b137a83cf9fe0558625dd32f92f15296fba6)
2002-04-16i forgot to commit these parts of the string handling patch earlier. Sorry.Andrew Tridgell1-5/+5
(This used to be commit bac0093a9713416b1679d1bc167b70f02b06ef78)
2002-03-25add {push,pull}_ucs2{allocate,talloc}() functions.Andrew Bartlett1-0/+58
Andrew Bartlett (This used to be commit ce7990b4a4f251536dd26be5a62c12711df57787)
2002-03-23Patch from Hasch@t-online.de (Juergen Hasch) to add allocate and tallocAndrew Bartlett1-1/+86
push/pull utf8 functions. To be used for international ADS support. Andrew Bartlett (This used to be commit 9ab144810efeb0b086257143b01ca47ee5718861)
2002-03-01Fix up the pull_utf8_fstring/pstring functions, and add their push eqivilants.Andrew Bartlett1-4/+14
patch by Hasch@t-online.de (Juergen Hasch) Andrew Bartlett (This used to be commit ba2570f518e07c95b952fb824a2d0b040b912bcc)
2002-03-01This should kill off the 'cannot convert' error messages on non-iconv hosts.Andrew Bartlett1-1/+1
(This used to be commit 2a30960276ae65b60d01caf9464808d75a812e40)
2002-02-19Patch from Hasch@t-online.de (Juergen Hasch) to add UTF-8 as an explictAndrew Bartlett1-1/+67
character set for conversion. To be used in Winbind and the 'net ads' commands. Andrew Bartlett (This used to be commit fa9d3060ff7510e176d7608b49075379500f55c4)
2002-02-04better debug messages!Simo Sorce1-0/+1
(This used to be commit e3bb6867454307ae592115e205d32ddd53988678)
2002-01-30Removed version number from file header.Tim Potter1-2/+1
Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2002-01-22We have to do some initialization before the string conversionMartin Pool1-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(). (This used to be commit 7f7d22880d40c7344bc402203dd150255fc694cf)
2001-12-31more irix -64 portability fixesAndrew Tridgell1-1/+0
(This used to be commit 65e857b36e170e3ecd78bf6695ae73342e9c04cd)
2001-12-20much better auto-init of valid_table[]. This should just about removeAndrew Tridgell1-1/+12
the need for valid.dat (This used to be commit 0cfd0a5e543181b1384f7afee93fbaf3ccb2b999)
2001-11-28fixed some krb5 ifdefsAndrew Tridgell1-2/+2
(This used to be commit 23ef22f11700bbaa5778a9678a990a2b041fcefe)
2001-11-23More better now.Martin Pool1-4/+4
(This used to be commit a875b3a6e7a9501a31fe15fb9b04394a95484e77)
2001-11-23Quieten gcc const warning.Martin Pool1-17/+21
doxyfy. (This used to be commit 6ddd8e7bf69d8aee4148cbcf72de55c903d5f0a1)
2001-11-12messed up with patches, this should be the right one,Simo Sorce1-2/+1
sorry (This used to be commit 023514a0b6170b1907696a2147ee44dc3aa4589d)
2001-11-12some bugfix and new functions,Simo Sorce1-5/+43
modified mangle.c to use mosltly acnv_????() functions. this should make also build farm happy (This used to be commit 8bb5cb27c2012b8967482255d48a1b48d3acd9db)
2001-11-10fixed, moved and added some functionsSimo Sorce1-5/+41
note the useful acnv_uxu2 and acnv_u2ux functions in charcnv.c (This used to be commit 64dde3b64fc091cda95fc4ed145595b5d79b2e01)
2001-11-07add convert_string_allocate() functionSimo Sorce1-5/+86
(This used to be commit 8b494b0be323c983b7ea3d1dcf1f61216396caec)
2001-11-04a big one:Simo Sorce1-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. (This used to be commit ee19f7efb6ea9216fc91cf112ac1afa691983e9d)
2001-10-29More spelling and grammer from Vance. <vance@digital-host.net>Andrew Bartlett1-6/+6
Thanks! Andrew Bartlett (This used to be commit f019bed7663b4a20c1b5ab6b59fcadda17b89acd)
2001-10-23get rid of compiler warnings (casts and delete unused variables)Herb Lewis1-7/+5
(This used to be commit 51cb4411df61d1caec9d84809b1a53a6a632f808)
2001-10-03switched over to a new method of handling uppercase/lowercase mappingsAndrew Tridgell1-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. (This used to be commit 1c221994f118dd542a158b2db51e07d04d0e9314)
2001-10-02Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter1-2/+0
(This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
2001-09-30make strupper() and strlower() not modify the string if it doesn'tAndrew Tridgell1-2/+2
need modifying that makes constant strings OK (This used to be commit 57196635d9b7edfcbfe1708dd22308ab30c02240)