summaryrefslogtreecommitdiff
path: root/source3/lib/util_str.c
AgeCommit message (Collapse)AuthorFilesLines
2003-09-13Fix for MacOS/X which uses STUPID BROKEN UNICODE COMPOSE CHARACTERS !Jeremy Allison1-3/+12
(rant off :-). Inspired by work from Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>. Also add MacOSX/Darwin configure fixes. Jerry - can we put this in 3.0 release ? :-). Jeremy. (This used to be commit f23acb4ca5feac8ad2acfa1baf7df31283aba3ea)
2003-09-12Fix from Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>. ReveredJeremy Allison1-1/+1
condition meant fast-path in strchr_m was not being used. Doh ! Jeremy. (This used to be commit f23c9d36b0cd4083722012e4a94df8295f29d04c)
2003-09-10Fix stupid typo bug causing CPU spin. Spotted by Markus Ungermann ↵Jeremy Allison1-0/+1
<ungermann@elzet80.de> Jeremy. (This used to be commit c5ed59b37be1bf779e0d0e61c31227b520430afd)
2003-09-05More tuning from cachegrind. Change most trim_string() calls to trim_char(0,Jeremy Allison1-2/+73
as that's what they do. Fix string_replace() to fast-path ascii. Jeremy. (This used to be commit f35e9a8b909d3c74be47083ccc4a4e91a14938db)
2003-09-05fix bug 397: use a variant of alloc_sub_basic() for string lists.Gerald Carter1-0/+30
(This used to be commit 62d5611df0cf86c267d7fe820822d4d019ae28bd)
2003-09-05Hand optimisatinos for strrchr_m using the properties we know about MBJeremy Allison1-11/+47
character sets and how we use this call. Jeremy. (This used to be commit a9709700eea3bb48ab4a79d74e0b8d22dc98576f)
2003-09-04Fastpath strchr_m for ASCII.Jeremy Allison1-0/+13
Jeremy. (This used to be commit b3176f2ec246441dd483dc9757a487535b1656e6)
2003-09-04Used cachegrind to track down some bottlenecks.Jeremy Allison1-1/+10
Removed calls to clobber_region when not compiling with developer as they were hiding speed problems. Added fast path to convert_string() when dealing with ascii -> ascii, ucs2-le to ascii and ascii to ucs2-le with values <= 0x7F. This gives a speedup of 22% on my nbench tests. Next I will do this on convert_string_allocate. Jeremy. (This used to be commit ef140d15ea0d76a3e7cdcadbfd3e917c210a9411)
2003-09-03Fix up overlapping memcpy -> memmove found by valgrind.Jeremy Allison1-1/+3
Jeremy. (This used to be commit e0c1460c6b6af2b83ea205d8abeb37c71ca1d4c1)
2003-08-25fix bug 289; make sure to reset the offset into a string when reallocating spaceGerald Carter1-1/+2
(This used to be commit 66dd20c7eaa66abdf99fa57475ccc4c9f978f1b5)
2003-08-15get rid of more compiler warningsHerb Lewis1-7/+7
(This used to be commit 398bd14fc6e2f8ab2f34211270e179b8928a6669)
2003-08-15get rid of const as these things really are not constHerb Lewis1-5/+5
(This used to be commit 61bea183a229cc11f25c4a7cb5341faad9833d7b)
2003-07-27Use push_ucs2_allocate(), rather than convert_string_allocate() directly.Andrew Bartlett1-37/+5
Remove strdup_upper/strdup_lower from their old file, now that they have been moved to charcnv.c Note that string_replace assumes that s is a pstring. (doco change only) Andrew Bartlett (This used to be commit 6c9056029bb3dfadb244f301598e12e69493fff9)
2003-07-25More printf portability fixes. Got caught out by some gcc'isms lastTim Potter1-1/+1
time. )-: (This used to be commit 59dae1da66a5eb7e128263bd578f167d8746e9f0)
2003-07-24More printf fixes - size_t is long on some architectures.Tim Potter1-1/+1
(This used to be commit ba4d334b822248d8ab929c9568533431603d967e)
2003-07-19Fix StrCaseCmp() to avoid calling smb_panic() on invalid multibyte strings.Andrew Bartlett1-11/+24
This fix results in - we no longer use fixed-size buffers in StrCaseCmp (previously limited to a pstring) - we return strcmp(s, t) if either of the strings is invalid - for non-ascii cases, we call iconv twice, not 4 times. The basic idea with this fix is that if a string is not valid in the currnet charset, then (unless it is byte-equivilant) it cannot be case-equivilant to any other string. This should address the majority of our smb_panic() cases on this matter. It will not fix them all - we still call unix_strupper(), aka strupper_m() elsewhere, but this was being called on every file in the directory when we performed unix_convert(). Tested with the stf unit tests for this routine. Andrew Bartlett (This used to be commit 9918fa73145a22b1d7adf001f0a9cf0e1bda4136)
2003-07-03Removed strupper/strlower macros that automatically map to ↵Jeremy Allison1-3/+3
strupper_m/strlower_m. I really want people to think about when they're using multibyte strings. Jeremy. (This used to be commit ff222716a08af65d26ad842ce4c2841cc6540959)
2003-07-02Added fix for Japanese case names in statcache - these can changeJeremy Allison1-0/+20
size on upper casing. Based on patch from monyo@home.monyo.com. Jeremy. (This used to be commit 72e382e99b92666acdaf50a040b14aa16d48b80d)
2003-06-25large change:Gerald Carter1-21/+38
*) consolidates the dc location routines again (dns and netbios) get_dc_list() or get_sorted_dc_list() is the authoritative means of locating DC's again. (also inludes a flag to get_dc_list() to define if this should be a DNS only lookup or not) (however, if you set "name resolve order = hosts wins" you could still get DNS queries for domain name IFF ldap_domain2hostlist() fails. The answer? Fix your DNS setup) *) enabled DOMAIN<0x1c> lookups to be funneled through resolve_hosts resulting in a call to ldap_domain2hostlist() if lp_security() == SEC_ADS *) enables name cache for winbind ADS backend *) enable the negative connection cache for winbind ADS backend *) removes some old dead code *) consolidates some duplicate code *) moves the internal_name_resolve() to use an IP/port pair to deal with SRV RR dns replies. The namecache code also supports the IP:port syntax now as well. *) removes 'ads server' and moves the functionality back into 'password server' (which can support "hostname:port" syntax now but works fine with defaults depending on the value of lp_security()) (This used to be commit d7f7fcda425bef380441509734eca33da943c091)
2003-05-12Add NT quota support. Patch from Stefan (metze) MetzemacherAlexander Bokovoy1-0/+22
1. Allows to change quota settings for shared mount points from Win2K and WinXP from Explorer properties tab 2. Disabled by default and when requested, will be probed and enabled only on Linux where it works 3. Was tested for approx. two weeks now on Linux by two independent QA teams, have not found any bugs so far Documentation to follow (This used to be commit 4bf022ce9e45be85609426762ba2644ac2031326)
2003-04-15merge in metze' smbcquotas patch from HEADGerald Carter1-3/+3
(This used to be commit b6a77048886151435a4a5eeb9a04be44d397c504)
2003-04-02Don't set zero length for the base64 decoded string (fixes swat auth).Andrew Bartlett1-2/+2
Andrew Bartlett (This used to be commit 7ab39cba6a97ddd0879dd968167fc7809f87de6e)
2003-03-24(merge from HEAD)Andrew Bartlett1-2/+22
NTLM Authentication: - Add a 'privileged' mode to Winbindd. This is achieved by means of a directory under lockdir, that the admin can change the group access for. - This mode is now required to access with 'CRAP' authentication feature. - This *will* break the current SQUID helper, so I've fixed up our ntlm_auth replacement: - Update our NTLMSSP code to cope with 'datagram' mode, where we don't get a challenge. - Use this to make our ntlm_auth utility suitable for use in current Squid 2.5 servers. - Tested - works for Win2k clients, but not Win9X at present. NTLMSSP updates are needed. - Now uses fgets(), not x_fgets() to cope with Squid environment (I think somthing to do with non-blocking stdin). - Add much more robust connection code to wb_common.c - it will not connect to a server of a different protocol version, and it will automatically try and reconnect to the 'privileged' pipe if possible. - This could help with 'privileged' idmap operations etc in future. - Add a generic HEX encode routine to util_str.c, - fix a small line of dodgy C in StrnCpy_fn() - Correctly pull our 'session key' out of the info3 from th the DC. This is used in both the auth code, and in for export over the winbind pipe to ntlm_auth. - Given the user's challenge/response and access to the privileged pipe, allow external access to the 'session key'. To be used for MSCHAPv2 integration. Andrew Bartlett (This used to be commit ec071ca3dcbd3881dc08e6a8d7ac2ff0bcd57664)
2003-03-19use strnlen to prevent coredumpsJim McDonough1-3/+3
(This used to be commit 5078436d83f0fdc568d6687809c7c70dea5fd382)
2003-03-18Merge mbp's HEAD changes.Jeremy Allison1-33/+71
Jeremy. (This used to be commit da1271a95fce7fd217555fb161d4669d0b9b80e2)
2003-03-18Merge in the developer string options from HEAD. We need to ensure 3.0Jeremy Allison1-47/+51
is as stable as possible in the string department and some pain now will help later :-). Jeremy. (This used to be commit 86e3eddac698d90f4666b8492b4603a4efbbd67b)
2003-03-17Merge from (earlier) HEAD - doxygen.Andrew Bartlett1-6/+8
I'm not merging the current HEAD string stuff quite yet. (This used to be commit 9b8d12e081462566043bb51e9c95605609572a54)
2003-02-24Merge doxygen, signed/unsigned, const and other small fixes from HEAD to 3.0.Andrew Bartlett1-122/+129
Andrew Bartlett (This used to be commit 9ef0d40c3f8aef52ab321dc065264c42065bc876)
2003-02-18base64_decode() with heimdal libs, so I've renamed it base64_decode_inplace().Jim McDonough1-1/+1
(This used to be commit d510ff85fb0dafddf3dea9412a09eeee6e70f0cb)
2003-02-07merge from headAndrew Tridgell1-2/+6
(This used to be commit fd3216dbcbaec7d64dd24fe2af6c4156935c47e9)
2003-01-28Merge from HEAD:Andrew Bartlett1-0/+94
- NTLMSSP over SPENGO (sesssion-setup-and-x) cleanup and code refactor. - also consequential changes to the NTLMSSP and SPNEGO parsing functions - and the client code that uses the same functions - Add ntlm_auth, a NTLMSSP authentication interface for use by applications like Squid and Apache. - also consquential changes to use common code for base64 encode/decode. - Winbind changes to support ntlm_auth (I don't want this program to need to read smb.conf, instead getting all it's details over the pipe). - nmbd changes for fstrcat() instead of fstrcpy(). Andrew Bartlett (This used to be commit fbb46da79cf322570a7e3318100c304bbf33409e)
2003-01-17Janitorial duty...Jeremy Allison1-4/+8
fix some undefined behaviour with increments in C. In theory a compiler could have produced complete crap for this code. (tridge). Jeremy. (This used to be commit 2b4335f06265940582f389f48dc4f87f452a2703)
2003-01-15*lots of small merges form HEADGerald Carter1-5/+17
*sync up configure.in *don't build torture tools in make all *make sure to remove torture tools as part of make clean (This used to be commit 0fb724b3216eeeb97e61ff12755ca3a31bcad6ef)
2003-01-04Merge from HEAD - whitespace :-)Andrew Bartlett1-1/+0
(This used to be commit 5fc90b6cf438480c9fcf8d01f0a319a52c5914cc)
2003-01-04Merge from HEAD - mimir's new gencache based namecache code.Andrew Bartlett1-0/+152
Andrew Bartlett (This used to be commit f79324f730c400342f445c931b0d75ff756d7cc7)
2003-01-03Merge from HEAD - make Samba compile with -Wwrite-strings without additionalAndrew Bartlett1-2/+2
warnings. (Adds a lot of const). Andrew Bartlett (This used to be commit 3a7458f9472432ef12c43008414925fd1ce8ea0c)
2003-01-03Merge from HEAD - add PRINTF_ATTRIBUTE to a few more functions.Andrew Bartlett1-2/+2
(This used to be commit 9e5297131cc53d7161aa74566f147b98e1c27aaa)
2002-12-11Fixed auth module code. Added VALGRIND defines to reduce spurious warnings.Jeremy Allison1-0/+11
Jeremy. (This used to be commit ec4ed45563f9d8e25fcfd88840944a90b3139c3e)
2002-11-12Removed global_myworkgroup, global_myname, global_myscope. Added liberalJeremy Allison1-7/+8
dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy. (This used to be commit f755711df8f74f9b8e8c1a2b0d07d02a931eeb89)
2002-10-02Added const. Anal formatting fixup.Jeremy Allison1-175/+222
Jeremy. (This used to be commit 66531969dfe0935be2c9c4d89f5bba80d862a52f)
2002-10-01syncing up with HEAD. Seems to be a lot of differences creeping inGerald Carter1-2/+2
(i ignored the new SAMBA stuff, but the rest of this looks like it should have been merged already). (This used to be commit 3de09e5cf1f667e410ee8b9516a956860ce7290f)
2002-10-01Updates from Samba HEAD:Andrew Bartlett1-6/+6
- Fix segfaults in the 'net ads' commands when no password is provided - Readd --with-ldapsam for 2.2 compatability. This conditionally compiles the old options, but the actual code is available on all ldap systems. - Fix shadow passwords (as per work with vl) - Fix sending plaintext passwords to unicode servers (again vl) - Add a bit of const to secrets.c functions - Fix some spelling and grammer by vance. - Document the -r option in smbgroupedit. There are more changes in HEAD, I'm only merging the changes I've been involved with. Andrew Bartlett (This used to be commit 83973c389355a5cc9ca74af467dfd8b5dabd2c8f)
2002-08-17sync 3.0 branch with headJelmer Vernooij1-72/+93
(This used to be commit 3928578b52cfc949be5e0ef444fce1558d75f290)
2002-07-15updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell1-18/+314
(This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
2002-04-11added strndup() for systems that don't have itAndrew Tridgell1-0/+19
(This used to be commit 7e92fb7453e4dbf1fe0c32c3dcc1e994cb95b5ea)
2002-04-11this adds a completely new hash based mangling schemeAndrew Tridgell1-0/+20
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. (This used to be commit bb173c1a7e2408ced967ebac40b5e3f852ccd3a1)
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-25minor fixesSimo Sorce1-3/+4
(This used to be commit 04f492980b73800b60dde764fdeb43f2eab79624)
2002-01-16Roll back PSTRING_SANCTIFY patch; just leave non-controversial typeMartin Pool1-2/+2
and constness changes. (This used to be commit cee0ec72746122c962e6c5278a736266a7f2c424)
2002-01-15Add constness to filenames passed to functions.Martin Pool1-0/+25
(This used to be commit 8d106dc1f4a51112516d72ae68747ca6b5b904b7)