summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2009-07-31util/asn1: fix potential memory leak in asn1_write_OID()Stefan Metzmacher1-0/+1
metze
2009-07-31tdb: don't alter tdb->flags in tdb_reopen_all()Rusty Russell1-6/+13
The flags are user-visible, via tdb_get_flags/add_flags/remove_flags. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-07-31tdb: Reimplementation of Metze's "lib/tdb: if we know pwrite and pread are ↵Rusty Russell1-5/+10
thread/fork safe tdb_reopen_all() should be a noop". This version just wraps the reopen code, so we still re-grab the lock and do the normal sanity checks. The reason we do this at all is to avoid global fd limits, see: http://forums.fedoraforum.org/showthread.php?t=210393 Note also that this whole reopen concept is fundamentally racy: if the parent goes away before the child calls tdb_reopen_all, the database can be left without an active lock and another TDB_CLEAR_IF_FIRST opener will clear it. A fork_with_tdbs() wrapper could use a pipe to solve this, but it's hardly elegant (what if there are other independent things which have similar needs?). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-07-31tdb: Revert "lib/tdb: if we know pwrite and pread are thread/fork safe ↵Rusty Russell1-5/+0
tdb_reopen_all() should be a noop" This reverts commit e17df483fbedb81aededdef5fbb6ae1d034bc2dd. tdb_reopen_all also restores the active lock, required for TDB_CLEAR_IF_FIRST. Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-07-30realloc() has that horrible overloaded free semantic when size is 0:Rusty Russell1-2/+7
current code does a free of the old record in this case, then fail.
2009-07-30If the record is at the end of the database, pretending it has length 1Rusty Russell1-4/+1
might take us out-of-bounds. Only pretend to be length 1 for the malloc.
2009-07-30DCE/RPC(Python): Rename py_talloc_import to py_talloc_steal.Jelmer Vernooij2-7/+8
Use py_talloc_reference in DCE/RPC code, fixes access to SAMR pipe.
2009-07-25No explicit initialization necessary for a zero blobVolker Lendecke1-3/+1
2009-07-21tdb: fix locking errorRusty Russell1-1/+1
54a51839ea65aa788b18fce8de0ae4f9ba63e4e7 "Make tdb transaction lock recursive (samba version)" was broken: I "cleaned it up" and prevented it from ever unlocking. To see the problem: $ bin/tdbtorture -s 1248142523 tdb_brlock failed (fd=3) at offset 8 rw_type=1 lck_type=14 len=1 tdb_transaction_lock: failed to get transaction lock tdb_transaction_start failed: Resource deadlock avoided My testcase relied on the *count* being correct, which it was. Fixing that now. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Michael Adam <obnox@samba.org>
2009-07-20lib util: Fix const warningTim Prouty1-1/+1
2009-07-20Make tdb transaction lock recursive (samba version)Rusty Russell3-21/+20
This patch replaces 6ed27edbcd3ba1893636a8072c8d7a621437daf7 and 1a416ff13ca7786f2e8d24c66addf00883e9cb12, which fixed the bug where traversals inside transactions would release the transaction lock early. This solution is more general, and solves the more minor symptom that nested traversals would also release the transaction lock early. (It was also suggestd in Volker's comment in 6ed27ed). This patch also applies to ctdb, if the traverse.c part is removed (ctdb's tdb code never received the previous two fixes). Tested using the testsuite from ccan (adapted to the samba code). Thanks to Michael Adam for feedback. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Michael Adam <obnox@samba.org>
2009-07-19Remove unused parameter setting.Jelmer Vernooij2-11/+0
2009-07-19lib/util/util_file.c(file_save): fixed file descriptor leak when read(2) fails.Slava Semushin1-0/+1
Found by cppcheck: [./lib/util/util_file.c:383]: (error) Resource leak: fd
2009-07-19Fix broken password quality checkMatthieu Patou2-1/+4
This fixes broken password tests when the passwords contain non ASCII characters (e.g. accentuated chars like ('e, `e, ...)
2009-07-19include unix.h if it's availableMatt Kraai2-0/+5
2009-07-16tevent: try to fix the build on QNX qnx18 6.4.1 it doesn't have SA_RESTART ↵Stefan Metzmacher1-1/+11
defined metze
2009-07-16tsocket: rename sa_len => sa_socklen, because sa_len is a macro on some ↵Stefan Metzmacher1-21/+21
platforms metze
2009-07-14Change to talloc_zero_size instead of extra memset.Jeremy Allison1-2/+1
Jeremy.
2009-07-14When tallocing a memory block for the state in a tevent_req struct,Jeremy Allison1-0/+1
ensure it's zeroed out. Vl & Metze please check. Jeremy.
2009-07-05libreplace: update library search path variablesBjörn Jacke1-1/+4
2009-07-04Fix some warningsVolker Lendecke1-2/+3
2009-07-03tdb: fix define of tdbdir when srcdir != "."Björn Jacke1-2/+2
2009-07-03Sort the signature filesSimo Sorce4-89/+89
2009-07-03Expose functions need by backend writersSimo Sorce5-52/+67
move publicly needed structures and functions in the public header. Stop installing internal headers. Update the signature and exports files with the new exposed function.
2009-07-03Restore ABI compatibility for talloc.Simo Sorce6-60/+106
2009-07-02talloc: change TALLOC_MAGIC for version 2.0.0Stefan Metzmacher1-1/+12
metze
2009-07-02change talloc to 2.0.0Andrew Tridgell1-1/+1
This is needed to prevent samba3 and samba4 from using an ABI incompatible system version of talloc See ongoing discussion on the samba-technical mailing list
2009-07-01lib/util: fix order of includes in tevent_ntstatus.cMichael Adam1-1/+1
replace.h needs to be included first. Michael
2009-07-01fixed the talloc testsuite for the recent changesAndrew Tridgell1-6/+10
2009-07-01a talloc_realloc() to zero size needs to use an unambiguous freeAndrew Tridgell1-1/+1
2009-07-01changes to remove the ambiguity in talloc_free() and talloc_steal() Andrew Tridgell2-26/+109
These changes follow from the discussions on samba-technical. The changes are in several parts, and stem from the inherent ambiguity that was in talloc_free() and talloc_steal() when the pointer that is being changes has more than one parent, via references. The changes are: 1) when you call talloc_free() on a pointer with more than one parent the free will fail, and talloc will log an error to stderr like this: ERROR: talloc_free with references at some/foo.c:123 reference at other/bar.c:201 reference at other/foobar.c:641 2) Similarly, when you call talloc_steal() on a pointer with more than one parent, the steal will fail and talloc will log an error to stderr like this: ERROR: talloc_steal with references at some/foo.c:123 reference at other/bar.c:201 3) A new function talloc_reparent() has been added to change a parent in a controlled fashion. You need to supply both the old parent and the new parent. It handles the case whether either the old parent was a normal parent or a reference The use of stderr in the logging is ugly (and potentially dangerous), and will be removed in a future patch. We'll need to add a debug registration function to talloc.
2009-07-01fixed use of reference in pytallocAndrew Tridgell2-3/+24
The previous code caused memory leaks, and also caused situations where talloc_free could be called on pointers with multiple parents The new approach is to have two functions: py_talloc_import : steals the pointer, so it becomes wholly owned by the python object py_talloc_reference: uses a reference, so it is owned by both python and C
2009-06-29lib/util: fix building tevent_ntstatus without config.hMichael Adam1-1/+0
(when called from places with "#define NO_CONFIG_H" set, such as configure) Michael
2009-06-29tsocket/bsd: also ask for TEVENT_FD_READ when we want to write into a stream ↵Stefan Metzmacher1-2/+9
socket Otherwise we would not notice a broken connection. metze
2009-06-29tsocket/bsd: more correctly check if the cached tevent_fd is still validStefan Metzmacher1-4/+12
I some cases the pointer value of tevent_context is the same again, if we do something like: ev1 = tevent_context_init(); ... fde = tevent_add_fd(ev1, fd, TEVENT_FD_READ...); ... talloc_free(ev1); ... ev2 = tevent_context_init(); if (ev1 == ev2) { /* this can happen! */ } if (tevent_fd_get_flags(fde) == 0) { /* this is always true */ } But the "talloc_free(ev1)" will set fde->event_ctx to NULL and tevent_fd_get_flags() will always return 0. metze
2009-06-29Fix ndrdump to use a common setup_logging() APIAndrew Bartlett2-1/+18
By adding a new common setup_logging_stdout() API, we no longer need to abuse the ABI compatability between the different setup_logging() calls in Samba3 and Samba4's DEBUG() subsystems. The revert of 49a6d757b4d944cd22c91b2838beb83f04fbe1e9 works with this to fix bug 6211. Andrew Bartlett
2009-06-29Revert "s4:debug: make setup_logging() a bit more compatible with samba3"Andrew Bartlett1-1/+1
The problem is that the enum was previously a 'rachet', that is, it would only reset to a level higher than it was previouly set to. Changing the order broke file-based logging for our production sites. This reverts commit 49a6d757b4d944cd22c91b2838beb83f04fbe1e9.
2009-06-29Two patches which fix issues on cross compiling/buildingNathaniel McCallum1-1/+1
2009-06-27Properly free a downlevel readv request. Metze, please checkVolker Lendecke1-0/+1
2009-06-20Move asn1_load_nocopy() to lib/util/asn1.cVolker Lendecke2-0/+11
2009-06-20Move asn1_blob() to lib/util/asn1.cVolker Lendecke2-0/+17
2009-06-19Partially revert restriction of socket_wrapper to 1500 byte writesAndrew Bartlett1-10/+32
This keeps the restriction for stream sockets (where the caller will retry), without creating problems on datagram sockets (CLDAP is not defined, as far as I know, across multiple UDP packets). The commit adding this restriction was 47b106c0ae8b91c9cccfc21bf8e4e416b1abfd5d Andrew Bartlett
2009-06-18Revert "For tevent to install tevent_util.h"Simo Sorce1-1/+0
This reverts commit b112cc5503350b248949bdbcce8072f5523ce877. tevent_util.h is a private header. Must not be installed.
2009-06-18For tevent to install tevent_util.hEric Sandall1-0/+1
Patch for bug #6270 This patch is for the future when samba4 builds using external libraries. With this patch, tevent now installs tevent_util.h which is required by samba4.
2009-06-18s4: Call va_end() after all va_start()/va_copy() calls.Andrew Kroeger1-0/+2
This corrects the issues reaised in bug #6129, and some others that were not originally identified. It also accounts for some code that was in the original bug report but appears to have since been made common between S3 and S4. Thanks to Erik Hovland <erik@hovland.org> for the original bug report.
2009-06-17tdb: Fix help string in configure flag to enable Python bindings.Jelmer Vernooij1-1/+1
2009-06-17fix release scripts to always git cleanSimo Sorce2-0/+6
This makes sure we do not include foreign object files or other build byproducts by mistake.
2009-06-15Add exports file and abi checker for teventSimo Sorce7-2/+157
This is a first attempt at exporting symbols only for public functions We also provide a rudimentary ABI checker that tries to check that function signatures are not changed by mistake. Given our use of macros this is not an API checker. It's all based on tevent.h contents and the gcc -aux-info option
2009-06-15Add exports file and abi checker for tallocSimo Sorce8-9/+169
This is a first attempt at exporting symbols only for public functions We also provide a rudimentary ABI checker that tries to check that function signatures are not changed by mistake. Given our use of macros this is not an API checker. It's all based on talloc.h contents and the gcc -aux-info option
2009-06-15Add exports file and abi checker for tdbSimo Sorce7-3/+172
This is a first attempt at exporting symbols only for public functions We also provide a rudimentary ABI checker that tries to check that function signatures are not changed by mistake. Given our use of macros this is not an API checker. It's all based on tdb.h contents and the gcc -aux-info option