summaryrefslogtreecommitdiffstats
path: root/source3/lib/util_str.c
Commit message (Collapse)AuthorAgeFilesLines
* s3-auth remove sanitized_username from auth_serversupplied_infoAndrew Bartlett2011-08-031-8/+0
| | | | | | | | | | | This structure element was only written to, not read. It is filled into the companion structure, auth_session_info() by create_local_token(). Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* First part of fix for bug 8310 - toupper_ascii() is broken on big-endian systemsJeremy Allison2011-07-191-1/+1
| | | | | | | | | | 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.
* s3-talloc Change TALLOC_ARRAY() to talloc_array()Andrew Bartlett2011-06-091-3/+3
| | | | | Using the standard macro makes it easier to move code into common, as TALLOC_ARRAY isn't standard talloc.
* s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()Andrew Bartlett2011-06-091-2/+2
| | | | | | | Using the standard macro makes it easier to move code into common, as TALLOC_REALLOC_ARRAY isn't standard talloc. Andrew Bartlett
* s3: fix more -Wunused-but-set-variable build warnings.Günther Deschner2011-06-011-3/+0
| | | | | | | Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Wed Jun 1 00:29:30 CEST 2011 on sn-devel-104
* s3-lib Move realloc based string substitution functions out of util_str.cAndrew Bartlett2011-05-311-123/+3
| | | | | | | This makes the dependency set for source3/lib/util_str.c simpiler, which in turn makes it easier to build a dependency tree. Andrew Bartlett
* s3-lib Move sstring_sub() to it's only user and make staticAndrew Bartlett2011-05-311-27/+0
| | | | | | | This should not be used more generally, as it is specifically not for multibyte strings, and uses malloc rather than talloc. Andrew Bartlett
* s3-lib Move string_init functions into their own fileAndrew Bartlett2011-05-311-52/+0
| | | | | | | | These have not been moved in common, as they are not talloc-based, but it helps with dependencies if these are seperated from the rest of util_str.c Andrew Bartlett
* s3-lib Replace StrnCaseCmp() with strncasecmp_m()Andrew Bartlett2011-05-181-61/+1
| | | | | | | strncasecmp_m() never needs to call to talloc, and via next_codepoint() still has an ASCII fast-path bypassing iconv() calls. Andrew Bartlett
* s3-lib Replace StrCaseCmp() with strcasecmp_m()Andrew Bartlett2011-05-181-84/+1
| | | | | | | strcasecmp_m() never needs to call to talloc, and via next_codepoint() still has an ASCII fast-path bypassing iconv() calls. Andrew Bartlett
* More simple const fixes.Jeremy Allison2011-05-051-2/+2
|
* lib/util Use lib/util/util_str.c in common, including strequal()Andrew Bartlett2011-05-031-86/+0
| | | | | | | | strequal() is now implemented in terms of strcasecmp_m() which is tested in smbtorture and which does not talloc() for ASCII or non-ASCII comparions, and has an ASCII fast-path. Andrew Bartlett
* Remove strlower_m() and strupper_m() from source4 and common code.Andrew Bartlett2011-05-031-0/+61
| | | | | | | | | This function is problematic because a string may expand in size when changed into upper or lower case. This will then push characters off the end of the string in the s3 implementation, or panic in the former s4 implementation. Andrew Bartlett
* s3-lib: Rely on uint64_t in conv_str_size()Andrew Bartlett2011-04-301-30/+13
| | | | | Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Sat Apr 30 05:58:35 CEST 2011 on sn-devel-104
* lib/util Re-merge the string_sub() and all_string_sub() from source3Andrew Bartlett2011-04-291-128/+0
| | | | Andrew Bartlett
* lib/util/charset Move strstr_m() to the top levelAndrew Bartlett2011-04-291-81/+0
|
* lib/util Move alpha_strcpy() from s3 into common codeAndrew Bartlett2011-04-141-50/+0
| | | | | Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Thu Apr 14 09:21:59 CEST 2011 on sn-devel-104
* s3-lib Remove very unused (#if 0) strncpynAndrew Bartlett2011-04-141-25/+0
| | | | | Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Thu Apr 14 06:27:31 CEST 2011 on sn-devel-104
* s3-lib Remove unused string_appendAndrew Bartlett2011-04-141-22/+0
|
* s3-lib Move unix_strlower and unix_strupper to their only users.Andrew Bartlett2011-04-141-0/+41
|
* s3-lib Remove unused str_ascii_charnum()Andrew Bartlett2011-04-141-18/+0
|
* s3-lib Move strisnormal to it's only user in mangle_hash.cAndrew Bartlett2011-04-141-13/+0
|
* lib/util: Make string_replace from s3 commonAndrew Bartlett2011-04-131-43/+0
| | | | | | | | | The s4 implementation didn't do multibyte strings, so was only good for '/' which is known to be safe in all multibyte charsets. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* lib/util Move simple string routines into common code.Andrew Bartlett2011-04-131-49/+0
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* lib/util Move base64 functions into lib/util/base64.cAndrew Bartlett2011-03-301-115/+0
| | | | Andrew Bartlett
* =?UTF-8?q?alpha=5Fstrcpy()=20is=20a=20utility=20function=20which=20reportedly:David Disseldorp2011-03-291-3/+9
| | | | | | | | | | =20Strips=20out=20all=20but=20'a-Z0-9'=20and=20the=20character=20in=20other=5Fsafe=5Fchars=20and =20replaces=20with=20'=5F'. =20This=20statement=20does=20not=20currently=20hold=20true=20in=20all=20cases=20(e.g.=20src=20=3D =20"=D0=A2=D0=90=D0=9D=D0=A6=D0=95=D0=92=D0=90=D0=A2=D0=AC").?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
* lib/util: Merge basic string length and comparison functionsAndrew Bartlett2011-03-231-292/+0
| | | | | | | | | | These functions now use the codepoints for more accurate string handling and now form common code. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed Mar 23 08:21:54 CET 2011 on sn-devel-104
* s3-lib prepare Samba3 to use common codepoint based string functionsAndrew Bartlett2011-03-231-108/+82
| | | | | | | This patch changes the source3 util_str.c functions so that the next patch just contains the move into common code, without code changes. Andrew Bartlett
* s3-safe_str: Futher simplify the macros by removing indirectionAndrew Bartlett2011-03-231-5/+5
| | | | | | | | Now that we don't need to pass in the function name and string, another level of indirection can be safely removed, and the operation of these macros made much clearer. Andrew Bartlett
* s3-lib Remove the clobber_region() code.Andrew Bartlett2011-03-231-48/+15
| | | | | | | | | | | | | | | | | | This code wrote to the full buffer in fstrcpy(), pstrcpy() and other fixed-length string manipulation functions. The hope of this code was to find out at run time if we were mixing up pstring and fstring etc, and to record where this came from. It has a runtime performance impact (particularly if compiled with --enable-developer). It is being removed because of the complexity it adds, and the distinct lack of bugs that this complexity has been credited in finding. The macro-based compile-time checking of string sizes remains. Andrew Bartlett
* s3: Remove some unused codeVolker Lendecke2011-03-151-41/+0
|
* charset Remove use of {isupper,islower,toupper,tolower}_w functionsAndrew Bartlett2011-02-181-2/+2
| | | | | | | | | | | | | These now call the common _m functions that consider UTF16 code points. This removes the code which will make up a 'lame' table in memory, as this can just as correctly be handled by running the algorithm at runtime (which is to call toupper() and tolower() on characters < 128). When used, a top level waf build will always locate the correct table - in the build tree or outside - due to relinking the installed binary. Andrew Bartlett
* Fix up some buildfarm warnings.Jeremy Allison2011-02-091-1/+1
|
* s3:lib: allow_trailing_dollar should only allow '$'Stefan Metzmacher2011-02-031-12/+12
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu Feb 3 00:33:48 CET 2011 on sn-devel-104
* Fix bug 7781 - Samba transforms ShareName to lowercase (sharename) when ↵Jeremy Allison2010-11-101-0/+4
| | | | | | | | | adding new share via MMC Change the find_service() interface to not depend on fstring, and create a useable talloc-based interface. Jeremy.
* s3:util_str: add strlen_m_ext_term() - variant of strlen_m_ext() counting ↵Michael Adam2010-11-031-0/+9
| | | | terminator
* s3:lib/util_str: add strlen_m_ext() that takes input and output charsetMichael Adam2010-11-031-13/+55
| | | | | | | The function calculates the number of units (8 or 16-bit, depending on the destination charset), that would be needed to convert the input string which is expected to be in in src_charset encoding to the dst_charset (which should be a unicode charset).
* s3:lib/util_str: clarify the comment header for strlen_m().Michael Adam2010-11-031-4/+6
|
* Fox missing SMB_MALLOC return checks noticed by "Andreas Moroder ↵Jeremy Allison2010-09-091-0/+3
| | | | | | <andreas.moroder@gmx.net>". Jeremy.
* s3: Move sanitize_username to lib/util_str.cVolker Lendecke2010-04-111-0/+8
|
* s3: Slightly simplify logic in conv_str_sizeVolker Lendecke2010-03-281-29/+33
|
* s3: Fix indentation in conv_str_sizeVolker Lendecke2010-03-281-2/+2
|
* Revert 918b5a7e057bd91289ec06b3ef8d95da43a50ede. This codeJeremy Allison2009-09-241-6/+6
| | | | | should *not* return const. Jeremy.
* s3:util_str "str_list_make_v3" - introduce also here the "const" resultMatthias Dieter Wallnöfer2009-09-241-9/+9
| | | | I did this to match with the default util strlist library.
* Replace short-lived NULL talloc contexts with talloc_tos().Jeremy Allison2009-07-161-17/+17
| | | | Jeremy.
* Fix our base64 implementation for blobs of length 4....Volker Lendecke2009-07-101-1/+1
| | | | | The additional length check bit us exactly at 4, removing it. The torture test survives valgrind up to 2000 bytes :-)
* Make sid_binstring & friends take a talloc contextVolker Lendecke2009-05-281-3/+4
|
* Re-import the v3-3 version of str_list_make().Volker Lendecke2009-04-301-7/+59
| | | | | | | | | | | | | | The merged version behaves differently: "Domain Users" is parsed into two values, as it does not look at quotes. Samba3 users depend on the ability do say for example valid users = "domain users" which would not work anymore with the merged version. Thanks to Björn Jacke for testing this! Volker
* Convert Samba3 to use the common lib/util/charset APIAndrew Bartlett2009-04-141-46/+46
| | | | | | | | | | | | 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
* Move next_token_talloc() to top-level.Jelmer Vernooij2009-03-011-112/+0
|