summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* util.c: fix order of inclusion to correctly consume config.hUri Simchoni2015-07-091-1/+1
| | | | | | | | | | | | | | | | replace.h has to be the first file included in order to correctly act upon the definitions in config.h. Specifically, this change fixes 32-bit i686 builds, which depend upon _FILE_OFFSET_BITS=64 to be set before any standard library file is included. Signed-off-by: Uri Simchoni <urisimchoni@gmail.com> Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Jul 9 12:32:03 CEST 2015 on sn-devel-104
* tdb: Reproducer for Bug 11381Volker Lendecke2015-07-092-0/+204
| | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=11381 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: Fix bug 11381, deadlockVolker Lendecke2015-07-091-1/+13
| | | | | | | | | | | | | | | | | This fixes a deadlock in tdb that is a bad interaction between tdb_lockall and tdb_traverse. This deadlock condition has been around even before tdb mutexes, it's just that the kernel fcntl EDEADLK detection protected us from this ABBA lock condition to become a real deadlock stalling processes. With tdb mutexes, this deadlock protection is gone, so we do lock dead. This patch glosses over this particular ABBA condition, making tdb with mutexes behave the same as tdb without mutexes. Admittedly this is no real fix, but it works around a real user's problem. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11381 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gpfswrap: Use gpfs.h instead of gpfs_fcntl.hChristof Schmitt2015-07-082-2/+2
| | | | | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Wed Jul 8 05:55:13 CEST 2015 on sn-devel-104
* gpfswrap: Remove unused wrapper for gpfs_fnctlChristof Schmitt2015-07-082-13/+0
| | | | | | | | With the removal of the fileset quota check this wrapper function is longer used. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* param: Make "kernel change notify" globalVolker Lendecke2015-07-071-2/+2
| | | | | | | | With a central notifyd, we can't do this per share anymore. Notifyd will only look at absolute paths, not shares. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: Make "change notify" globalVolker Lendecke2015-07-071-2/+2
| | | | | | | | With a central notifyd, we can't do this per share anymore. Notifyd will only look at absolute paths, not shares. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Add server_id_db_pid()Volker Lendecke2015-07-072-0/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Add server_id_db_prune_nameVolker Lendecke2015-07-072-11/+22
| | | | | | | | With this you can remove a foreign mapping. Required to clean up dead processes. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Add tevent_req_poll_unixVolker Lendecke2015-07-072-0/+12
| | | | | | | This makes sync wrappers a bit shorter Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-mdssvc: add new option 'spotlight'Ralph Boehme2015-07-071-0/+8
| | | | | | | | | Per share option: it reflects whether a share is indexed by Tracker or not. The global switch that controls whether Spotlight is enabled or not, are the mdsvc RPC switches. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Introduce setting "desired" for 'smb encrypt' and 'client/server signing'Michael Adam2015-07-072-0/+2
| | | | | | | | | | | This should trigger the behaviour where the server requires signing when the client supports it, but does not reject clients that don't support it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11372 Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* lib/util:charset/tests: improve strlen_m[_term[_null]]() testingStefan Metzmacher2015-07-031-1/+13
| | | | | | | | | | They differ in their "" vs. NULL handling. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Fri Jul 3 05:02:45 CEST 2015 on sn-devel-104
* lib/util: let strlen_m_term[_null]() use strlen_m_ext_term[_null]()Stefan Metzmacher2015-07-031-15/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* lib/util: add strlen_m_ext_term_null() helper functionStefan Metzmacher2015-07-032-1/+20
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* lib/util: fix output format in dump_data*()Stefan Metzmacher2015-07-031-1/+1
| | | | | | | | | | | | | | | | | | | This changes: [0000] 4E 54 4C 4D 53 53 50 00 01 00 00 00 05 82 08 60 NTLMSSP. .......` [0010] 09 00 09 00 20 00 00 00 00 00 00 00 29 00 00 00 .... ... ....)... [0020] 57 4F 52 4B 47 52 4F 55 50 WORKGROU P into: [0000] 4E 54 4C 4D 53 53 50 00 01 00 00 00 05 82 08 60 NTLMSSP. .......` [0010] 09 00 09 00 20 00 00 00 00 00 00 00 29 00 00 00 .... ... ....)... [0020] 57 4F 52 4B 47 52 4F 55 50 WORKGROU P Note the alignment of 'WORKGROU P'. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* lib/torture: be more verbose about ndr failures.Günther Deschner2015-07-031-1/+1
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4-torture: move torture_assert_sid_equal() out of ndr headers.Günther Deschner2015-07-031-0/+10
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tevent: add and use debug class for teventRalph Boehme2015-07-013-0/+5
| | | | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Jul 1 23:04:00 CEST 2015 on sn-devel-104
* debug: get rid of DBGC_MAX_FIXEDRalph Boehme2015-07-012-34/+30
| | | | | | | | | Simplify class table by using designated array initializers and ARRAY_SIZE macro. Signed-off-by: Ralph Boehme <slow@samba.org> Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* lib: Trim blocking.cVolker Lendecke2015-07-011-7/+0
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Wed Jul 1 17:12:48 CEST 2015 on sn-devel-104
* Revert "lib: Fix deps for LIBCRYPTO"Douglas Bagnall2015-06-281-2/+2
| | | | | | | | | | | | | | | | | This reverts commit 30bfb8d63804f0c98312fadaadcb104120dadafb. Talloc is still needed by LIBCRYPTO, because arcfour.h includes lib/util/data_blob.h which includes talloc.h. It seems arcfour only uses the DATA_BLOB struct (in e.g. arcfour_crypt and arcfour_init). Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sun Jun 28 11:47:16 CEST 2015 on sn-devel-104
* Byte order reversal shouldn't assume size_t is 64 bit.Douglas Bagnall2015-06-241-1/+1
| | | | | | | | | | | This fixes compilation on 32 bit i386 with -WError. ../lib/crypto/aes_gcm_128.c:213:2: error: right shift count >= width of type [-Werror] ../lib/crypto/aes_gcm_128.c:213:2: error: left shift count >= width of type [-Werror] Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib: Fix CID 710685 Unchecked return value from libraryVolker Lendecke2015-06-231-1/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Fix CID 1273234 Untrusted value as argumentVolker Lendecke2015-06-231-1/+1
| | | | | | | | buf->size has been sanitized in the checks done in talloc_array(). This makes the "trust" flow more explicit. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Fix CID 1034723 Explicit null dereferencedVolker Lendecke2015-06-231-7/+8
| | | | | | | Do an early return if there's nothing to receive Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Fix CID 1272913 Calling risky functionVolker Lendecke2015-06-231-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Make genrand independentVolker Lendecke2015-06-231-2/+8
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Make time-basic a libraryVolker Lendecke2015-06-231-4/+5
| | | | | | | | The next commit will make genrand depend on time-basic. Without this, we would link in time-basic twice, from samba-debug and from genrand. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Fix deps for LIBCRYPTOVolker Lendecke2015-06-231-2/+2
| | | | | | | LIBCRYPTO itself does not depend on talloc Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Simplify arcfour_cryptVolker Lendecke2015-06-231-4/+5
| | | | | | | We don't need a dependency on data_blob in crypto Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Streamline genrand.c includesVolker Lendecke2015-06-235-26/+51
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Fix whitespaceVolker Lendecke2015-06-231-9/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Strip genrand.c a bitVolker Lendecke2015-06-233-281/+311
| | | | | | | | This moves for example password complexity checks out of the core random number generator Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* replace: Replace BSD strtoll by wrapping strtoll instead of strtoqFelix Janda2015-06-221-6/+2
| | | | | | | | | | | | | | | | | | | | When it is detected that strtoll returns EINVAL not only in the case that the base is not supported, HAVE_BSD_STRTOLL is declared and strtoll is replaced. The current replacement code wraps strtoq in order to replace strtoll and errors out when strtoq is missing. In order to remove this possible error path, we can use strtoll instead of strtoq since the code is only used when it is known that strtoll exists. The fixes a compilation problem on linux systems using musl libc, which has a BSD-like strtoll but no strtoq. Signed-off-by: Felix Janda <felix.janda@posteo.de> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Jun 22 12:49:10 CEST 2015 on sn-devel-104
* Fix a typoVolker Lendecke2015-06-191-2/+2
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Jun 19 01:05:17 CEST 2015 on sn-devel-104
* s3: smbd: Codenomicon crash in do_smb_load_module().Jeremy Allison2015-06-181-0/+5
| | | | | | | | | | | | | | | | | | | | Inside api_pipe_bind_req() we look for a pipe module name using dcerpc_default_transport_endpoint(pkt, NCACN_NP, table) which returns NULL when given invalid pkt data from the Codenomicon fuzzer. This gets passed directly to smb_probe_module(), which then calls do_smb_load_module() which tries to deref the (NULL) module name. https://bugzilla.samba.org/show_bug.cgi?id=11342 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jun 18 22:14:01 CEST 2015 on sn-devel-104
* lib: Fix CID 1306765 Unchecked return value from libraryVolker Lendecke2015-06-161-1/+7
| | | | | | | | | | | | This one might be a bit controversial. I don't see from man fcntl how this could fail. But if it does, we definitely do want to know about it. And here we don't have any good way to tell our caller, so abort. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Jun 16 19:22:52 CEST 2015 on sn-devel-104
* lib: Fix CID 1306764 Unchecked return valueVolker Lendecke2015-06-161-1/+1
| | | | | | | tevent_req_oom exists right for this case :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>
* tdb: version 1.3.6tdb-1.3.6Stefan Metzmacher2015-06-122-1/+70
| | | | | | | | | | | | | * Fix runtime detection for robust mutexes in the standalone build. bug #11326 * Possible fix for the build with robust mutexes on solaris 11 bug #11319 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Jun 12 19:55:34 CEST 2015 on sn-devel-104
* lib/replace: remove unused ↵Stefan Metzmacher2015-06-121-10/+0
| | | | | | | | | HAVE_DECL_PTHREAD_{MUTEXATTR_SETROBUST,MUTEX_CONSISTENT}_NP checks BUG: https://bugzilla.samba.org/show_bug.cgi?id=11319 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib/replace: fix PTHREAD_MUTEX_ROBUST fallback to PTHREAD_MUTEX_ROBUST_NP on ↵Stefan Metzmacher2015-06-122-6/+9
| | | | | | | | | | | | | | | | | | | | | | solaris 11 Without this we got the following defines in config.h: #define HAVE_DECL_PTHREAD_MUTEXATTR_SETROBUST_NP 1 #define HAVE_DECL_PTHREAD_MUTEX_CONSISTENT_NP 1 #define HAVE_PTHREAD_MUTEXATTR_SETROBUST 1 #define HAVE_PTHREAD_MUTEX_CONSISTENT 1 #define HAVE_ROBUST_MUTEXES 1 #define USE_TDB_MUTEX_LOCKING 1 And the build failed with PTHREAD_MUTEX_ROBUST being unknown. Note that PTHREAD_MUTEX_ROBUST and PTHREAD_MUTEX_ROBUST_NP are enum values while they're defines on solaris 11 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11319 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tevent: version 0.9.25tevent-0.9.25Stefan Metzmacher2015-06-122-1/+89
| | | | | | | | | | | | | * Fix compile error in Solaris ports backend. * Fix access after free in tevent_common_check_signal(). bug #11308 * Improve pytevent bindings. * Testsuite fixes. * Improve the documentation of the tevent_add_fd() assumtions. It must be talloc_free'ed before closing the fd! See bug #11141 and bug #11316. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* pytevent: add a TeventTimer_Object_ref helper structure to make the code clearerStefan Metzmacher2015-06-121-9/+13
| | | | | | | | This gives talloc_set_destructor to verify the type, which removes a compiler warning. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* pytevent: remove const warnings using discard_const_p()Stefan Metzmacher2015-06-121-13/+23
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* pytevent: remove dead code TEVENT_DEPRECATED is never definedStefan Metzmacher2015-06-121-48/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* talloc:guide: fix documented signature of talloc_unlink().Michael Adam2015-06-121-1/+1
| | | | | | | The second argument is void *, not const void *. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* talloc:manpage: fix documented signature of talloc_unlink().Michael Adam2015-06-121-1/+1
| | | | | | | The second argument is void *, not const void *. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* talloc: sync the talloc_reference() description between talloc_guide and manpageStefan Metzmacher2015-06-121-3/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib/async_req: remove the tevent_fd as early as possible via a ↵Stefan Metzmacher2015-06-121-9/+21
| | | | | | | | | wait_for_read_cleanup() hook BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>