summaryrefslogtreecommitdiff
path: root/lib/util
AgeCommit message (Collapse)AuthorFilesLines
2012-07-18talloc_stack: abort in developer me if no stackframe on talloc_tos()Rusty Russell2-4/+9
Don't tolerate leaks in developer mode. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell1-1/+1
They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18lib/util/modules.c: fix stackframe leak.Rusty Russell1-1/+2
do_smb_load_module() doesn't free its stackframe on success. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18talloc_stack: report lazy freeing (panic if DEVELOPER).Rusty Russell1-0/+11
talloc_stackframe() stacks, so if you forget to free one, the outer one will free it. However, it's not a good idea to rely too heavily on this behaviour: it can lead to delays in the release of memory or destructors. I had an elaborate hack to make sure every talloc_stackframe() was freed in the exact same function it was allocated, however all bugs it caught were simply lazy freeing, so this patch just checks for that. This doesn't check for stackframes we don't free up on exit: that would be nice, but uncovers some uncomfortable (but probably harmless) cases. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18talloc_stack: always include the location when creating a talloc_stackframe().Rusty Russell2-8/+11
Much better for debugging. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18talloc_stack: handle more than one talloc_stackframe_pool()Rusty Russell1-8/+9
The only reason we make one stackframe parent of the next is so we use our parent's pool. That doesn't make sense if we're a new pool, and wouldn't work anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-13lib/util: Allocate enough space to reference blob->data[len]Andrew Bartlett1-3/+3
Found by Thomas Hood <jdthood@gmail.com> using valgrind. Thanks! Andrew Bartlett
2012-07-04ntdb: make --disable-ntdb work properly.Rusty Russell1-6/+7
As per bug #9024, make --disable-ntdb work again. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date(master): Wed Jul 4 08:11:33 CEST 2012 on sn-devel-104
2012-07-02Ensure we select the correct syscall numbers on a 32-bit Linux system.Jeremy Allison1-0/+46
2012-06-30Try and fix the autoconf build on Solaris/Nexenta/etc.Jeremy Allison1-1/+32
Their AC_TRY_RUN doesn't include any current CPPFLAGS. Make the set[res]uid checks independent of this. Needs a small change to the waf build in order to code with the change. Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Jun 30 00:32:36 CEST 2012 on sn-devel-104
2012-06-29lib/util: fix fd leak in anonymous_shared_allocate() if MAP_ANON is not ↵Stefan Metzmacher1-1/+14
available metze
2012-06-29Move back to using per-thread credentials on Linux. Fixes the glibc native ↵Jeremy Allison1-9/+41
AIO lost wakeup problem. See this post: https://lists.samba.org/archive/samba-technical/2012-June/085101.html for details. Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jun 29 03:57:45 CEST 2012 on sn-devel-104
2012-06-28Replace all uses of setXX[ug]id() and setgroups with samba_setXX[ug]id() calls.Jeremy Allison4-3/+234
Will allow thread-specific credentials to be added by modifying the central definitions. Deliberately left the setXX[ug]id() call in popt as this is not used in Samba.
2012-06-22util_tdb: move timeout chainlock variants from source3/lib/util/util_tdb.cRusty Russell3-1/+98
We're about to use them for dbwrap. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22util: util_ntdb ntdb_fetch_int32/ntdb_store_int32 and ntdb_add_int32_atomicRusty Russell2-0/+89
Similar to the util_tdb versions, but return the error code. ntdb_add_int32_atomic seems a clearer name than tdb_change_int32_atomic. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22util: util_ntdb.c gets NTDB_ERROR => NTSTATUS map.Rusty Russell2-0/+49
Very similar to the tdb version. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22util: util_ntdb.c gains bystring functions.Rusty Russell2-1/+85
Very similar to the util_tdb versions, but these return the error. I've only implemented those functions actually used. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22util: ntdb_new() supports NTDB_CLEAR_IF_FIRST.Rusty Russell2-1/+99
There are various issues with NTDB_CLEAR_IF_FIRST which makes it better if we don't have to use it, but much of the code does, so we fake up support here. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22util: util_ntdb.cRusty Russell3-0/+168
The first function is ntdb_new: this is preferred over ntdb_open, as it makes the ntdb_context returned (and all NTDB_DATA returned from ntdb_fetch) valid talloc pointers. The API is very similar to tdb_wrap_open(). Note that we handle $TDB_NO_FSYNC here, since ntdb doesn't do that hack (and it's great for speeding up testing!). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19lib/util_tdb: depend directly on tdb, not tdb_compat.Rusty Russell2-5/+5
Simple change, as we get rid of tdb_compat in favour of tdb directly. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19TDB2: make SAMBA use tdb1 again for the moment.Rusty Russell1-4/+0
Otherwise the following surgery will break the SAMBA build and testsuite. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-15lib/util: Fix typo in comment.Jelmer Vernooij1-1/+1
2012-06-12lib/util: fix use of a non-existent word (existant) in a commentMichael Adam1-1/+1
2012-06-11debug: Do not constantly rename logs when max log size = 0Andrew Bartlett1-16/+18
In Samba4, the max log size parameter is not yet connected, so maxlog is 0 This means that we would, on receipt of a -HUP, have all child processes attempt a rename. Now we have the -HUP mean we reopen the logs unconditionally, and then we see if the log is too large (samba3 mode) or simply proceed assuming that someone else has renamed the logs for us. Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Jun 11 13:34:43 CEST 2012 on sn-devel-104
2012-06-08samba_util: mark smb_panic as _NORETURN_.Rusty Russell1-1/+1
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date(master): Fri Jun 8 09:14:26 CEST 2012 on sn-devel-104
2012-06-07util: fix build on platforms without IPv6 supportBjörn Jacke1-1/+1
something like this on World IPv6 Day II ... ;-) Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Thu Jun 7 03:09:49 CEST 2012 on sn-devel-104
2012-06-02lib/replace: Merge remaining xattr test details from lib/utilAndrew Bartlett1-8/+0
I prefer the longer XATTR_ADDITIONAL_OPTIONS define and the NULL rather than 0 values in the getxattr test. Andrew Bartlett
2012-06-02s4-xattr: Use libreplace xattr functions directlyAndrew Bartlett4-167/+0
2012-06-01Remove an unused variable.Jeremy Allison1-3/+1
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Jun 1 03:03:12 CEST 2012 on sn-devel-104
2012-05-30lib: add tevent_req_poll_werrorVolker Lendecke2-0/+16
Signed-off-by: Kai Blin <kai@samba.org>
2012-05-14lib/util: move tevent_req_poll_ntstatus() to tevent_ntstatus.cStefan Metzmacher2-0/+16
metze
2012-05-14lib/util: add missing 'errors' dependency to 'tevent-util'Stefan Metzmacher1-1/+1
metze
2012-05-11util: use SMB_ASSERT with panic also in non-developer builds !!!Michael Adam1-7/+0
This has been around since a long time: In non-developer builds, we don't panic in SMB_ASSERT but happly continue with the error condition, which is ridiculous and dangerous...
2012-05-11util: reformat the DEVELOPER definition of SMB_ASSERTMichael Adam1-3/+8
2012-05-08lib/util: Map 0x7fffffffffffffffLL as 0x7fffffffffffffffLL in time conversionAndrew Bartlett1-1/+1
TIME_T_MAX is not actually INT64_MAX at the moment, so check both values and set to the magic end-of-time value. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue May 8 06:41:43 CEST 2012 on sn-devel-104
2012-05-03UTIL_TDB: lowercase name.Jelmer Vernooij1-2/+2
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Thu May 3 20:18:22 CEST 2012 on sn-devel-104
2012-04-20Fix bug #8877 - Syslog broken owing to mistyping of debug_settings.syslog.Joseph Tam1-1/+1
Setting "syslog only = yes" did not divert log messages to syslog. The test in lib/util/debug.c:Debug1():747 if( syslog_level < state.settings.syslog ) produces wrong results since .syslog is typed "bool" rather than "int". The attached patch fixes this by typing this field correctly as "int". Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Apr 20 00:06:12 CEST 2012 on sn-devel-104
2012-04-18lib/util: Move map_nt_error_from_tdb to the top levelAndrew Bartlett2-1/+70
This will help with making dbwrap available as a top level library. Andrew Bartlett
2012-04-05build: Remove sys_open wrapperAndrew Bartlett1-1/+1
2012-04-05build: do not use HAVE_EXPLICIT_LARGEFILE_SUPPORT and *64() fucntions any moreAndrew Bartlett1-6/+1
2012-04-05build: Remove configure tests for *64 functions and typesAndrew Bartlett1-5/+0
We now use the standard types only. Andrew Bartlett
2012-04-03lib/util: charset modules do not exist any moreAndrew Bartlett1-4/+0
Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Apr 3 08:07:42 CEST 2012 on sn-devel-104
2012-04-03lib/util: Add smb_load_module that returns DEBUG(0) errors on failureAndrew Bartlett2-38/+39
These errors are very important when trying to work out why a module does not load, and this rework allows them to be shown when loading vfs modules. Andrew Bartlett
2012-03-31Fix an IPv6 breakage I introduced by adding an strlcpy truncation check. ↵Jeremy Allison1-3/+10
Found by Matthieu Patou <mat@samba.org>. The truncate of the strlcpy() here was a *desired* side effect. strlcpy()/strlcat() should never be used like that. Be more explicit about the truncation and don't use strlcpy here. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Mar 31 07:59:16 CEST 2012 on sn-devel-104
2012-03-29Start to add truncate checks on all uses of strlcpy(). Reading lwnJeremy Allison2-22/+29
has it's uses :-). Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Mar 29 20:48:15 CEST 2012 on sn-devel-104
2012-03-24lib/util: Remove obsolete sys_getpid() and sys_fork().Jelmer Vernooij4-43/+2
The performance of these is minimal (these days) and they can return invalid results when used as part of applications that do not use sys_fork(). Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Mar 24 21:55:41 CET 2012 on sn-devel-104
2012-03-24lib/util: Allow calloc use in util.c, too.Jelmer Vernooij1-0/+1
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Mar 24 18:50:32 CET 2012 on sn-devel-104
2012-03-24libreplace: Add getpeereid implementation.Jelmer Vernooij2-31/+0
2012-03-24lib/util: Remove dummy wrapper for getgrgid().Jelmer Vernooij2-10/+0
2012-03-24lib/util: Remove dummy wrapper for getgrnam().Jelmer Vernooij2-7/+1