1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

294 Commits

Author SHA1 Message Date
Volker Lendecke
f31478e782 lib: Remove unused strnrchr_m
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-07-04 15:26:36 +00:00
Volker Lendecke
27ac0beaa0 lib: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-05-22 04:23:29 +00:00
Volker Lendecke
0b070db63b lib: Remove unused octal_string()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-12 21:16:33 +00:00
Volker Lendecke
2649d654cf smbd: Make strnorm() static to filename.c
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-02-17 18:11:18 +00:00
Volker Lendecke
12ca34115e lib: Remove unused asprintf_strupper_m()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-01-18 20:22:38 +00:00
Andrew Bartlett
d7e620ff41 lib/util: Replace buggy string_sub_talloc() with talloc_string_sub() in lib/util
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
2021-03-10 08:06:25 +00:00
Ralph Boehme
2327471756 lib: relicense smb_strtoul(l) under LGPLv3
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-08-03 22:21:02 +00:00
Jeremy Allison
527d7df08e s3: lib: Cleanup - all the ipstr_XXX() functions are only used in namecache.c.
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-07-16 06:52:36 +00:00
Volker Lendecke
1226f43549 lib: Move push_skip_string() to clirap2.c
It's only used there

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 11:48:39 +00:00
Volker Lendecke
30940e7280 lib: Align integer types
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-01-30 12:27:40 +00:00
Stefan Metzmacher
57fa96b476 s3:lib: remove unused str_list_substitute()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-11-27 10:25:31 +00:00
Swen Schillig
a75727f191 source3: Update all consumers of strtoul_err(), strtoull_err() to new API
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2019-06-30 11:32:18 +00:00
Swen Schillig
7adaebe567 lib: Update error check for new string conversion wrapper
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-04-11 22:29:26 +00:00
Swen Schillig
c9f4b92a61 lib: Use wrapper for string to integer conversion
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-03-01 00:32:10 +00:00
Volker Lendecke
cc0664dd04 lib: Remove StrnCpy
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-08 03:40:26 +01:00
Andreas Schneider
16d14fa863 s3:lib: Add FALL_THROUGH statements in util_str.c
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-03-01 04:37:41 +01:00
Amitay Isaacs
d123085f69 s3-lib: Remove unused function sprintf_append
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>
2016-08-24 01:33:50 +02:00
Volker Lendecke
607301a843 lib: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-05-06 15:37:14 +02:00
Volker Lendecke
627a98d095 lib: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-02-10 23:35:08 +01:00
Volker Lendecke
04a9a1ac6d lib: Slightly simplify strupper_m
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-11-14 00:31:16 +01:00
Jeremy Allison
6bce3d81e1 s3: utils: Don't directly manipulate errno inside strupper_m().
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-09-16 01:56:54 +02:00
Garming Sam
98dbc38efa move str_list_make_v3 out of s3 code
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:16 +02:00
Volker Lendecke
3e24e07467 lib: Move full_path_tos to util_str.c
This can be useful elsewhere

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23 22:33:08 +02:00
Volker Lendecke
09d3f577c8 lib: Fix CID 241650 Sizeof not portable
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-12 17:44:55 +02:00
Christian Ambach
24ce31a33f s3:lib fix wrong usage of PRIu64 in sscanf
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-05-06 16:33:38 +02:00
Jeremy Allison
a5495bc6b0 Remove smb_panic() from unix_strlower(). Just rely on error code return.
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-09 23:52:53 +02:00
Jeremy Allison
b70f23c2b5 Correctly check for errors in strlower_m() returns. 2012-08-09 12:08:18 -07:00
Jeremy Allison
ce21d08040 Fix strlower_m() to return an error indication. 2012-08-09 12:07:41 -07:00
Jeremy Allison
c13887defc Check error returns on strnorm(). 2012-08-09 12:07:32 -07:00
Jeremy Allison
526e875cec Check error returns from strupper_m() (in all reasonable places). 2012-08-09 12:06:54 -07:00
Jeremy Allison
9fcc6f27fb Change strupper_m() to return a value. 2012-08-09 09:47:35 -07:00
Jeremy Allison
af3e529c18 Fix bad return in unix_strupper. 2012-08-09 09:47:35 -07:00
Jeremy Allison
b6eb3a6808 Prepare to remove smb_panic() from unix_strlower(). 2012-08-09 09:47:35 -07:00
Jeremy Allison
8605b35e88 Fix bad return values in unix_strlower/unix_strupper. 2012-08-09 09:47:35 -07:00
Andrew Bartlett
f3562424b6 lib/param: Move all enum declarations to lib/param
This is in preperation for the parameter table being made common.

Andrew Bartlett

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
2012-07-24 11:01:17 +02:00
Andrew Bartlett
1aced1e989 s3-auth remove sanitized_username from auth_serversupplied_info
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-08-03 18:48:04 +10:00
Jeremy Allison
ee34c25c8a First part of fix for bug 8310 - toupper_ascii() is broken on big-endian systems
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-07-19 13:19:29 -07:00
Andrew Bartlett
3d15137653 s3-talloc Change TALLOC_ARRAY() to talloc_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
73b377432c s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_REALLOC_ARRAY isn't standard talloc.

Andrew Bartlett
2011-06-09 12:40:08 +02:00
Günther Deschner
f103e0c39f s3: fix more -Wunused-but-set-variable build warnings.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Jun  1 00:29:30 CEST 2011 on sn-devel-104
2011-06-01 00:29:30 +02:00
Andrew Bartlett
3b7e1ac31c s3-lib Move realloc based string substitution functions out of util_str.c
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-31 00:32:08 +02:00
Andrew Bartlett
a5a2373979 s3-lib Move sstring_sub() to it's only user and make static
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-31 00:32:07 +02:00
Andrew Bartlett
53140724f1 s3-lib Move string_init functions into their own file
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-31 00:32:07 +02:00
Andrew Bartlett
da662b82b8 s3-lib Replace StrnCaseCmp() with strncasecmp_m()
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-18 16:12:08 +02:00
Andrew Bartlett
c615ebed6e s3-lib Replace StrCaseCmp() with strcasecmp_m()
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-18 16:12:08 +02:00
Jeremy Allison
02af307585 More simple const fixes. 2011-05-05 23:56:07 +02:00
Andrew Bartlett
2c32534d5b lib/util Use lib/util/util_str.c in common, including strequal()
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-03 07:37:07 +02:00
Andrew Bartlett
2742ec0e34 Remove strlower_m() and strupper_m() from source4 and common code.
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
2011-05-03 07:37:07 +02:00
Andrew Bartlett
1018dd1826 s3-lib: Rely on uint64_t in conv_str_size()
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sat Apr 30 05:58:35 CEST 2011 on sn-devel-104
2011-04-30 05:58:35 +02:00
Andrew Bartlett
93ace5cc24 lib/util Re-merge the string_sub() and all_string_sub() from source3
Andrew Bartlett
2011-04-29 16:38:15 +10:00