1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

94 Commits

Author SHA1 Message Date
Volker Lendecke
bbcc9b326e lib: Add dump_data_addbuf()
Helper function to build up debug strings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2023-03-09 18:10:33 +00:00
Volker Lendecke
e5d1527f74 lib: Move the dump_data_pw() prototype to the other dump_data_* ones
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2023-03-09 18:10:33 +00:00
Stefan Metzmacher
b489b7feda lib/util: add dump_data_diff*() helpers
That will make it easy to see the difference
between two memory buffers.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14956

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2022-01-24 15:25:36 +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
Swen Schillig
1756cea95b util: cleanup API change for strtoul(l) wrappers
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
f2997ad677 lib: Prepare for strtoul_err(), strtoull_err() API change
In order to still be bisectable when changing the API for the wrappers
strtoul_err() and strtoull_err() some preparations need to be performed.

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
7fd0cd02b7 lib: Add flag definitions to control the internal string to int conversion routines
The following flags are defined intially

    SMB_STR_STANDARD # raise error if negative or non-numeric
    SMB_STR_ALLOW_NEGATIVE # allow strings with a leading "-"
    SMB_STR_FULL_STR_CONV # entire string must be converted
    SMB_STR_ALLOW_NO_CONVERSION # allow empty strings or non-numeric
    SMB_STR_GLIBC_STANDARD # act exactly as the standard glibc strtoul

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
cef18c2dfd util: Add two wrapper for string to int conversion
Adding wrapper strtoull_err and strtoul_err to handle
error conditions of the conversion process.

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:09 +00:00
Jelmer Vernooij
ffbd9c4584 Add a new header file for functions in lib/util/util.c.
This allows public headers to not include samba_util.h, but rather
specific header files under lib/util.

Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-By: Stefan Metzmacher <metze@samba.org>
2016-01-13 04:43:23 +01:00
Andrew Bartlett
d40fe50a67 build: avoid util.h as a public header name due to conflict with MacOS 2011-09-23 09:24:03 +02:00
Andrew Tridgell
6e25723c82 lib: added base64_decode_data_blob_talloc()
its nice to be able to allocate on other than NULL

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-09-08 03:35:27 +02:00
Simo Sorce
039ddef209 util: add function to extend anonymous shared memory 2011-08-14 20:19:02 -04:00
Simo Sorce
05455b459a lib-util: Make useful function a common utility.
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:02 +02:00
Andrew Bartlett
6543987139 libcli/smb move enum protocol_types to a common header 2011-07-06 05:32:51 +02:00
Andrew Bartlett
f83fca1c57 lib/util: Use common d_printf() in the whole codebase
This removes the lang_tdb based varient, the only user of the lang_tdb
code is SWAT, which calls that directly.

'net' and 'pam_winbind' are internationalised using gettext.

Andrew Bartlett
2011-06-21 09:35:34 +10:00
Andrew Bartlett
f3d6b742b1 lib/util Make unused d_vfprintf() static 2011-06-21 09:35:34 +10:00
Andrew Bartlett
16b1c77644 lib/util Bring procid_str() into lib/util as server_id_string()
This is needed for OpenChange, which prints Samba struct server_id
values in debug messages.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
de46ad9084 lib/util use modules_path(), data_path() and shlib_ext() from source3
This brings these helpful utility functions in common, as they are not
based on either loadparm system.

(The 'modules dir' parameter from Samba4 will shortly be removed, so
there is no loss in functionality)

Andrew Bartlett
2011-06-06 17:37:51 +10:00
Andrew Bartlett
52399f3177 lib/util Move sys_memalign into lib/util/system.c 2011-05-31 02:57:19 +02:00
Andrew Bartlett
8aae59a277 lib/util don't use enum protocol_types in ms_fnmatch_protocol
This makes it easier to compile this in the top level with s3 and s4
headers.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri May  6 08:50:52 CEST 2011 on sn-devel-104
2011-05-06 08:50:52 +02:00
Andrew Bartlett
3892112e7b lib/util Rename ms_fnmatch() to ms_fnmatch_protocol() to avoid dup symbol
This verison of the function takes a protcol as argument to determine
matching rules.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Jeremy Allison
ff215f5c89 I added them, so I get to kill them :-). Finally remove all uses of safe_strcpy and safe_strcat. Change to strlcpy, strlcat.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed May  4 22:14:14 CEST 2011 on sn-devel-104
2011-05-04 22:14:14 +02:00
Andrew Bartlett
86a62ab434 lib/util Use compiler-checked safe string macros in top level code.
This brings the 'safe' macros to the top level code, and removes
duplication of the safe_strcpy() and safe_strcat() functions.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
fbea52f74a lib/util Move more network utility functions from source3 into lib/util
This will help with the merge of the interfaces layer.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
bcd68837ee lib/util Rename conv_str_size() -> conv_str_size_error() 2011-04-30 10:38:25 +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
Andrew Bartlett
a64958a880 lib/util Move base64 functions into lib/util/base64.c
Andrew Bartlett
2011-03-30 12:17:05 +02:00
Andrew Tridgell
8d2d0ef0eb lib: removed a spurios declaration of 'logfile'
we don't have a global logfile variable any more

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-29 06:17:03 +02:00
Andrew Tridgell
6e8b6358ec fault: fixed smb_panic() prototypes
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Mar 23 01:51:44 CET 2011 on sn-devel-104
2011-03-23 01:51:44 +01:00
Andrew Tridgell
580997ede0 fault: get fault.c ready for use by s4
this moves the s3 specific dumpcore code into source3/lib/dumpcore.c,
and uses a function pointer to setup which smb_panic call to use
2011-03-23 11:03:57 +11:00
Andrew Tridgell
5ca9db07f5 lib: fixed header paths
this is a public header, and needs to use sane paths for the public
header creation
2011-03-15 12:22:19 +11:00
Stefan Metzmacher
d7fa349052 s3:auth: change num_groups to from size_t to uint32_t
This will help with the change from UNIX_USER_TOKEN to security_unix_token

metze
2011-02-22 16:20:11 +11:00
Andrew Bartlett
e4c2023082 lib/util Remove #if _SAMBA_BUILD_ == 4 that isn't required any more 2011-02-18 18:41:00 +11:00
Andrew Tridgell
40a48f5502 s4-util: removed the valgrind_strlen() routine
this was for a bug in valgrind from 7 years ago.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-18 15:09:47 +11:00
Stefan Metzmacher
cc59f347ee lib/util: add anonymous_shared_free()
metze
2011-01-20 05:31:45 +01:00
Stefan Metzmacher
34ea909636 lib/util: s/allocate_anonymous_shared/anonymous_shared_allocate/
metze
2011-01-20 05:31:45 +01:00
Andrew Tridgell
da5c328b4b s4-dns: disable segfault handling in dlz_bind9
we don't want bind9 calling the Samba segv handler
2010-12-21 11:18:19 +01:00
Stefan Metzmacher
5bb7723803 lib/util: remove useless ../lib/util/mutex.*
Only the disabled process_thread.c registers uses the register fn,
all other functions are not used anywhere.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Oct 26 23:29:46 UTC 2010 on sn-devel-104
2010-10-26 23:29:46 +00:00
Volker Lendecke
0831807782 Add dump_data_cb() 2010-10-24 20:46:28 +00:00
Volker Lendecke
611bcfcb49 Add print_asc_cb() 2010-10-24 20:46:28 +00:00
Björn Jacke
2b254c814b s3/s4: merge msleep and smb_msleep
the merged variant is renamed to smb_msleep as some platforms already have a
msleep function.
2010-09-16 21:38:20 +02:00
Andrew Tridgell
b58bfb3510 util: added samba_start_debugger()
This developer function is useful for debugging unusual error
conditions
2010-09-04 12:29:10 +10:00
Andreas Schneider
a6f25fc635 s3-smbd: Don't close stdout if we want to log to stdout. 2010-03-26 14:48:54 +01:00
Andrew Tridgell
fae84f98e3 libutil: moved the networking defines to util_net.h
These were causing thousands of warnings on solaris8
2010-03-26 17:36:02 +11:00
Stefan Metzmacher
01f2c023f7 lib/util: add allocate_anonymous_shared()
metze
2010-03-22 17:15:10 +01:00
Stefan Metzmacher
6ea3393798 lib/util: change samba_runcmd() to use tevent_req _send/_recv
metze
2010-03-09 21:49:45 +11:00
Stefan Metzmacher
792dd38d7c lib/util: add generate_random_password()
metze
2010-02-26 08:57:28 +01:00
Andrew Tridgell
b0b857d6ca s4-dns: use a loadparm list for samba_runcmd() commands
This allows commands with multiple arguments and quoting to be used,
while still avoiding running a shell (and this having shell expansion
problems)
2010-02-26 18:19:27 +11:00
Brad Hards
dd89dc2c31 Spelling fixes for libutil
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:35 +01:00
Andrew Tridgell
8756e13009 util: added samba_runcmd()
This allows us to run a child command in an async fashion, with
control over logging of stdout and stderr (which appears in the Samba
log file). This is useful for ensuring we don't miss important
messages from rndc commands (for example).

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-17 19:43:32 +11:00