summaryrefslogtreecommitdiff
path: root/source3/lib/util_str.c
AgeCommit message (Collapse)AuthorFilesLines
2026-02-15lib: Simplify conv_str_sizeVolker Lendecke1-31/+3
conv_str_size_error() from lib/util has almost the same code Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20smbd: Remove unused STR_TO_SMB_BIG_UINTVolker Lendecke1-27/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2024-07-04lib: Remove unused strnrchr_mVolker Lendecke1-35/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-05-22lib: Fix a typoVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-12-12lib: Remove unused octal_string()Volker Lendecke1-18/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-02-17smbd: Make strnorm() static to filename.cVolker Lendecke1-12/+0
The caller in vfs_prealloc was a bit unneeded, and strnorm is only called here. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Feb 17 18:11:18 UTC 2022 on sn-devel-184
2022-01-18lib: Remove unused asprintf_strupper_m()Volker Lendecke1-26/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-03-10lib/util: Replace buggy string_sub_talloc() with talloc_string_sub() in lib/utilAndrew Bartlett1-117/+0
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14658 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Mar 10 08:06:25 UTC 2021 on sn-devel-184
2020-08-03lib: relicense smb_strtoul(l) under LGPLv3Ralph Boehme1-0/+1
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Aug 3 22:21:04 UTC 2020 on sn-devel-184
2020-07-16s3: lib: Cleanup - all the ipstr_XXX() functions are only used in namecache.c.Jeremy Allison1-164/+0
Move them there. Will remove from the global namespace next. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2020-05-05lib: Move push_skip_string() to clirap2.cVolker Lendecke1-10/+0
It's only used there Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-01-30lib: Align integer typesVolker Lendecke1-2/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-11-27s3:lib: remove unused str_list_substitute()Stefan Metzmacher1-74/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2019-06-30source3: Update all consumers of strtoul_err(), strtoull_err() to new APISwen Schillig1-3/+3
Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
2019-04-11lib: Update error check for new string conversion wrapperSwen Schillig1-1/+1
The new string conversion wrappers detect and flag errors which occured during the string to integer conversion. Those modifications required an update of the callees error checks. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
2019-03-01lib: Use wrapper for string to integer conversionSwen Schillig1-2/+3
In order to detect an value overflow error during the string to integer conversion with strtoul/strtoull, the errno variable must be set to zero before the execution and checked after the conversion is performed. This is achieved by using the wrapper function strtoul_err and strtoull_err. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-08lib: Remove StrnCpyVolker Lendecke1-26/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-03-01s3:lib: Add FALL_THROUGH statements in util_str.cAndreas Schneider1-0/+4
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-08-24s3-lib: Remove unused function sprintf_appendAmitay Isaacs1-59/+0
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12168 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-06lib: Fix a typoVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
2015-02-10lib: Fix a typoVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-14lib: Slightly simplify strupper_mVolker Lendecke1-2/+2
toupper_ascii_fast_table is only referenced here, make it static. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Nov 14 00:31:16 CET 2014 on sn-devel-104
2014-09-16s3: utils: Don't directly manipulate errno inside strupper_m().Jeremy Allison1-5/+1
Let the internal character conversion routines set it. Caller code paths don't depend on this (checked by David Disseldorp ddiss@suse.de). Bug 10775 - smbd crashes when accessing garbage filenames https://bugzilla.samba.org/show_bug.cgi?id=10775 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-05-07move str_list_make_v3 out of s3 codeGarming Sam1-68/+0
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23lib: Move full_path_tos to util_str.cVolker Lendecke1-0/+39
This can be useful elsewhere Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-12lib: Fix CID 241650 Sizeof not portableVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sun May 12 17:44:55 CEST 2013 on sn-devel-104
2013-05-06s3:lib fix wrong usage of PRIu64 in sscanfChristian Ambach1-1/+1
Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2012-08-09Remove smb_panic() from unix_strlower(). Just rely on error code return.Jeremy Allison1-2/+0
Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Aug 9 23:52:53 CEST 2012 on sn-devel-104
2012-08-09Correctly check for errors in strlower_m() returns.Jeremy Allison1-4/+5
2012-08-09Fix strlower_m() to return an error indication.Jeremy Allison1-4/+8
2012-08-09Check error returns on strnorm().Jeremy Allison1-2/+3
2012-08-09Check error returns from strupper_m() (in all reasonable places).Jeremy Allison1-4/+10
2012-08-09Change strupper_m() to return a value.Jeremy Allison1-4/+8
2012-08-09Fix bad return in unix_strupper.Jeremy Allison1-1/+1
2012-08-09Prepare to remove smb_panic() from unix_strlower().Jeremy Allison1-0/+2
2012-08-09Fix bad return values in unix_strlower/unix_strupper.Jeremy Allison1-2/+2
2012-07-24lib/param: Move all enum declarations to lib/paramAndrew Bartlett1-0/+1
This is in preperation for the parameter table being made common. Andrew Bartlett Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
2011-08-03s3-auth remove sanitized_username from auth_serversupplied_infoAndrew Bartlett1-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>
2011-07-19First part of fix for bug 8310 - toupper_ascii() is broken on big-endian systemsJeremy Allison1-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.
2011-06-09s3-talloc Change TALLOC_ARRAY() to talloc_array()Andrew Bartlett1-3/+3
Using the standard macro makes it easier to move code into common, as TALLOC_ARRAY isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()Andrew Bartlett1-2/+2
Using the standard macro makes it easier to move code into common, as TALLOC_REALLOC_ARRAY isn't standard talloc. Andrew Bartlett
2011-06-01s3: fix more -Wunused-but-set-variable build warnings.Günther Deschner1-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
2011-05-31s3-lib Move realloc based string substitution functions out of util_str.cAndrew Bartlett1-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
2011-05-31s3-lib Move sstring_sub() to it's only user and make staticAndrew Bartlett1-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
2011-05-31s3-lib Move string_init functions into their own fileAndrew Bartlett1-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
2011-05-18s3-lib Replace StrnCaseCmp() with strncasecmp_m()Andrew Bartlett1-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
2011-05-18s3-lib Replace StrCaseCmp() with strcasecmp_m()Andrew Bartlett1-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
2011-05-05More simple const fixes.Jeremy Allison1-2/+2
2011-05-03lib/util Use lib/util/util_str.c in common, including strequal()Andrew Bartlett1-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
2011-05-03Remove strlower_m() and strupper_m() from source4 and common code.Andrew Bartlett1-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