summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* talloc: let talloc_total_blocks() and talloc_get_size() operate on the ↵Stefan Metzmacher2009-08-241-2/+15
| | | | | | null_context metze
* Fix for bug 6651 - smbd SIGSEGV when breaking oplocks.Jeremy Allison2009-08-211-17/+54
| | | | | | | Based on a patch submitted by Petr Vandrovec <petr@vandrovec.name>. Multiple pending signals with siginfo_t's weren't being handled correctly leading to smbd abort with kernel oplock signals. Jeremy
* tevent: fix a commentMichael Adam2009-08-191-1/+1
| | | | Michael
* tevent: change version to 0.9.7 after adding tevent_req_cancel infrastructureStefan Metzmacher2009-08-171-1/+1
| | | | metze
* tevent: add tevent_req_cancel() infrastructureStefan Metzmacher2009-08-173-0/+70
| | | | | | | This offers a generic way for callers to cancel an async request. metze
* tevent: add some more doxygen comments for tevent_req functionsStefan Metzmacher2009-08-151-0/+38
| | | | metze
* libreplace: undef AI_ADDRCONFIG on QNX 6.3.0 (fix bug #6630)Matt Kraai2009-08-121-0/+14
| | | | | | | | | | | Some of the functions in source3/lib/util_sock.c use AI_ADDRCONFIG. On QNX 6.3.0, this macro is defined but, if it's used, getaddrinfo will fail. This prevents smbd from opening any sockets. If I undefine AI_ADDRCONFIG on such systems and allow lib/replace/system/network.h to define it to be 0, this works around the issue. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* Rename ASN1_BITFIELD to ASN1_BIT_STRING.Kouhei Sutou2009-08-111-1/+1
| | | | X.690 uses "BIT STRING" not "BIT FIELD".
* libreplace: set SONAMEFLAG to "-Wl,-soname=" on QNXMatt Kraai2009-08-081-1/+1
|
* Add define guards around otherwise unused variable.Jeremy Allison2009-08-061-0/+3
| | | | Jeremy.
* There is one signedness issue in tdb which prevents traverses of TDB recordsRusty Russell2009-08-061-9/+21
| | | | | | | | | | | over the 2G offset on systems which support 64 bit file offsets. This fixes that case. On systems with 32 bit offsets, expansion and fcntl locking on these records will fail anyway. SAMBA already does '#define _FILE_OFFSET_BITS 64' in config.h (on my 32-bit x86 Linux system at least) to get 64 bit file offsets. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* fixed a uid_wrapper bug that caused a segv in the RAW-ACLS testAndrew Tridgell2009-08-051-8/+15
|
* make the UID_WRAPPER skip checks at runtimeAndrew Tridgell2009-08-054-5/+17
| | | | | | | This fixes two issues pointed out by Andrew. It adds a runtime uwrap_enabled() call that wraps the skips needed for uid emulation. It also makes the skip in the directory_create_or_exist() function only change the uid checking code, not the permissions code
* added a uid_wrapper libraryAndrew Tridgell2009-08-056-0/+236
| | | | | | | | | | | | | | | | | | | | This library intercepts seteuid and related calls, and simulates them in a manner similar to the nss_wrapper and socket_wrapper libraries. This allows us to enable the vfs_unixuid NTVFS module in the build farm, which means we are more likely to catch errors in the token manipulation. The simulation is not complete, but it is enough for Samba4 for now. The major areas of incompleteness are: - no emulation of setreuid, setresuid or saved uids. These would be needed for use in Samba3 - no emulation of ruid changing. That would also be needed for Samba3 - no attempt to emulate file ownership changing, so code that (for example) tests whether st.st_uid matches geteuid() needs special handling
* util/asn1: fix potential memory leak in asn1_write_OID()Stefan Metzmacher2009-07-311-0/+1
| | | | metze
* tdb: don't alter tdb->flags in tdb_reopen_all()Rusty Russell2009-07-311-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>
* tdb: Reimplementation of Metze's "lib/tdb: if we know pwrite and pread are ↵Rusty Russell2009-07-311-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>
* tdb: Revert "lib/tdb: if we know pwrite and pread are thread/fork safe ↵Rusty Russell2009-07-311-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>
* realloc() has that horrible overloaded free semantic when size is 0:Rusty Russell2009-07-301-2/+7
| | | | current code does a free of the old record in this case, then fail.
* If the record is at the end of the database, pretending it has length 1Rusty Russell2009-07-301-4/+1
| | | | might take us out-of-bounds. Only pretend to be length 1 for the malloc.
* DCE/RPC(Python): Rename py_talloc_import to py_talloc_steal.Jelmer Vernooij2009-07-302-7/+8
| | | | | Use py_talloc_reference in DCE/RPC code, fixes access to SAMR pipe.
* No explicit initialization necessary for a zero blobVolker Lendecke2009-07-251-3/+1
|
* tdb: fix locking errorRusty Russell2009-07-211-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>
* lib util: Fix const warningTim Prouty2009-07-201-1/+1
|
* Make tdb transaction lock recursive (samba version)Rusty Russell2009-07-203-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>
* Remove unused parameter setting.Jelmer Vernooij2009-07-192-11/+0
|
* lib/util/util_file.c(file_save): fixed file descriptor leak when read(2) fails.Slava Semushin2009-07-191-0/+1
| | | | | Found by cppcheck: [./lib/util/util_file.c:383]: (error) Resource leak: fd
* Fix broken password quality checkMatthieu Patou2009-07-192-1/+4
| | | | | This fixes broken password tests when the passwords contain non ASCII characters (e.g. accentuated chars like ('e, `e, ...)
* include unix.h if it's availableMatt Kraai2009-07-192-0/+5
|
* tevent: try to fix the build on QNX qnx18 6.4.1 it doesn't have SA_RESTART ↵Stefan Metzmacher2009-07-161-1/+11
| | | | | | defined metze
* tsocket: rename sa_len => sa_socklen, because sa_len is a macro on some ↵Stefan Metzmacher2009-07-161-21/+21
| | | | | | platforms metze
* Change to talloc_zero_size instead of extra memset.Jeremy Allison2009-07-141-2/+1
| | | | Jeremy.
* When tallocing a memory block for the state in a tevent_req struct,Jeremy Allison2009-07-141-0/+1
| | | | | ensure it's zeroed out. Vl & Metze please check. Jeremy.
* libreplace: update library search path variablesBjörn Jacke2009-07-051-1/+4
|
* Fix some warningsVolker Lendecke2009-07-041-2/+3
|
* tdb: fix define of tdbdir when srcdir != "."Björn Jacke2009-07-031-2/+2
|
* Sort the signature filesSimo Sorce2009-07-034-89/+89
|
* Expose functions need by backend writersSimo Sorce2009-07-035-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.
* Restore ABI compatibility for talloc.Simo Sorce2009-07-036-60/+106
|
* talloc: change TALLOC_MAGIC for version 2.0.0Stefan Metzmacher2009-07-021-1/+12
| | | | metze
* change talloc to 2.0.0Andrew Tridgell2009-07-021-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
* lib/util: fix order of includes in tevent_ntstatus.cMichael Adam2009-07-011-1/+1
| | | | | | replace.h needs to be included first. Michael
* fixed the talloc testsuite for the recent changesAndrew Tridgell2009-07-011-6/+10
|
* a talloc_realloc() to zero size needs to use an unambiguous freeAndrew Tridgell2009-07-011-1/+1
|
* changes to remove the ambiguity in talloc_free() and talloc_steal() Andrew Tridgell2009-07-012-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.
* fixed use of reference in pytallocAndrew Tridgell2009-07-012-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
* lib/util: fix building tevent_ntstatus without config.hMichael Adam2009-06-291-1/+0
| | | | | | (when called from places with "#define NO_CONFIG_H" set, such as configure) Michael
* tsocket/bsd: also ask for TEVENT_FD_READ when we want to write into a stream ↵Stefan Metzmacher2009-06-291-2/+9
| | | | | | | | socket Otherwise we would not notice a broken connection. metze
* tsocket/bsd: more correctly check if the cached tevent_fd is still validStefan Metzmacher2009-06-291-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
* Fix ndrdump to use a common setup_logging() APIAndrew Bartlett2009-06-292-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