summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* lib/async_req: do not install async_connect_send_test.Günther Deschner2015-12-181-1/+2
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11639 Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 632114584d3be0d4660e97a6c9e69e577a7bc1e2)
* lib/param: add a fixed unified lpcfg_string_{free,set,set_upper}() ↵Jeremy Allison2015-12-181-19/+37
| | | | | | | | | | | | | | | | | | | | | | | | infrastructure This reduces the memory footprint of empty string options. smbd -d1 -i with 1400 shares in smb.conf under x64 valgrind massif before this patch has 7,703,392 bytes peak memory consumption and after this patch 3,321,200 bytes. This fixes a regression introduced by commit 2dd7c890792cf12049ec13b88aa4e9de23035f9d. BUG: Bug: https://bugzilla.samba.org/show_bug.cgi?id=11625 Back-port of commit a84eed532549c1dbad43f963838bc5f13c4fe68d from master. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Merge tag 'samba-4.2.7' into v4-2-testKarolin Seeger2015-12-167-57/+95
|\ | | | | | | samba: tag release samba-4.2.7
| * ldb: bump version of the required system ldb to 1.1.24Ralph Boehme2015-12-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed to ensure we build against a system ldb library that contains the fixes for CVE-2015-5330 and CVE-2015-3223. autobuild must still be able to build against the older version 1.1.20 including the patches. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11325 Bug: https://bugzilla.samba.org/show_bug.cgi?id=11599 Bug: https://bugzilla.samba.org/show_bug.cgi?id=11636 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
| * CVE-2015-5330: ldb_dn_explode: copy strings by length, not terminatorsDouglas Bagnall2015-12-091-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That is, memdup(), not strdup(). The terminators might not be there. But, we have to make sure we put the terminator on, because we tend to assume the terminator is there in other places. Use talloc_set_name_const() on the resulting chunk so talloc_report() remains unchanged. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11599 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Pair-programmed-with: Andrew Bartlett <abartlet@samba.org> Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Pair-programmed-with: Stefan Metzmacher <metze@samba.org> Pair-programmed-with: Ralph Boehme <slow@samba.org>
| * CVE-2015-5330: next_codepoint_handle_ext: don't short-circuit UTF16 low bytesDouglas Bagnall2015-12-091-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | UTF16 contains zero bytes when it is encoding ASCII (for example), so we can't assume the absense of the 0x80 bit means a one byte encoding. No current callers use UTF16. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11599 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Pair-programmed-with: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
| * CVE-2015-5330: strupper_talloc_n_handle(): properly count charactersDouglas Bagnall2015-12-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | When a codepoint eats more than one byte we really want to know, especially if the string is not NUL terminated. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11599 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Pair-programmed-with: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
| * CVE-2015-5330: Fix handling of unicode near string endingsDouglas Bagnall2015-12-094-14/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now next_codepoint_ext() and next_codepoint_handle_ext() were using strnlen(str, 5) to determine how much string they should try to decode. This ended up looking past the end of the string when it was not null terminated and the final character looked like a multi-byte encoding. The fix is to let the caller say how long the string can be. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11599 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Pair-programmed-with: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
| * CVE-2015-5330: ldb_dn_escape_value: use known string length, not strlen()Douglas Bagnall2015-12-091-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | ldb_dn_escape_internal() reports the number of bytes it copied, so lets use that number, rather than using strlen() and hoping a zero got in the right place. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11599 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Pair-programmed-with: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
| * CVE-2015-5330: ldb_dn: simplify and fix ldb_dn_escape_internal()Douglas Bagnall2015-12-091-28/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we relied on NUL terminated strings and jumped back and forth between copying escaped bytes and memcpy()ing un-escaped chunks. This simple version is easier to reason about and works with unterminated strings. It may also be faster as it avoids reading the string twice (first with strcspn, then with memcpy). Bug: https://bugzilla.samba.org/show_bug.cgi?id=11599 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Pair-programmed-with: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
| * CVE-2015-3223: lib: ldb: Use memmem binary search, not strstr text search.Jeremy Allison2015-12-091-4/+13
| | | | | | | | | | | | | | | | | | Values might have embedded zeros. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11325 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
| * CVE-2015-3223: lib: ldb: Cope with canonicalise_fn returning string "", ↵Jeremy Allison2015-12-091-1/+15
| | | | | | | | | | | | | | | | | | length 0. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11325 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* | Fix bug #11394 - Crash: Bad talloc magic value - access after freeKarolin Seeger2015-12-111-82/+126
|/
* lib: util: Make non-critical message a warning.Jeremy Allison2015-11-061-1/+1
| | | | | | | | | | Non-root utilities (e.g. bin/net) call this via messaging_init(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=11566 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (back-ported from commit 859e3415b38538ff6c023e4a56570d94a4fe4432)
* async_req: fix non-blocking connect()Ralph Boehme2015-10-281-29/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | According to Stevens UNIX Network Programming and various other sources, the correct handling for non-blocking connect() is: - when the initial connect() return -1/EINPROGRESS polling the socket for *writeability* - in the poll handler call getsocktopt() with SO_ERROR to get the finished connect() return value Simply calling connect() a second time without error checking is probably wrong and not portable. For a successfull connect() Linux returns 0, but Solaris will return EISCONN: 24254: 0.0336 0.0002 connect(4, 0xFEFFECAC, 16, SOV_DEFAULT) Err#150 EINPROGRESS 24254: AF_INET name = 10.10.10.143 port = 1024 24254: 0.0349 0.0001 port_associate(3, 4, 0x00000004, 0x0000001D,0x080648A8) = 0 24254: 0.0495 0.0146 port_getn(3, 0xFEFFEB50, 1, 1, 0xFEFFEB60) = 1 [0] 24254: 0.0497 0.0002 connect(4, 0x080646E4, 16, SOV_DEFAULT) Err#133 EISCONN 24254: AF_INET name = 10.10.10.143 port = 1024 Bug: https://bugzilla.samba.org/show_bug.cgi?id=11564 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 05d4dbda8357712cb81008e0d611fdb0e7239587)
* selftest: add a test for async_connect_send()Ralph Boehme2015-10-282-0/+134
| | | | | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=11564 Also includes: selftest: Fix memset parameters in test for async_connect_send() Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit aa96c75346a9bad60471a206d65c7b7049b9ca83) (cherry picked from commit 7cf45539da9cba25130457941814da12d0a828c3)
* tdb: Fix bug 11381, deadlockVolker Lendecke2015-10-121-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> (cherry picked from commit 1061a9cafda7d73ebcd2f74e69e74f4adc485d5d)
* lib: replace: Add strsep function (missing on Solaris).Jeremy Allison2015-08-043-2/+27
| | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11359 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@wakeful.net> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jul 29 02:24:55 CEST 2015 on sn-devel-104 (cherry picked from commit f07b746ad3f3ee2fcbb65a0d452ed80f07c9e8f9)
* Introduce setting "desired" for 'smb encrypt' and 'client/server signing'Michael Adam2015-07-162-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> (cherry picked from commit 204cbe3645c59b43175beeadad792b4a00e80da3)
* s3: smbd: Codenomicon crash in do_smb_load_module().Jeremy Allison2015-06-301-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 (cherry picked from commit 5a82cc21379e3fe28441cd82647313c9390b41e7)
* lib/async_req: remove the tevent_fd as early as possible via a ↵Stefan Metzmacher2015-06-301-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> (cherry picked from commit 64640cc99c7b8543ee8d35ca243c57c048cdb490)
* lib/async_req: remove the tevent_fd as early as possible via a ↵Stefan Metzmacher2015-06-301-4/+20
| | | | | | | | | | read_packet_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> (cherry picked from commit a2a7cbc66c4713493e6ade45d0cdde25f64c9007)
* lib/async_req: use tevent_req_nomem/tevent_req_post in read_packet_send()Stefan Metzmacher2015-06-301-7/+4
| | | | | | | | 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> (cherry picked from commit 9a116b28bab20507760f50f25214635a60ea6c43)
* lib/async_req: s/result/req/ in read_packet_send()Stefan Metzmacher2015-06-301-6/+6
| | | | | | | | 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> (cherry picked from commit 4f05f68abc1d756bb114260e80d3532f3f959fec)
* lib/async_req: remove the tevent_fd as early as possible via a ↵Stefan Metzmacher2015-06-301-14/+27
| | | | | | | | | | writev_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> (cherry picked from commit 0c1109695639a177d3d739b343e7588a6ecf0949)
* lib/async_req: simplify async_connect_* using a _cleanup() hookStefan Metzmacher2015-06-301-35/+33
| | | | | | | | | | | This makes sure we remove the tevent_fd as soon as possible and always reset the old_sockflags. 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> (cherry picked from commit d5a4b30f894f0d4d4fa728ebd2c435254bf3b142)
* lib/async_req: s/result/req/ in async_connect_send()Stefan Metzmacher2015-06-301-9/+8
| | | | | | | | 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> (cherry picked from commit be8c2ff10353df00f05cd378c251a33a9e08563a)
* lib/async_req: remove unused sendto_{send,recv} and recvfrom_{send,recv}Stefan Metzmacher2015-06-302-190/+0
| | | | | | | | 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> (cherry picked from commit ccd038e1523a69197a9aaeca00305b0958f09ff0)
* lib/tsocket: add tdgram_inet_udp_broadcast_socket()Stefan Metzmacher2015-06-302-0/+59
| | | | | | | | | | | | This is similar to tdgram_inet_udp_socket(), but it allows the use of ipv4 broadcast traffic. 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> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 36b97d0bb9fe004f3d8a500f3af83dff34f86d7b)
* lib/tsocket: add tdgram_bsd_existing_socket() helper functionStefan Metzmacher2015-06-302-0/+66
| | | | | | | | | | | | | This is similar to tstream_bsd_existing_socket(). Both help to migrate strange code path to using the tstream or tdgram abstractions. 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> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 3a8b7b0518b33b016d2dbb8dd23d35ef1c6aaa5c)
* lib: Add tevent_req_simple_recv_unixVolker Lendecke2015-06-302-0/+14
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit f5c17d41e085e083ef970692ff7f50f7a6642ea3)
* tdb: version 1.3.6Stefan Metzmacher2015-06-202-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 (cherry picked from commit 4ddf78a282c85e84b6201a79b707fad9487f3ccd) The last 13 patches address BUG: https://bugzilla.samba.org/show_bug.cgi?id=11331 Backport tdb-1.3.6. Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-2-test): Sat Jun 20 23:13:17 CEST 2015 on sn-devel-104
* lib/replace: remove unused ↵Stefan Metzmacher2015-06-201-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> (cherry picked from commit 89dcfbf3f45f448e515a1da82e09002a0aafb7b4)
* lib/replace: fix PTHREAD_MUTEX_ROBUST fallback to PTHREAD_MUTEX_ROBUST_NP on ↵Stefan Metzmacher2015-06-202-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> (cherry picked from commit 34cf1d213ec0261af41ef6a16f5b37e5015c614b)
* lib/util: remove signal related configure checksStefan Metzmacher2015-06-201-2/+0
| | | | | | | | | | | These are done in lib/replace now. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11326 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 322f4b76e5cae9f2513ef68d7d86ad19d4a88244)
* lib/replace: add signal related configure checksStefan Metzmacher2015-06-201-0/+1
| | | | | | | | | | | | | These should be in a central place available for all lib/replace users instead of having each caller do its own checks. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11326 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit a82acb076e78eb513fb1228595b220f61377e23c)
* tdb: version 1.3.5Alexander Drozdov2015-06-202-1/+70
| | | | | | | | | | | | | ABI change: tdb_chainlock_read_nonblock() has been added. Signed-off-by: Alexander Drozdov <al.drozdov@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Apr 29 00:05:29 CEST 2015 on sn-devel-104 (cherry picked from commit 3f35c1d52ee77f7cabd52dd503565cec360f1de2)
* tdb: introduce tdb_chainlock_read_nonblock(), a nonblock variant of ↵Alexander Drozdov2015-06-202-0/+8
| | | | | | | | | tdb_chainlock_read() Signed-off-by: Alexander Drozdov <al.drozdov@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit e4fe0aff5252b37536eec4a130d4e40a05a56ddb)
* Add set date to tdb manpages.Jelmer Vernooij2015-06-204-0/+4
| | | | | | | | This makes builds reproducible. Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reveiewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 38553a305fe4021e2bd034bed11eaef18863aa0a)
* tdb: Do not build test binaries if it's not a standalone buildAmitay Isaacs2015-06-201-11/+12
| | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Mar 31 01:56:02 CEST 2015 on sn-devel-104 (cherry picked from commit 48e90ba062ecde71d03c3cf4bc9a809f805fabe4)
* tdb: Fix CID 1034842 Resource leakVolker Lendecke2015-06-201-0/+1
| | | | | | | | | | 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): Wed Mar 11 00:23:20 CET 2015 on sn-devel-104 (cherry picked from commit 006328b81b2dd3416c20b0f19b438c614c1932cc)
* tdb: Fix CID 1034841 Resource leakVolker Lendecke2015-06-201-3/+5
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> (cherry picked from commit 1b8c07ac7d51eb2a1957d79ea05b170106a9c0e8)
* lib/util/charset: fix conversion failure loggingRalph Boehme2015-06-201-1/+3
| | | | | | | | | | | | | Move catch-all debug statement with loglevel 0 from behind the switch clause into the switch clause as default case. Fixes an issue that resulted in the log being flooded with level 0 messages in case someone put a file with an illegal UTF8 encoding (eg '\xA0test') on the server. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11323 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 1c60dc5c3252685d51324481063461f60cf968fe)
* tevent: version 0.9.25Stefan Metzmacher2015-06-202-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> (cherry picked from commit d7bdb30cc1731dc84831e323332a85be2bccf6a7) The last 14 patches address BUG: https://bugzilla.samba.org/show_bug.cgi?id=11330 Backport tevent-0.9.25.
* pytevent: add a TeventTimer_Object_ref helper structure to make the code clearerStefan Metzmacher2015-06-201-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> (cherry picked from commit 93ee074f912da02d4c1f1584df9b107364b639be)
* pytevent: remove const warnings using discard_const_p()Stefan Metzmacher2015-06-201-13/+23
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit fb04f0f4190005ff21817b79d02897af23ddc7ee)
* pytevent: remove dead code TEVENT_DEPRECATED is never definedStefan Metzmacher2015-06-201-48/+0
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit 1a8a5ba0d51f9c2c9e84a3400e05327e7059156b)
* tevent.h: propose tstream_ versions of read_packet_send/recv and ↵Stefan Metzmacher2015-06-201-2/+2
| | | | | | | | | | | | | | | writev_send/recv The functions operating on the raw file descriptor are for advanced callers, which take extra care and avoid the problems of https://bugzilla.samba.org/show_bug.cgi?id=11141. 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> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 44584f810720602201a9afaaa087eeb83579eff5)
* tevent/testsuite: make sure we cleanup tevent_fd structures in the correct orderStefan Metzmacher2015-06-201-2/+2
| | | | | | | | | | | | | First we need to remove the tevent_fd structures without tevent_fd_set_auto_close(). Closing the fd needs to be the last thing... 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> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 88971d4870a197f656ef912911ca1e4ff5b56749)
* pytevent: Port to Python 3Petr Viktorin2015-06-201-13/+57
| | | | | | | | | | | - Use PyStr (String on py2, Unicode on py3) for text strings - Use PyLong instead of PyInt on Python 3 - Use new module initialization Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> (cherry picked from commit 8dbdd27526c4d5358bc2614e90f9aca36f41ed1a)