summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* libs: s3 and s4: make our dns lookup code signal-safe.Jeremy Allison2014-04-101-5/+24
| | | | | | | | | | | | | | Cope with -1,EINTR returns. Needed as this code can be called from inside smbd. Also fixes a bug in not checking the return from poll() correctly. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Kai Blin <kai@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Apr 10 22:06:08 CEST 2014 on sn-devel-104
* tdb: consolidate tdb allocation code - re-use dead records at hash top.Michael Adam2014-04-092-43/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | When in tdb_store we re-use a dead record reactivated from the target hash chain itself, we currently leave it in its place in the chain. When we re-use a dead record from a different chain or from the freelist instead, we insert it at the beginning of the target chain. This patch changes the behaviour to always newly store a record at the beginning of the hash chain. This removes a special case and hence simplifies the allocation code. On the other hand side, it introduces two additioal tdb_ofs_write calls for the in-chain-case. Note the subtelty of the patch that by moving the case of the candidate record's chain as new case "i=0" into the for loop, we also reverse the order of the two steps in the for-loop body (non blocking freelist alloc and searching for dead record in a chain) in order to keep the overall order of execution identical. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Apr 9 10:37:08 CEST 2014 on sn-devel-104
* talloc: Update flags in pytalloc-util pkgconfig fileLukas Slebodnik2014-04-041-2/+2
| | | | | | | | | | | | | | After exapnding, @LIB_RPATH@ will be -Wl,-rpatch,/usr/local/lib if rpath is used on install. But "-Wl," will be passed to linker and should not be among CFLAGS. Other pkgconfig files have @LIB_RPATH@ in the right place. @see commit 735c1cd2da15167748e92ba6de48fdb5169db587 Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Apr 4 23:50:25 CEST 2014 on sn-devel-104
* tevent: Update flags in tevent pkgconfig fileLukas Slebodnik2014-04-041-2/+2
| | | | | | | | | | | After exapnding, @LIB_RPATH@ will be -Wl,-rpatch,/usr/local/lib if rpath is used on install. But "-Wl," will be passed to linker and should not be among CFLAGS. Other pkgconfig files have @LIB_RPATH@ in the right place. @see commit 735c1cd2da15167748e92ba6de48fdb5169db587 Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib/param: Add new parameter "old password allowed period"Andrew Bartlett2014-04-022-0/+10
| | | | | | Change-Id: I46228b492ba71ba4f3fee380a1ccadb328e3ade1 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ldb_ildap: Map some wrong username/password errors on to ↵Andrew Bartlett2014-04-021-1/+9
| | | | | | | | | | | | LDB_ERR_INVALID_CREDENTIALS This is better than just LDB_ERR_OPERATIONS_ERROR for all errors. Andrew Bartlett Change-Id: Id832cf02fcd1dc0347d5ab9eb9a2db78fda39dc6 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dlinklist: Fix a typoVolker Lendecke2014-04-023-3/+3
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Apr 2 17:11:37 CEST 2014 on sn-devel-104
* lib/socket_wrapper: explicitly use allow_warnings=TrueStefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/zlib: explicitly use allow_warnings=TrueStefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/popt: explicitly use allow_warnings=TrueStefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/ldb: explicitly use allow_warnings=TrueStefan Metzmacher2014-04-021-0/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/ntdb: explicitly use allow_warnings=True for ntdb-test-helpersStefan Metzmacher2014-04-021-1/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/ccan: explicitly use allow_warnings=TrueStefan Metzmacher2014-04-021-0/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/tevent/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/tdr/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/socket_wrapper/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/nss_wrapper/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-0211-0/+11
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/compression/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util: fix const warningsStefan Metzmacher2014-04-024-6/+13
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util: declare smb_panic_default() as _NORETURN_Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb/wscript: maintain a global list of unit testsStefan Metzmacher2014-04-021-45/+32
| | | | | | | This makes sure a new test is also added to 'make test' Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb/test: avoid const warnings by using 'discard_const_p(uint8_t,' instead ↵Stefan Metzmacher2014-04-0218-34/+34
| | | | | | | of '(void *)' Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb/test: remove "\n" in diag() argumentsStefan Metzmacher2014-04-022-2/+2
| | | | | | | diag() already adds "\n". Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb/test: always call fflush() after [f]printf() in tap-interface.hStefan Metzmacher2014-04-021-4/+22
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb/tools: avoid const warnings in tdbdump.cStefan Metzmacher2014-04-021-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb: don't alter errno on success of tdb_open_ex()Stefan Metzmacher2014-04-021-0/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/zlib: make use of conf.CHECK_BUNDLED_SYSTEM()Stefan Metzmacher2014-04-021-28/+23
| | | | | | | This way --bundled-libraries=ALL will use the internal zlib version. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb_wrap: Remove tdb_wrap_open_ againVolker Lendecke2014-03-313-37/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap: Avoid passing lp_ctx to tdb_wrap_open in db_open_tdbVolker Lendecke2014-03-311-2/+8
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: Add lpcfg_tdb_flags()Volker Lendecke2014-03-312-1/+10
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: Add lpcfg_tdb_hash_size()Volker Lendecke2014-03-311-0/+18
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Add interim tdb_wrap_open_ without lp_ctxVolker Lendecke2014-03-312-21/+31
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Pull up lp_ctx use one levelVolker Lendecke2014-03-311-19/+19
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/util: let is_ipaddress_v6() cope with "fe80::1234%3"Stefan Metzmacher2014-03-251-12/+54
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:param: move lp_ctdbd_socket() to ctdbd_conn.cStefan Metzmacher2014-03-241-1/+1
| | | | | | | This allows us to use CTDB_PATH only in ctdbd_conn.c Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tdb: change version to 1.2.13.Michael Adam2014-03-182-1/+68
| | | | | | | | | | | | | | | | * internal code cleanups * always open internal TDBs with incompatible hash * avoid reallocations in locking code * systematize output format in tdbtool dump * reduce freelist contention when allocating new records - try to find dead records also in other chains - don't do blocking locks on the freelist Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Mar 18 15:42:48 CET 2014 on sn-devel-104
* tdb: Reduce freelist contentionVolker Lendecke2014-03-183-30/+93
| | | | | | | | | | | | | | | | | | | | | | | In a metadata-intensive benchmark we have seen the locking.tdb freelist to be one of the central contention points. This patch removes most of the contention on the freelist. Ages ago we already reduced freelist contention by using the even much older DEAD records: If TDB_VOLATILE is set, don't directly put deleted records on the freelist, but just mark a few of them just as DEAD. The next new record can them re-use that space without consulting the freelist. This patch builds upon the DEAD records: If we need space and the freelist is busy, instead of doing a blocking wait on the freelist, start looking into other chains for DEAD records and steal them from there. This way every hash chain becomes a small freelist. Just wander around the hash chains as long as the freelist is still busy. With this patch and the tdb mutex patch (following hopefully some time soon) you can see a heavily busy clustered smbd run without locking.tdb futex syscalls. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Make "tdb_purge_dead" internally publicVolker Lendecke2014-03-182-1/+2
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Make "tdb_find_dead" internally publicVolker Lendecke2014-03-182-3/+6
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Add "last_ptr" to tdb_find_deadVolker Lendecke2014-03-181-4/+13
| | | | | | | | Will be used soon to unlink a dead record from a chain Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Move adding tailer space to tdb_find_deadVolker Lendecke2014-03-181-3/+4
| | | | | | | | | This aligns the tdb_find_dead API with the tdb_allocate API and thus makes it a bit easier to understand, at least for me. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Do a best fit search for dead recordsVolker Lendecke2014-03-181-7/+13
| | | | | | | | | | Hash chains are (or can be made) short enough that a full search for the best-fitting dead record is feasible. The freelist can become much longer, there we don't do the full search but accept records which are too large. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Don't purge records to a blocked freelistVolker Lendecke2014-03-181-1/+4
| | | | | | | | If the freelist is heavily contended, we should avoid accessing it Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Fix a tdb corruptionVolker Lendecke2014-03-181-2/+5
| | | | | | | | | | tdb_purge_dead can change the next pointer of "rec" if we purge the record right behind the current record to be deleted. Just overwrite the magic, not the whole record with stale data. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib/popt: Patch memory leak in popthelp.cJose A. Rivera2014-03-131-2/+2
| | | | | | | | | | | Memory created as "t" was not being free'd. Change-Id: I5f6e20acc6c440a1cd9908aed7a90de2000f22f8 Coverity-Id: 240599 Coverity-Id: 240600 Signed-off-by: Jose A. Rivera <jarrpa@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* lib/popt: Small whitespace fix for readability.Jose A. Rivera2014-03-131-14/+15
| | | | | | | Change-Id: Ib920f7e84c0247a8f09aa4c79c65b26afb78f234 Signed-off-by: Jose A. Rivera <jarrpa@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* param: remove lp_dnsdomain from s3Garming Sam2014-02-201-1/+0
| | | | | | | | | With the use of the shared globals structure, lp_dnsdomain is no longer used in the code and removing it would remove a notable special case Signed-off-by: Garming Sam <garming@catalyst.net.nz> Change-Id: I59526c40c58e132a134d67fa7944dfeacd05f4c6 Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: change s3_param.h from a generated file to a static oneGarming Sam2014-02-202-6/+21
| | | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Change-Id: I131e37ec92f7a826caec382023915c5e4b4c52be Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: use loadparm_globals struct instead of lp function pointers in s3_helpersGarming Sam2014-02-202-18/+5
| | | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Change-Id: I4507cdbf111b7f9dca3ca18ee2bf242ffdfeb4e7 Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>