summaryrefslogtreecommitdiffstats
path: root/lib/util
Commit message (Collapse)AuthorAgeFilesLines
...
* lib/util: allow parmlist.c to compile under s3 includes.hAndrew Bartlett2011-06-211-0/+2
|
* lib/util: Use common d_printf() in the whole codebaseAndrew Bartlett2011-06-213-26/+25
| | | | | | | | | 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
* lib/util Make unused d_vfprintf() staticAndrew Bartlett2011-06-212-2/+1
|
* tdb_compat: Higher level API fixes.Rusty Russell2011-06-202-6/+6
| | | | | | | | | | | | My previous patches fixed up all direct TDB callers, but there are a few utility functions and the db_context functions which are still using the old -1 / 0 return codes. It's clearer to fix up all the callers of these too, so everywhere is consistent: non-zero means an error. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_compat: use tdb_open_compat.Rusty Russell2011-06-201-5/+28
| | | | | | | | | This is a helper for the common case of opening a tdb with a logging function, but it doesn't do all the work, since TDB1 and TDB2's log functions are different types. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_store: check returns for 0, not -1.Rusty Russell2011-06-202-12/+12
| | | | | | | | TDB2 returns a negative error number on failure. This is compatible if we always check for != 0 instead of == -1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_delete: check returns for 0, not -1.Rusty Russell2011-06-201-1/+1
| | | | | | | | TDB2 returns a negative error number on failure. This is compatible if we always check for != 0 instead of == -1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_fetch_compat: use instead of tdb_fetch.Rusty Russell2011-06-201-3/+3
| | | | | | | This is a noop for tdb1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_compat.h: divert every tdb build and includes to tdb_compatRusty Russell2011-06-204-6/+4
| | | | | | | | We change all the headers and wscript files to use tdb_compat; this means we have one place to decide whether to use TDB1 or TDB2. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* talloc: added talloc_stackframe_exists()Andrew Tridgell2011-06-172-0/+25
| | | | | | | | | This can be used to tell if a talloc stackframe is currently available. Callers can use this to decide if they will use talloc_tos() or instead use an alternative strategy. This gives us a way to safely have calls to talloc_tos() in common code that may end up in external libraries, as long as all talloc_tos() calls in these pieces of common code check first that a stackframe is available.
* s3-param Remove 'time offset' from smb.confAndrew Bartlett2011-06-113-24/+1
| | | | | | | | | | This strange parameter is apparently very rarely used, and it seems to me that on modern networks, if clients don't have correct clocks and DST offsets, that many other things (Kerberos) start to fail pretty quickly, and time and DST tables tend to be internet delivered anyway. Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Sat Jun 11 03:54:45 CEST 2011 on sn-devel-104
* lib/util/wrap_xattr.h: fix licence/copyrightGünther Deschner2011-06-101-0/+21
| | | | Guenther
* lib/util/util_tdb.h: fix licence/copyrightGünther Deschner2011-06-101-0/+21
| | | | Guenther
* lib/util/util_ldb.h: fix licence/copyrightGünther Deschner2011-06-101-0/+23
| | | | Guenther
* lib/util/time.h: fix licence/copyrightGünther Deschner2011-06-101-1/+6
| | | | Guenther
* lib/util/data_blob.h: fix licence/copyrightGünther Deschner2011-06-101-1/+4
| | | | Guenther
* server_id: Change format to vnn:pid.task_id, pid.task_id or pidAndrew Bartlett2011-06-091-1/+6
| | | | | | | | | | | This helps ensure the string cannot be ambiguous, while also ensuring that it remains simple in the non-cluster case. The asymmetry of reading get_my_vnn() but writing based on NONCLUSTER_VNN is acceptable because in the non-clustered case, they are equal, and in the clustered case we will print the full string. Andrew Bartlett
* lib/util Bring procid_str() into lib/util as server_id_string()Andrew Bartlett2011-06-093-1/+40
| | | | | | | This is needed for OpenChange, which prints Samba struct server_id values in debug messages. Andrew Bartlett
* lib/util use modules_path(), data_path() and shlib_ext() from source3Andrew Bartlett2011-06-063-1/+90
| | | | | | | | | | 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
* util-net: added is_ipaddress_v6()Andrew Tridgell2011-06-062-3/+13
|
* ipv6: always try to convert as a numeric address firstAndrew Tridgell2011-06-061-0/+9
| | | | | This avoids unnecessary name lookups, plus it fixes a problem with using interpret_string_addr*() with the wildcard IPv6 address
* Fix warning messages on Freebsd 4.6.2.Herb Lewis2011-06-021-0/+2
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* lib/util/time.c: timeval_current_ofs_usecRusty Russell2011-06-012-0/+14
| | | | | | | | | | | | | | | Several places want "microseconds from current time", and several were simply handing "usecs" values which could be over a million. Using a helper to do this is safer and more readable. I didn't replace any obviously correct callers (ie. constants). I also renamed wait_nsec in source3/lib/util_sock.c; it's actually microseconds not nanoseconds (introduced with this code in Volker's 19b783cc Async wrapper for open_socket_out_send/recv). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* lib/util/time.c: timeval_current_ofs_msecRusty Russell2011-06-012-0/+14
| | | | | | | | | | Several places want "milliseconds from current time", and several were simply doing "msec * 1000" which can (and does in one place) result in a usec value over 1 a million. Using a helper to do this is safer and more readable. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* lib/util Move sys_memalign into lib/util/system.cAndrew Bartlett2011-05-312-0/+41
|
* Fix numerous missing dependencies in WAF build scriptsSean Finney2011-05-252-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the recent consolidation of code between s3 and s4, a number of new dependencies have been implicitly introduced. For example, previous s3 code gained an implicit dependency on talloc after the charset related consolidation (lib/util/charset/charset.h now includes talloc.h). When building against the embedded version of talloc this isn't a problem since the paths are automatically added to the search path, but when building against the external libraries build failures will occur for all components that don't directly or indirectly include talloc as a dependency. Since charset.h is included from util.h, which in turn is included from includes.h, this means most of the codebase (s3 and s4) has such an undeclared dependency. Therefore, samba-util-common and samba-util have been added as dependencies to the s3 and s4 code respectively, for all cases where the source would otherwise fail to build. Additionally, a few other dependencies are added in specific wscript_build files to address similar dependency-related problems. https://bugzilla.samba.org/show_bug.cgi?id=8128 Signed-off-by: Sean Finney <seanius@seanius.net> Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Wed May 25 19:22:13 CEST 2011 on sn-devel-104
* Fix our asn.1 parser to handle negative numbers.Jeremy Allison2011-05-241-0/+9
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue May 24 22:57:16 CEST 2011 on sn-devel-104
* lib/util Add Volker's asn1_Integer test into code that runs in 'make test'Andrew Bartlett2011-05-241-0/+94
| | | | | | | The comfychair test harness isn't hooked up, and with the current infrustructure C code is better tested directly here. Andrew Bartlett
* lib/util/charset: Remove unused strcasecmp_w and strncasecmp_wAndrew Bartlett2011-05-181-32/+0
| | | | | Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed May 18 17:22:15 CEST 2011 on sn-devel-104
* lib/util/charset use talloc_stackframe() rather than talloc_tos()Andrew Bartlett2011-05-181-12/+12
| | | | | | | This is common code, and we can't assume a talloc_stackframe() so we must create it. Andrew Bartlett
* lib/util/charset Don't allow invalid 'dos charset = utf8'Andrew Bartlett2011-05-181-0/+5
| | | | | | | No DOS client used UTF8, and this creates subtle, difficult to disagnose breakage of schannel (domain membership). Andrew Bartlett
* Don't evaluate the src argument to fstrcpy/fstrcat/nstrcpy/unstrcpy twice. ↵Jeremy Allison2011-05-171-5/+25
| | | | Prevents side-effects when src is a function call.
* lib/util/charset: fix the toplevel MacOS X build.Günther Deschner2011-05-171-2/+3
| | | | | | | Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Tue May 17 16:16:59 CEST 2011 on sn-devel-104
* Use ZERO_STRUCTP in util_netVolker Lendecke2011-05-141-2/+2
|
* lib/util/charset Move built-in charset modules to the top levelAndrew Bartlett2011-05-136-1/+1028
| | | | | | | This removes the 'charset' subsystem and allows these modules to be used across the whole of Samba. Andrew Bartlett
* lib/util/ Fix crash bug caused by gfree_debug()Andrew Bartlett2011-05-131-1/+1
| | | | | | | The issue is that we should reset the debug_num_classes to 0 when we un-initialise the debug system. Andrew Bartlett
* tdb_wrap.h: not a public header.Rusty Russell2011-05-101-1/+0
| | | | | | | | | | It is a private library, and OpenChange has their own which they use, so it's not for them either. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User: Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date: Tue May 10 05:21:19 CEST 2011 on sn-devel-104
* Improve debug messages when creating socket directoriesAndrew Bartlett2011-05-081-1/+2
| | | | | | This makes clear what the permissions error and directory name actually is Andrew Bartlett
* lib/util don't use enum protocol_types in ms_fnmatch_protocolAndrew Bartlett2011-05-062-2/+2
| | | | | | | | | | 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
* lib/util Use lib/util/ms_fnmatch.c in common for gen_fnmatch()Andrew Bartlett2011-05-061-2/+2
| | | | | | | | | gen_fnmatch was a duplicate symbol in the top level build. gen_fnmatch() used for simple non-CIFS pattern matching, so selecting the lib/util implementation should not be a concern. Andrew Bartlett
* lib/util Rename ms_fnmatch() to ms_fnmatch_protocol() to avoid dup symbolAndrew Bartlett2011-05-062-5/+6
| | | | | | | This verison of the function takes a protcol as argument to determine matching rules. Andrew Bartlett
* lib/util Move source3 tdb_wrap_open() into the common code.Andrew Bartlett2011-05-064-1/+246
| | | | | | | | | This #if _SAMBA_BUILD == 3 is very unfortunate, as it means that in the top level build, these options are not available for these databases. However, having two different tdb_wrap lists is a worse fate, so this will do for now. Andrew Bartlett
* Fix many const compiler warnings.Jeremy Allison2011-05-052-4/+4
|
* Clean up some const and other compiler warnings.Jeremy Allison2011-05-053-7/+7
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu May 5 00:59:40 CEST 2011 on sn-devel-104
* I added them, so I get to kill them :-). Finally remove all uses of ↵Jeremy Allison2011-05-043-99/+0
| | | | | | | 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
* Tidy up some missing checks for NULL in strlcpy.Jeremy Allison2011-05-041-1/+1
|
* Remove overmalloc_safe_strcpy - can be simple strlcpy.Jeremy Allison2011-05-041-8/+0
|
* Change safe_strcpy_base to strlcpy_base. Note the size doesn't change here ↵Jeremy Allison2011-05-041-2/+2
| | | | as the original macro auto-added the -1.
* Fix simple uses of safe_strcpy -> strlcpy. Easy ones where we just remove -1.Jeremy Allison2011-05-043-10/+10
|
* lib/util make string_wrappers.h a public headerAndrew Bartlett2011-05-031-1/+1
| | | | | | | | | | This isn't a very good public header, but util.h includes it, so we don't have much choice in the short term. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue May 3 08:37:22 CEST 2011 on sn-devel-104