1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

5625 Commits

Author SHA1 Message Date
Michael Adam
ff5521838a Revert "tevent: avoid -Wtautological-compare errors with gcc6"
This reverts commit 2991f77099.

Breaks compile for older (<= 4.4) gccs.
Needs to be done differently.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-15 00:54:12 +02:00
Michael Adam
f061cccd0a Revert "ldb:dlinklist: avoid -Wtautological-compare errors with gcc6"
This reverts commit 7c9505e651.

Breaks compile for older (<= 4.4) gccs.
Needs to be done differently.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-15 00:54:12 +02:00
Volker Lendecke
91a17e5413 tdb: Don't malloc for every record in traverse
This gains a few percent in tdbbackup

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jul 15 00:52:00 CEST 2016 on sn-devel-144
2016-07-15 00:52:00 +02:00
Ira Cooper
7c9505e651 ldb:dlinklist: avoid -Wtautological-compare errors with gcc6
We expect these macros to generate tautological compares
intentionally, so disabling the warning is just fine.

This lets --pick-developer work with gcc6 and newer.

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jul 14 05:44:21 CEST 2016 on sn-devel-144
2016-07-14 05:44:20 +02:00
Michael Adam
2991f77099 tevent: avoid -Wtautological-compare errors with gcc6
We expect these macros to generate tautological compares
intentionally, so disabling the warning is just fine.

This lets --picky-developer work with gcc6 and newer.

Pair-Programmed-With: Ira Cooper <ira@samba.org>

Signed-off-by: Ira Cooper <ira@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-14 02:06:10 +02:00
Ira Cooper
5d85fd8546 lib:dlinklist: avoid -Wtautological-compare errors with gcc6
We expect these macros to generate tautological compares
intentionally, so disabling the warning is just fine.

This lets --picky-developer work with gcc6 and newer.

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-14 02:06:10 +02:00
Nikolai Kondrashov
9d29593d92 tevent: Clarify apparently useless conditions
Comment on two similar conditions in tevent_standard.c, which,
otherwise, at a first glance, seem useless, i.e. always true.

The conditions checking glue->epoll_ops for being non-NULL, imply that
it *can* be NULL. A casual reader would not generally expect a "member"
function to modify its container's pointer in a container higher up, and
would assume that glue->epoll_ops could be NULL before the call,
resulting in a near-NULL pointer dereference.

However, in this case epoll_ops is indeed cleared in those "member"
functions, in the case of an epoll interface failure, to signify
fallback to poll interface.

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Tue Jul 12 13:56:41 CEST 2016 on sn-devel-144
2016-07-12 13:56:41 +02:00
Amitay Isaacs
c1c2a1cb9f swrap: Build socket_wrapper path relative to blddir
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-07-11 12:19:13 +02:00
Andrew Bartlett
3175d5f4bf ldb: Avoid use-after-free when one error message is printed into another
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-07-06 15:35:17 +02:00
Garming Sam
fa7212afe7 tevent: typo in documentation
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-07-05 00:00:15 +02:00
Garming Sam
73152561df param: fix a typo emtpy -> empty
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-07-05 00:00:15 +02:00
Garming Sam
878fa6ef7d check-password-script: Allow AD to execute these scripts
In contrast to source3, this is run as root and without substitution.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-07-05 00:00:14 +02:00
Bob Campbell
7700ee810b tdb: avoid many fcntl calls when incrementing seqnum
Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Jul  3 18:11:30 CEST 2016 on sn-devel-144
2016-07-03 18:11:29 +02:00
Andrew Bartlett
d820b046ac lib: talloc: Add check for destructor protection.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-03 14:26:17 +02:00
Andrew Bartlett
f877191fee lib: talloc: As we have a struct talloc_chunk * in _talloc_free_children_internal(), use it to call _tc_free_internal() directly.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-03 14:26:17 +02:00
Andrew Bartlett
fde0d0de71 lib: talloc: As _tc_free_internal() takes a struct talloc_chunk *, add an extra paranoia check against destructor overwrite.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-03 14:26:17 +02:00
Andrew Bartlett
d2a5927bd7 lib: talloc: Rename the internals of _talloc_free_internal() to _tc_free_internal().
Make it use a struct talloc_chunk *tc parameter. Define _talloc_free_internal()
in terms of _tc_free_internal().

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-03 14:26:17 +02:00
Andrew Bartlett
94a72849fa lib: talloc: Call talloc_chunk_from_ptr() less often in __talloc_with_prefix()
Rename 'ptc' pointer to parent as it's re-used as
that name later in the function.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-03 14:26:17 +02:00
Andrew Bartlett
c6d458ef6e lib: talloc: Rename talloc_set_name_v() to tc_set_name_v(). Make it take a struct talloc_chunk *tc as the first argument.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-03 14:26:17 +02:00
Andrew Bartlett
192c75730b lib: talloc: Add _vasprintf_tc() which returns the struct talloc_chunk *, not the talloc'ed pointer.
Define talloc_vasprintf() in terms of _vasprintf_tc().
We will use _vasprintf_tc() internally later.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-03 14:26:17 +02:00
Andrew Bartlett
2bfccbf9d0 lib: talloc: Change _talloc_set_name_const() to _tc_set_name_const()
First argument is now struct talloc_chunk *tc.
Ensure all callers pass correct talloc chunk from given pointer.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-03 14:26:17 +02:00
Andrew Bartlett
5bc592da83 lib: talloc: Change __talloc() to return a struct talloc_chunk *.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-03 14:26:17 +02:00
Andrew Bartlett
58f987d0e6 lib: talloc: Change __talloc_with_prefix() to return a struct talloc_chunk *.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-03 14:26:17 +02:00
Jeremy Allison
64244f9d5f lib: talloc: Rename talloc_XXX() internal functions that take a 'struct talloc_chunk *' to tc_XXX().
We will be adding more and it ensures a consistent naming scheme.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-07-03 14:26:17 +02:00
Stefan Metzmacher
70cc56d3e7 lib/param: add lpcfg_sam_dnsname() helper function
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-06-30 03:30:26 +02:00
Andreas Schneider
4524f5986c tsocket: Do not dereference a NULL pointer
Make sure the lrbsda pointer is not allocated and we will
not end up dereferencing a NULL pointer. In practice this
can't happen, but this change links the pointer with the
code that uses it.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 30 02:53:02 CEST 2016 on sn-devel-144
2016-06-30 02:53:01 +02:00
Jeremy Allison
04967d6e88 s3: tdb: On some platforms pthread_mutex_trylock() returns EBUSY not EDEADLK.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jun 29 15:14:44 CEST 2016 on sn-devel-144
2016-06-29 15:14:44 +02:00
Volker Lendecke
4e20d2448e ldb: Fix CID 1362935: CHECKED_RETURN
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-06-28 18:48:08 +02:00
Andrew Bartlett
4fb23630ba ldb: Do not allocate the extended DN name
The name must be a hard-coded value from struct ldb_dn_extended_syntax
so just point to that constant pointer

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-27 00:18:17 +02:00
Andrew Bartlett
ab4cd63e10 ldb: Allow repl_meta_data to override the O(^2) loop checking for duplciates
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-27 00:18:17 +02:00
Andreas Schneider
8813faffe3 libutil: Support systemd 230
systemd 230 version finally deprecated
libsystemd-daemon/libsystemd-journal split and put everything in
libsystemd library.

Make sure HAVE_LIBSYSTEMD define is supported in the code (we already
have it defined by the waf).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11936

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>

Autobuild-User(master): Richard Sharpe <sharpe@samba.org>
Autobuild-Date(master): Mon Jun 27 00:01:55 CEST 2016 on sn-devel-144
2016-06-27 00:01:55 +02:00
Jose A. Rivera
becc43b87d krb5_wrap: Fix build error when not using heimdal.
Just a small typo fix where type and variable were flipped.

Signed-off-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Jun 25 22:43:27 CEST 2016 on sn-devel-144
2016-06-25 22:43:27 +02:00
Andreas Schneider
8e88ab727a util: Fix a possible null pointer dereference
Found by cppcheck.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-06-22 19:25:20 +02:00
Martin Schwenke
2513d5e11c lib/util: Optimise trim_string() to use a single memmove(3)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Jun 20 04:47:26 CEST 2016 on sn-devel-144
2016-06-20 04:47:26 +02:00
Martin Schwenke
92cfd1e9b8 torture: Add tests for trim_string()
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-06-20 00:47:30 +02:00
Andreas Schneider
8a0b058cee krb5_wrap: Add smb_krb5_mk_error()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-06-18 23:32:26 +02:00
Andrew Bartlett
61cb3a6a3b lib/ldb-samba: We can confirm a GUID is a GUID by length
The GUID_from_ndr_blob() is pointless and costly

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jun 17 18:13:56 CEST 2016 on sn-devel-144
2016-06-17 18:13:56 +02:00
Volker Lendecke
46916b24e9 lib: Add a little closefrom() test
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jun 13 14:11:11 CEST 2016 on sn-devel-144
2016-06-13 14:11:11 +02:00
Volker Lendecke
55529d0f85 libreplace: Add a closefrom() implementation
There is closefrom in some BSDs, but Linux ships this only as part
of libbsd.  Add a new implementation of it in libreplace. The one in
libbsd of jessie and upstream differ and it has for example optimizations
for FreeBSD, but it gets some of the array calculations slightly wrong
from my point of view. If you want those, use libbsd. This replacement
is optimized on Linux only looking at /proc/self/fd/, everything else
would do the OPEN_MAX brute force fallback.

Signed-off-by: Volker Lendecke <vl@samba.org>
2016-06-13 10:10:11 +02:00
Volker Lendecke
467ea855cc lib: Fix a signed/unsigned mixup
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-06-13 10:10:11 +02:00
Jeremy Allison
0e2711b2a0 lib: Fix uninitialized read in msghdr_copy
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jun  8 18:34:27 CEST 2016 on sn-devel-144
2016-06-08 18:34:27 +02:00
Amitay Isaacs
95c2cd10d7 lib/util: Add a generic definition for set_close_on_exec
Avoid changing function names to smb_set_close_on_exec in ctdb.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-06-08 10:33:19 +02:00
Andrew Bartlett
6888c172d3 build: Address may be used uninitialized in this function on Ubuntu 10.04
This is not found by modern compilers, but prevents the -Werror -O3 build on Ubuntu 10.04

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun  8 08:48:57 CEST 2016 on sn-devel-144
2016-06-08 08:48:57 +02:00
Andrew Bartlett
2a5183f49e build: Try to work around strict aliasing rules on Ubuntu 10.04
We get cc1: warnings being treated as errors
../lib/util/util_net.c: In function get_socket_port:
../lib/util/util_net.c:921: error: dereferencing pointer sa.106 does break strict-aliasing rules
../lib/util/util_net.c:921: note: initialized from here
../lib/util/util_net.c:925: error: dereferencing pointer sa.107 does break strict-aliasing rules
../lib/util/util_net.c:925: note: initialized from here

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-06-08 04:53:13 +02:00
Volker Lendecke
6d26d7253e lib: Add accept_send/recv
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-06-07 14:34:10 +02:00
Volker Lendecke
dd27469123 lib: Move poll_funcs to lib/
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-06-07 14:34:10 +02:00
Amitay Isaacs
2db6eb87b4 lib/util: Expose few more subsystems for standalone ctdb build
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-06-07 14:34:10 +02:00
Volker Lendecke
6dcf81a202 lib: Move msghdr to lib/util/
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-06-07 14:34:10 +02:00
Amitay Isaacs
2082c0c3b5 lib/util: Avoid splitting tevent-unix-util as public library
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11946

Commit 670db6ac1d split tevent-util public
library to create tevent-unix-util public library for standalone ctdb
use.  This created a public library dependency between samba and ctdb
for packaging.

Bundle tevent_unix.c in public library tevent-util as before.  However,
to avoid the dependencies for packaging, standalone ctdb build will
build tevent-util as a private library with only tevent_unix.c

This simplifies any new subsystems (or libraries) which need tevent-util
and are linked in both samba and ctdb.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-06-06 12:26:19 +02:00
Bob Campbell
5c008e0216 samba_dnsupdate: do not interpret failure count as unix error code
Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz>
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2016-06-03 07:27:22 +02:00
Lorinczy Zsigmond
8814b25565 lib: replace: snprintf - Fix length calculation for hex/octal 64-bit values.
Prevents truncation due to buffer size being too small.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11947

Signed-off-by: Lorinczy Zsigmond <lzsiga@freemail.c3.hu>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jun  3 03:48:58 CEST 2016 on sn-devel-144
2016-06-03 03:48:58 +02:00
Ralph Boehme
e8c9e10dbb talloc: rename local timeval function copies
timeval_current() and timeval_elapsed() are public functions from
libsamba-util. Redeclaring them as static functions here triggers linker
error when building with gcc link-time-optimisation (LTO).

This shows the error after reverting this patch:
[slow@kazak lto]$ make -j
WAF_MAKE=1 python ./buildtools/bin/waf build
Waf: Entering directory `/home/slow/git/samba/lto/bin'
        Selected embedded Heimdal build
[ 174/4259] Generating ctdb-samba-version-header
[ 174/4259] Generating ctdb-samba-version-header
[ 521/4259] Generating source4/torture/local/proto.h
[2565/4259] Compiling lib/talloc/testsuite.c
[4125/4259] Linking default/source4/torture/smbtorture
/tmp/ccvL9UCe.ltrans3.ltrans.o:<artificial>:function smbsrv_accept.lto_priv.11: error: undefined reference to 'timeval_current.lto_priv.630'
/tmp/ccvL9UCe.ltrans4.ltrans.o:<artificial>:function smbsrv_recv_smb2_request: error: undefined reference to 'timeval_current.lto_priv.630'
/tmp/ccvL9UCe.ltrans4.ltrans.o:<artificial>:function smb2srv_negprot_backend: error: undefined reference to 'timeval_current.lto_priv.630'
/tmp/ccvL9UCe.ltrans4.ltrans.o:<artificial>:function smb2srv_negprot_backend: error: undefined reference to 'timeval_current.lto_priv.630'
/tmp/ccvL9UCe.ltrans9.ltrans.o:<artificial>:function test_smb2_oplock_batch22: error: undefined reference to 'timeval_elapsed.lto_priv.628'
/tmp/ccvL9UCe.ltrans9.ltrans.o:<artificial>:function test_smb2_bench_oplock: error: undefined reference to 'timeval_elapsed.lto_priv.628'
/tmp/ccvL9UCe.ltrans9.ltrans.o:<artificial>:function test_smb2_bench_oplock: error: undefined reference to 'timeval_elapsed.lto_priv.628'
/tmp/ccvL9UCe.ltrans9.ltrans.o:<artificial>:function test_smb2_bench_oplock: error: undefined reference to 'timeval_elapsed.lto_priv.628'
collect2: error: ld returned 1 exit status
...

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jun  1 21:09:16 CEST 2016 on sn-devel-144
2016-06-01 21:09:16 +02:00
Andreas Schneider
af6bd055d4 rwrap: Update resolve_wrapper to version 1.1.4
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue May 31 20:13:43 CEST 2016 on sn-devel-144
2016-05-31 20:13:43 +02:00
Jeremy Allison
3b5e3ef9f2 lib: tevent: Use struct sockaddr_storage to cope with IPv6.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun May 29 09:13:30 CEST 2016 on sn-devel-144
2016-05-29 09:13:30 +02:00
Alexander Bokovoy
92b4b6b3c5 s3-smbd: Support systemd 230
systemd 230 version finally deprecated libsystemd-daemon/libsystemd-journal split
and put everything in libsystemd library.

Make sure HAVE_LIBSYSTEMD define is supported in the code (we already
have it defined by the waf).

Patch is based on the code proposed by Zbigniew Jędrzejewski-Szmek
from systemd project.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11936

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed May 25 20:25:44 CEST 2016 on sn-devel-144
2016-05-25 20:25:44 +02:00
Andreas Schneider
f85f4ce9cc swrap: Update to version 1.1.7
* Added support for accept4()
* Added support for OpenBSD
* Fixed sendto() with UDP and a connected socket
* Fixed AF_RAWLINK sockets

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri May 20 13:58:37 CEST 2016 on sn-devel-144
2016-05-20 13:58:37 +02:00
Volker Lendecke
c4504bd7e3 lib: Fix some whitespace
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-05-16 19:52:22 +02:00
Volker Lendecke
8c332f46e4 lib: Fix a signed/unsigned mixup
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-05-16 19:52:22 +02:00
Michael Adam
258360f1eb lib: add sys_write_v - void variant of sys_write
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2016-05-13 00:16:15 +02:00
Michael Adam
4680fe047a lib: add sys_read_v - void variant of sys_read
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2016-05-13 00:16:15 +02:00
Michael Adam
af83bc3920 debug: fix -O3 warning - unused return code of write()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2016-05-13 00:16:15 +02:00
Michael Adam
0e80775c1b tdb:torture: fix -O3 error unused result of write
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2016-05-13 00:16:15 +02:00
Michael Adam
a860245c4d tdb:torture: fix -O3 error unused result code of read
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2016-05-13 00:16:15 +02:00
Michael Adam
774087655d tevent:testsuite: fix O3 errors unused result of write
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2016-05-13 00:16:15 +02:00
Michael Adam
22918a033b tevent:testsuite: fix O3 errors unused result for read
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2016-05-13 00:16:15 +02:00
Michael Adam
1521e688b6 tevent:signal: fix -O3 error unused result of read
some compilers don't tolerate void-casting for warn_unused_result

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2016-05-13 00:16:15 +02:00
Michael Adam
24b267eb86 tevent:signal: fix -O3 error unused result of write
some compilers don't tolerate void-casting for warn_unused_result

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2016-05-13 00:16:15 +02:00
Michael Adam
149fa72770 tevent:threads: fix -O3 error unused result of write
some compilers don't tolerate void-casting for warn_unused_result

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2016-05-13 00:16:14 +02:00
Andrew Bartlett
15f191a232 ldb-samba: Add "secret" as a value to hide in LDIF files
This is not secret or encrypted in LDAP, but is sensitive in secrets.ldb

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Wed May 11 07:17:38 CEST 2016 on sn-devel-144
2016-05-11 07:17:38 +02:00
Douglas Bagnall
2ba83ae49b pytalloc: avoid double 0x0x in repr strings
The %p format puts one in itself.

Before: <drsblobs.repsFromTo2 talloc based object at 0x0x1b551e0>
After:  <drsblobs.repsFromTo2 talloc based object at 0x1b551e0>

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-05-10 01:43:15 +02:00
Andrew Bartlett
2f44f370d8 ldb: Fix error string when renaming to an DN that already exists
We were printing the DN renamed from, not the DN being renamed to.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2016-05-10 01:43:14 +02:00
Garming Sam
38e08d7174 typo: mplementation => implementation
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2016-05-06 05:03:16 +02:00
Stefan Metzmacher
83b64ae64b talloc: version 2.1.7
* Fix memory leak when destructors reparent children. (bug #11901)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May  5 22:33:04 CEST 2016 on sn-devel-144
2016-05-05 22:33:04 +02:00
Saji VR
d4d14b15b6 lib:talloc. Fix memory leak when destructors reparent children.
If a destructor reparents a child, we shouldn't exit the
loop freeing children as there may be others to process.

https://bugzilla.samba.org/show_bug.cgi?id=11901

Signed-off-by: Saji VR <saji.vr@nutanix.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May  5 08:33:53 CEST 2016 on sn-devel-144
2016-05-05 08:33:53 +02:00
Volker Lendecke
87fa3c36f3 lib: Avoid includes.h in base64.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-05-04 01:28:23 +02:00
Volker Lendecke
93b982faad lib: Give base64.c its own .h
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-05-04 01:28:23 +02:00
Volker Lendecke
9ec3332349 lib: Remove SMB_ASSERT from base64_encode_data_blob
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-05-04 01:28:23 +02:00
Volker Lendecke
f457535e33 lib: =0 and |= is equivalent to =
Just a small simplication I thought might be nice

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-05-04 01:28:23 +02:00
Volker Lendecke
a5fd779aa1 lib: The base64 chars are by definition single-byte :-)
Remove a dependency on charcnv

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-05-04 01:28:22 +02:00
Andrew Bartlett
5359031e33 ldb-samba: Use ndr_pull_struct_blob_all_noalloc
This avoids pointless talloc() calls in a hot code path.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Tue May  3 11:43:15 CEST 2016 on sn-devel-144
2016-05-03 11:43:15 +02:00
Günther Deschner
95b8b02062 lib:krb5_wrap:krb5_samba: increase debug level for smb_krb5_get_default_realm_from_ccache().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11872

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-04-28 16:51:16 +02:00
Robin Hack
f4181f25b4 ldb-samba/ldb_matching_rules: Fix CID 1349424 - Uninitialized pointer read
Fix unitialized 'visited' value (pointer to pointer) in
ldb_eval_transitive_filter() which passes 'visited' value later to
ldb_eval_transitive_filter_helper().

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 27 02:12:39 CEST 2016 on sn-devel-144
2016-04-27 02:12:39 +02:00
Robin Hack
b9ffb9322b talloc/testsuite: Fix CID 1291641 - Logically dead code
Add check for snprintf return code.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-04-26 22:48:21 +02:00
Petr Cech
32b1f78b23 LDB: Redudant test on NULL context remove
There is redudant test on NULL context in ldb_dn_new_fmt() function.
We use this (NULL) context in talloc_vasprintf() function which is
able to work with NULL at all. And at the end, we free this newly
created (by talloc_vasprintf) context. So it should be safe to remove
this check.

Signed-off-by: Petr Cech <pcech@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Apr 26 08:09:25 CEST 2016 on sn-devel-144
2016-04-26 08:09:25 +02:00
Richard Sharpe
81ca7eac3d Refactor the dns_open_connection code so that duplicate code is removed and ensure that EINTR is handled in the UDP path.
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-04-26 01:20:25 +02:00
Jérémie Courrèges-Anglas
53e0860122 Fix CHECK_CODE usage in atomics builtin detection
CHECK_CODE already wraps the code with main().  Adding another layer
results in a nested function, eg

  int main(void) { int main(void) { __sync_fetch_and_add(); } }

Since the inner function isn't called it is optimized out at cc -O2,
thus the linker doesn't fail if __sync_fetch_and_add() isn't available.

Issue noticed on OpenBSD/hppa.

Signed-off-by: Jérémie Courrèges-Anglas <jca@wxcvbn.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Apr 26 01:19:40 CEST 2016 on sn-devel-144
2016-04-26 01:19:40 +02:00
Ralph Boehme
35b2fb4ff3 krb5_wrap: fix keep_old_entries logic in smb_krb5_kt_seek_and_delete_old_entries()
This fixes an regression introduced in 5c5d586d3e at a higher level
in the caller smb_krb5_kt_add_entry(): calling smb_krb5_kt_add_entry
with keep_old_entries=false resulted in only one enctype per principal
remaining in the exported keytab.

The function smb_krb5_kt_seek_and_delete_old_entries() is called from
smb_krb5_kt_add_entry() when adding keys to a keytab. When the keytab
contains keys with the same kvno as the key to be added and
keep_old_entries is false, the key is deleted without checking the
encryption type of the key. This means that when adding keys for a
principal only the last enctype will be in the exported keytab.

Fix this by checking the encryption type and only treat a key as "old"
if keytab_key_kvno <= new_key_kvno and keytab_key_enctype ==
new_key_enctype.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-04-25 10:35:14 +02:00
Ralph Boehme
b26ae7fbf6 krb5_wrap: add enctype arg to smb_krb5_kt_seek_and_delete_old_entries()
Unused in this commit, the next commit will use it to avoid deleting
keys with the same kvno but a different enctype.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-04-25 10:35:14 +02:00
Jeremy Allison
d2e143708f lib: dns: Clean up allocated structure on error exit.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>
2016-04-22 07:20:17 +02:00
Andreas Schneider
ba6e39076b util: Add memcmp_const_time()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-04-19 09:37:14 +02:00
Stefan Metzmacher
f762be4343 CVE-2016-2118: docs-xml: default "allow dcerpc auth level connect" to "no"
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11616

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2016-04-12 19:25:28 +02:00
Stefan Metzmacher
06b038c017 CVE-2016-2118: docs-xml: add "allow dcerpc auth level connect" defaulting to "yes"
We sadly need to allow this for now by default.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11616

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-04-12 19:25:27 +02:00
Stefan Metzmacher
c52097ae17 CVE-2016-2115: docs-xml: always default "client ipc signing" to "mandatory"
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11756

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2016-04-12 19:25:27 +02:00
Ralph Boehme
b720575f16 CVE-2016-2115: s3:libsmb: add signing constant SMB_SIGNING_IPC_DEFAULT
SMB_SIGNING_IPC_DEFAULT must be used from s3 client code when opening
RPC connections.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11756

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-04-12 19:25:26 +02:00
Stefan Metzmacher
f65f618e96 CVE-2016-2115: docs-xml: add "client ipc signing" option
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11756

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-04-12 19:25:26 +02:00
Stefan Metzmacher
8ff6a955f5 CVE-2016-2115: docs-xml: add "client ipc min protocol" and "client ipc max protocol" options
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11796

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-04-12 19:25:26 +02:00
Stefan Metzmacher
6ad9ba72a7 CVE-2016-2113: docs-xml: let "tls verify peer" default to "as_strict_as_possible"
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11752

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2016-04-12 19:25:25 +02:00
Stefan Metzmacher
2362c0353b CVE-2016-2113: docs-xml: add "tls verify peer" option defaulting to "no_check"
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11752

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-04-12 19:25:25 +02:00
Stefan Metzmacher
6e22abd977 CVE-2016-2112: docs-xml: change the default of "ldap server require strong auth" to "yes"
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11644

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2016-04-12 19:25:25 +02:00
Stefan Metzmacher
0cd2acef79 CVE-2016-2112: docs-xml: add "ldap server require strong auth" option
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11644

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-04-12 19:25:25 +02:00
Stefan Metzmacher
1dc40a08f0 CVE-2016-2111: docs-xml/smbdotconf: default "raw NTLMv2 auth" to "no"
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11749

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2016-04-12 19:25:24 +02:00
Stefan Metzmacher
a1900b5bd6 CVE-2016-2111: docs-xml: add "raw NTLMv2 auth" defaulting to "yes"
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11749

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-04-12 19:25:24 +02:00
Volker Lendecke
e6ed803a3b tdb mutex check: Fix CID 1358473 Uninitialized scalar variable
This comes via a "goto cleanup" before suspend_mask is initialized

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Tue Apr 12 11:39:35 CEST 2016 on sn-devel-144
2016-04-12 11:39:34 +02:00
Stefan Metzmacher
acf6deb698 tdb: version 1.3.9
* avoid a race condition when checking for robust mutexes
  (bug #11808)
* Remove use of strcpy in tdb test.
* eliminate deprecation warnings in python tests
* Only set public headers field when installing as a public library.
* Refuse to load a database with hash size 0
* Fix various spelling errors

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Apr 11 18:48:26 CEST 2016 on sn-devel-144
2016-04-11 18:48:26 +02:00
Uri Simchoni
ef3d837040 tdb: rework cleanup logic in tdb_runtime_check_for_robust_mutexes()
The cleanup logic used six goto lables, at least I'm not able to make
sane modifications to such a beast.

By using state flags that track which objects are initialized and need
cleanup, we get rid of the goto labels. It comes at a cost though: you
have to be careful to correctly set the cleanup flags.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-04-11 15:22:26 +02:00
Volker Lendecke
ff6b49beeb nwrap: Fix the build on Solaris
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11816

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Apr  5 08:57:06 CEST 2016 on sn-devel-144
2016-04-05 08:57:06 +02:00
Jeremy Allison
0da76c9ab8 lib:replace: Missing semicolon on function definition.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sat Apr  2 06:04:13 CEST 2016 on sn-devel-144
2016-04-02 06:04:13 +02:00
Christof Schmitt
6a2d97b361 gpfswrap: Add wrapper for gpfs_set_winattrs
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-04-01 19:28:23 +02:00
Ralph Boehme
a7a77e2f43 tdb: avoid a race condition when checking for robust mutexes
This fixes a race between calling waitpid() in two places (SIGCHLD the
signal handler and the rendezvous code when waiting for the child to
terminate), by

- blocking SIGCHLD before installing our signal handler

- in the rendezvous code call sigssuspend() which unblocks SIGCHLD and
  suspends the thread and waits for signal delivery

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11808

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Mar 29 16:04:19 CEST 2016 on sn-devel-144
2016-03-29 16:04:19 +02:00
Uri Simchoni
644e697fab lib/util: fix function comment
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-03-28 20:45:16 +02:00
Douglas Bagnall
a20ee62984 tevent.h: use HAVE___ATTRIBUTE__ instead of __GNUC__
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-03-24 15:13:15 +01:00
Douglas Bagnall
6ba2fe2e3f libreplace: use HAVE___ATTRIBUTE__ instead of __GNUC__
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-03-24 15:13:15 +01:00
Douglas Bagnall
88be24c279 util/attr.h: use HAVE___ATTRIBUTE__, not __GNUC__ comparisons
The comparisons that look like

    #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )

fail if __GNUC_MINOR__ is 0.  The intended comparison is something
more like

    #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)

However, given that:

 * these checks are really trying to test the presence of
   __attribute__,

 * there are now credible compilers that are not GCC, which have
   __attribute__ but might not be good at emulating __GNUC__
   numbers, and

 * we really face little risk of running into GCC 2.95

 * we have a HAVE___ATTRIBUTE__ check in ./configure

let's not do the version comparisons.

(Untested on GCC 2.95, GCC 3.0 and GCC 3.1).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-03-24 15:13:15 +01:00
Douglas Bagnall
5e4f39ad60 ldb_controls: avoid unnecessary unchecked talloc_asprintf()s
The error paths when a control doesn't parse involved a lot of
talloc_asprintf()s and talloc_asprintf_append()s but almost no actual
printf formatting. The return values were not checked. This replaces
them with constant strings.

The one case that did use formatting looked like this:

 "invalid %s control syntax\n",  LDB_CONTROL_DIRSYNC_EX_NAME

and that has been replaced with

  "invalid dirsync_ex control syntax\n"

in line with the way it is done elsewhere.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-22 08:00:32 +01:00
Douglas Bagnall
bd6a0220f4 ldb controls: allow paged_search to use a cookie
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-22 08:00:32 +01:00
Douglas Bagnall
7bd06613da ldb client controls: don't ignore failed memdup
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-22 08:00:31 +01:00
Douglas Bagnall
578643fb36 ldb controls: don't ignore memory allocation failure
Thanks to Jeremy Allison for noticing this.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-22 08:00:31 +01:00
Garming Sam
cd594a3cb3 sort: enable custom behaviour on critical control
The sort module should simply return unsorted results when a sort is
unsupported but not critical. A similar custom behaviour should be
expected with VLV pagination when it is enabled.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-22 08:00:31 +01:00
Jeremy Allison
a559ac31f7 lib:tdb: Remove use of strcpy in tdb test.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-03-22 04:38:24 +01:00
Günther Deschner
c5c3f91c6f lib/torture: add torture_assert_u64_not_equal_goto macro
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-03-22 00:23:21 +01:00
Andreas Schneider
b9d93e7187 lib: Update nss_wrapper to version 1.1.3
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-03-22 00:23:20 +01:00
Andreas Schneider
9e8876a9d7 lib: Update uid_wrapper to version 1.2.1
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-03-22 00:23:20 +01:00
Andreas Schneider
092d6f9ec1 lib: Update socket_wrapper to version 1.1.6
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-03-22 00:23:20 +01:00
Douglas Bagnall
e806824fc8 ldb client controls: avoid talloc_memdup(x, y, (size_t)-1);
ldb_base64_decode() returns -1 if a string can't be parsed as base64,
and this is not the kind of value you want to use in talloc_memdup().

In these cases it can happen innocently if the strings are truncated
to fit in their buffers.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by:  Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Mar 19 00:56:42 CET 2016 on sn-devel-144
2016-03-19 00:56:42 +01:00
Volker Lendecke
a243a9012f lib: Fix CID 1356315 Dereference before null check
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-03-18 00:29:14 +01:00
Andreas Schneider
2467032a3e krb5-wrap: Use the principal returned by the KDC to create the ccache
We request a TGT in uppercase from the KDC. We turned on
canonicalization for that so the KDC returns the principal in lowercase
cause of this. As we use the uppercase prinicpal to create the ccache we
fail to find the tickets we need later because it is stored in the
incorrect case. You have to use the princial returned by the KDC here.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Sumit Bose <sbose@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-17 04:32:27 +01:00
Stefan Metzmacher
e55806e83e ldb-samba:wscript: python_samba__ldb depends on pyauth
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11789

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Mar 16 01:34:29 CET 2016 on sn-devel-144
2016-03-16 01:34:29 +01:00
Günther Deschner
2e2f81134c lib/socket/interfaces: Fix some uninitialied bytes.
Valgrind reports the following:

==26599== Syscall param ioctl(SIOCETHTOOL) points to uninitialised byte(s)
==26599==    at 0x7014707: ioctl (in /usr/lib64/libc-2.22.so)
==26599==    by 0x79D1585: query_iface_speed_from_name (interfaces.c:152)
==26599==    by 0x79D1BBA: _get_interfaces (interfaces.c:277)
==26599==    by 0x79D1E80: get_interfaces (interfaces.c:368)
==26599==    by 0x508A7E3: load_interfaces (interface.c:612)
==26599==    by 0x150B30: main (net.c:963)
==26599==  Address 0xffefff0d8 is on thread 1's stack
==26599==  in frame #1, created by query_iface_speed_from_name
(interfaces.c:130)
==26599==
==26599== Syscall param ioctl(SIOCETHTOOL) points to uninitialised byte(s)
==26599==    at 0x7014707: ioctl (in /usr/lib64/libc-2.22.so)
==26599==    by 0x79D15CC: query_iface_speed_from_name (interfaces.c:164)
==26599==    by 0x79D1BBA: _get_interfaces (interfaces.c:277)
==26599==    by 0x79D1E80: get_interfaces (interfaces.c:368)
==26599==    by 0x508A7E3: load_interfaces (interface.c:612)
==26599==    by 0x150B30: main (net.c:963)
==26599==  Address 0xffefff0d8 is on thread 1's stack
==26599==  in frame #1, created by query_iface_speed_from_name
(interfaces.c:130)

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-03-12 06:24:24 +01:00
Stefan Metzmacher
6400bbb5ee lib/util_net: add support for .ipv6-literal.net
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:26 +01:00
Stefan Metzmacher
771042a238 lib/util_net: move ipv6 linklocal handling into interpret_string_addr_internal()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:26 +01:00
Andreas Schneider
c2f5c30bea krb5_wrap: Add smb_krb5_open_keytab_relative() function
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-03-10 06:52:25 +01:00
Andreas Schneider
4e367288a5 krb5_wrap: Move smb_krb5_kt_add_entry() to krb5_wrap
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-03-10 06:52:25 +01:00
Andreas Schneider
1e1e12a825 s3-libads: Pass down the salt principal in smb_krb5_kt_add_entry()
This is a preparation to move smb_krb5_kt_add_entry() to krb5_wrap.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-03-10 06:52:25 +01:00
Douglas Bagnall
5d6a67e9de ldb sort: allow sorting on attributes not returned in search
The attribute is added to the search request, then peeled off again
before the sort module passes the results on.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-09 10:32:17 +01:00
Douglas Bagnall
577f972f45 ldb_controls: add base64 option to VLV
The Samba control syntax limits the range of valid search terms for
VLV's gt_eq mode. To get around that, we allow base64 encoded strings
using the syntax 'base64>=Zm9vCg==' rather than '>=foo'.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-09 10:32:16 +01:00
Douglas Bagnall
9bbd7d1c77 asn1: make readContextSimple() add a NUL byte
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-09 10:32:16 +01:00
Douglas Bagnall
16fda12282 ldb controls: use uint8_t* for contextID binary blob
It is never a readable string.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-09 10:32:16 +01:00
Douglas Bagnall
8ca1e349eb ASN1: use a talloc context in read_contextSimple
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-09 10:32:16 +01:00
Douglas Bagnall
177ca764fc vlv: better syntax for parsing greater than or equal strings
This makes the gt_eq case different from the indexed case in the eyes
of sscanf().

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-09 10:32:16 +01:00
Douglas Bagnall
78f8a89bdd ldb controls: better error string for VLV control
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-09 10:32:16 +01:00
Garming Sam
2973d4cd0f ldb controls: base64 encode VLV response context strings
Pair-programmed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-09 10:32:16 +01:00
Douglas Bagnall
182c87fb82 ldb paged_results: quieten a warning.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-09 10:32:16 +01:00
Andrew Bartlett
4c38e74d7c dsdb: Introduce LDB_SYNTAX_SAMBA_OCTET_STRING
The sort order for this function is more expected than the sort order for
ldb_comparsion_binary()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-09 10:32:16 +01:00
Douglas Bagnall
407c812b2a util/tests: add test for BINARY_ARRAY_SEARCH_V macro
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-09 10:32:16 +01:00
Douglas Bagnall
5235f1facf util/binsearch: macro for greater than or equal search
Sometimes you want to find the place where an item would be in a
sorted list, whether or not it is actually there.

The BINARY_ARRAY_SEARCH_GTE macro takes an extra 'next' pointer
argument over the other binsearch macros. This will end up pointing to
the next element in the case where there is not an exact match, or
NULL when there is. That is, searching the list

     { 2, 3, 4, 4, 9}

with a standard integer compare should give the following results:

search term    *result    *next
         1      -          2
         3      3          -
         4      4 [1]      -
         7      -          9
         9      9          -
        10      -          - [2]

Notes
[1] There are two fours, but you will always get the first one.
[2] The both NULL case means the search term is beyond the last list
item.

You can safely use the same pointer for both 'result' and 'next', if
you don't care to distinguish between the 'greater-than' and 'equals'
cases.

There is a torture test for this.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-09 10:32:16 +01:00
Andrew Bartlett
20417945fe pytalloc: Correct description of pytalloc_Get{Base,}ObjectType behaviour
Thanks to Jelmer for spotting the static variable that causes this odd behaviour

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Mar  8 05:14:15 CET 2016 on sn-devel-144
2016-03-08 05:14:15 +01:00
Andrew Bartlett
d850991ee2 pytalloc: Add pytalloc_BaseObject_PyType_Ready() wrapper
This avoids the need for the caller to set tp_base and tp_basicsize and
so removes those as possible errors.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:29 +01:00
Andrew Bartlett
d7bbcbc510 talloc: Bump version number
The removal of the macros and replacement with proper functions
is a API, but not ABI break.  Only code that incorrectly
used the structure either in function signatures or
to access the members directly will need to be modified
before being built against this version of talloc.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:26 +01:00
Andrew Bartlett
80f2b36efb pytalloc: Add new BaseObject
This new object not only avoids the ABI issues of talloc.Object
it stores one more pointer, being the start of the array, and
so can be used to fix the PIDL bindings/talloc refcount issue.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:26 +01:00
Stefan Metzmacher
528dce1b53 pytalloc: add a _pytalloc_get_type() helper function and generate PyExc_TypeError on mismatch
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:26 +01:00
Andrew Bartlett
42eae4dec6 talloc: add _pytalloc_get_ptr/_pytalloc_get_mem_ctx helper functions
This allows us to check which type is involved, and dereference
that type correctly

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:26 +01:00
Andrew Bartlett
cd8d930021 talloc: Improve testsuite by avoiding path issues
We now rely on waf to tell us where the helper binary is.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:26 +01:00
Andrew Bartlett
02de793e01 pyldb: Add warning about pyldb_MessageElement_AsMessageElement()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:25 +01:00
Andreas Schneider
b73235fb54 krb5_wrap: Do not use deprecated KRB5 functions
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Mar  7 17:57:39 CET 2016 on sn-devel-144
2016-03-07 17:57:39 +01:00
Volker Lendecke
1a724a8f67 lib: Avoid "includes.h" in dbwrap.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2016-03-06 16:21:12 +01:00
Volker Lendecke
ae41ea144a lib: Introduce SERVER_ID_BUF_LENGTH
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2016-03-06 16:21:12 +01:00
Michael Adam
366b51a8ff dbwrap: add dbwrap_purge[_bystring]
Variants of dbrwap_delete[_bysrting] that treats NOT FOUND
as success.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-03-01 21:50:24 +01:00
Michael Adam
d4408c495b dbwrap_util: improve a debug message in dbwrap_delete_action()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-03-01 21:50:23 +01:00
Volker Lendecke
1570ae0761 lib: Fix 1354521 Unchecked return value
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Tue Mar  1 21:49:44 CET 2016 on sn-devel-144
2016-03-01 21:49:44 +01:00
Martin Schwenke
e318babace lib/util: Add strv_util.[ch] containing new function strv_split()
strv_split() adds to a strv by splitting a string on separators.

Tests included.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-03-01 05:43:19 +01:00
Aurelien Aptel
2bd28d23fd lib/util/util.c: move null-check before use
moves a null pointer check *before* the pointer is used in
the strlen() call

- still allocate the `fname` array on the stack
- still compiles under C90 definition/code mixing rules

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar  1 02:25:22 CET 2016 on sn-devel-144
2016-03-01 02:25:22 +01:00
Martin Schwenke
7105e171f0 lib/util: Add tests for strv_addn()
Also some other minor test cleanups.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Feb 29 15:18:17 CET 2016 on sn-devel-144
2016-02-29 15:18:17 +01:00
Volker Lendecke
0133ed4c22 lib/util: Add strv_addn()
strv_addn() adds some number of characters from an existing string.
This is useful for parsing.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-02-29 11:55:23 +01:00
Martin Schwenke
049e47b443 Revert "lib/util: Expose strv_addn() for adding string with specified length"
This reverts commit 0c61dd1513.

The intention of strv_addn() is to be able to add some number of
characters from an existing string.  This implementation carelessly
assumes that the old _strv_append() added the trailing NUL to form a
valid strv.  That's not true.

New implementation to follow.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-02-29 11:55:23 +01:00
Martin Schwenke
f3ea162488 lib/util: Add tests for strv
These are blackbox tests against most of the API.

It would be possible to write tests that check the internals of the
strv are as expected but that probably doesn't add much value.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-26 19:27:08 +01:00
Aurelien Aptel
0d08af70c8 lib/util/idtree.c: fix UB by using uint in left-shift
Using negative values on the left-side of a left-shift operation is an
Undefined Behaviour in C.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2016-02-26 19:27:08 +01:00
Martin Schwenke
0c61dd1513 lib/util: Expose strv_addn() for adding string with specified length
This is just a rename of previously static function _strv_append().

strv is now more useful for parsing.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Feb 25 13:43:31 CET 2016 on sn-devel-144
2016-02-25 13:43:31 +01:00
Volker Lendecke
737780384c lib: Move data_blob_list_item to source4
It's only used in dcesrv_call_state.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-23 22:03:16 +01:00
Stefan Metzmacher
da74d0c317 tevent: version 0.9.28
* Fix memory leak when old signal action restored (bug #11742)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Feb 19 19:12:25 CET 2016 on sn-devel-144
2016-02-19 19:12:25 +01:00
Jeremy Allison
833a2f4743 lib: tevent: Fix memory leak reported by Pavel Březina <pbrezina@redhat.com> when old signal action restored.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11742

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Feb 18 01:42:50 CET 2016 on sn-devel-144
2016-02-18 01:42:50 +01:00
Stefan Metzmacher
fb705e19e8 ldb: version 1.1.26
* let a timeout of -1 indicate no timeout for a given request
* fix memory leaks in pyldb ldb.search()
* build fixes
* improve pyldb ldb.search() help message
* add pyldb ldb.search_iterator() api
* add LDB_ATTR_FLAG_FORCE_BASE64_LDIF as optional argument
  to ldb_schema_attribute_add()
* add client support for LDB_CONTROL_DIRSYNC_EX

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-02-17 03:43:23 +01:00
Stefan Metzmacher
ad2b5fae7f ldb: add support for LDB_CONTROL_DIRSYNC_EX
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-02-17 03:43:23 +01:00
Stefan Metzmacher
f721f27da5 ldb: add LDB_ATTR_FLAG_FORCE_BASE64_LDIF support
This can be used to force ldb_write_ldif() to use base64 for
a specific attribute.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-02-17 03:43:23 +01:00
Michael Adam
6c8ab59d06 pyldb: eliminate warnings from python api test
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-02-17 03:43:23 +01:00
Stefan Metzmacher
13e981d3d8 pyldb: add api tests for search_iterator()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-02-17 03:43:23 +01:00
Stefan Metzmacher
77ca07801c pyldb: add ldb.search_iterator()
This is able to handle async requests, e.g. with a notification control
and processes results as they arrive instead of waiting for all results
before returning.

search_handle = ldb.search_iterator(...)

for e in search_handle:
    if not isinstance(msg, ldb.Message):
        # referral
        continue

    name = e["name"][0]

result = search_handle.result()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-02-17 03:43:23 +01:00
Stefan Metzmacher
e96fa7b10c pyldb: fix help message for ldb.search()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-02-17 03:43:23 +01:00
Stefan Metzmacher
2c2a2540f4 pyldb: fix memory leak in py_ldb_search()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-02-17 03:43:22 +01:00
Andrew Bartlett
e7bdd30be5 pyldb: Free correct context when pyldb_Object_AsDn() fails
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-02-17 03:43:22 +01:00
Stefan Metzmacher
2b1cd4a114 ldb: allow a timeout of -1 result in no timeout timer at all.
This is required in order to have long running async searches,
e.g. with LDB_CONTROL_NOTIFICATION_OID.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-02-17 03:43:22 +01:00
Stefan Metzmacher
5db9f865bc ldb-samba: fix the timeout setup in ildb_request_send()
We need to use the startime as reference not the current time.

We also allow timeout == -1 to indicate no timeout at all.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-02-17 03:43:22 +01:00
Michael Adam
3330c79324 tdb: eliminate deprecation warnings in python tests
assertEquals() is superseded by assertEqual()

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 Feb 16 19:58:39 CET 2016 on sn-devel-144
2016-02-16 19:58:39 +01:00
Stefan Metzmacher
2267faddfa tevent: version 0.9.27
* Fix bug in poll backend - poll_event_loop_poll()
  exits the for loop on POLLNVAL instead of
  continuing to find an event that is ready.
* Fix ETIME handling for Solaris event ports (bug #11728).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Feb 16 00:00:51 CET 2016 on sn-devel-144
2016-02-16 00:00:51 +01:00
Stefan Metzmacher
8adf470af2 ldb:ABI: add missing pyldb-util.py3-1.1.25.sigs
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-15 11:13:28 +01:00
Anoop C S
9fb98e3e05 lib/socket: Fix improper use of default interface speed
_get_interfaces() function from interfaces.c uses if_speed
variable to store interface speed and is initialized with a
default value at start. But if_speed populated via one
iteration for a specific IP address will be treated as the
default value for next iteration which is wrong. Therefore
change is to move the initialization cum declaration of
if_speed inside iteration of IP addresses loop.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11734

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sat Feb 13 16:22:22 CET 2016 on sn-devel-144
2016-02-13 16:22:22 +01:00
Michael Adam
8b36428b19 lib:socket: fix CID 1350009 - illegal memory accesses (BUFFER_SIZE_WARNING)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11735

Pair-Programmed-With: Guenther Deschner <gd@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-02-13 13:14:13 +01:00
Andreas Schneider
c55e8f2a1a util: Update GPL header of talloc_stack.h
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-02-12 09:01:14 +01:00
Volker Lendecke
d66f2c86f7 param: Fix str_list_v3 to accept ; again
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Feb 11 19:19:55 CET 2016 on sn-devel-144
2016-02-11 19:19:55 +01:00
Ralph Boehme
574313a1e1 lib/tsocket: workaround sockets not supporting FIONREAD
Netlink sockets don't support querying pending bytes with ioctl(fd,
FIONREAD, ...) and would return EOPNOTSUPP, so use recvmsg() with
MSG_PEEK|MSG_TRUNC as a fallback.

The MSG_TRUNC flag to recvmsg() is Linux only, but netlink is as well,
so we're safe for now.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11714

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Feb 10 10:30:24 CET 2016 on sn-devel-144
2016-02-10 10:30:23 +01:00
Jeremy Allison
1d26012ce8 asn1: Ensure asn1_tag_remaining() only ever returns -1 as an error condition.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Feb 10 01:38:03 CET 2016 on sn-devel-144
2016-02-10 01:38:03 +01:00
Jeremy Allison
697088ef16 asn1: Make asn1_peek_tag_needed_size() use the same overflow protection as asn1_start_tag().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-02-09 22:29:12 +01:00
Volker Lendecke
f60f7a62e2 asn1: Protect against overlong tag lengths
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-09 22:29:11 +01:00
Nathan Huff
4953b1f73f Fix ETIME handling for Solaris event ports.
It is possible for port_getn to return -1 with errno set to ETIME and
still return events. If those events aren't processed the association is
lost by samba since the kernel dissacociated them and samba never
processed them so never reassociated them with the event port. The
patch checks the nget return value in the case of ETIME and if it is non
0 it doesn't return and goes through the event processing loop.

Signed-off-by: Nathan Huff <nhuff@acm.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sun Feb  7 11:26:35 CET 2016 on sn-devel-144
2016-02-07 11:26:35 +01:00
Michael Adam
d44f488317 ldb: remove outdated comment about type argument in dlist
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:18 +01:00
Michael Adam
310da05710 tevent: remove outdated comment about type argument in dlist
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:18 +01:00
Michael Adam
025c59db06 dlist: remove outdated comment about type argument
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:18 +01:00
Michael Adam
2fd63ec80a dlist: remove unneeded type argument from DLIST_CONCATENATE()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:18 +01:00
Michael Adam
0f6c00b6ae tevent: remove unneeded type argument from DLIST_CONCATENATE()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:18 +01:00
Michael Adam
1441824fe6 ldb: remove unneeded argument type from DLIST_CONCATENATE()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:17 +01:00
Michael Adam
be2a341d43 tevent: remove uneeded type argument from DLIST_DEMOTE()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:17 +01:00
Michael Adam
a1c5d662d4 ldb: remove uneeded type argument from DLIST_DEMOTE()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:17 +01:00
Michael Adam
d6f5fc8c2d dlist: remove unneeded argument from DLIST_DEMOTE()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:17 +01:00
Michael Adam
66af807fc4 ldb: remove unneeded type arg from DLIST_ADD_END
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:17 +01:00
Michael Adam
a091c0ac68 tevent: remove unneeded type argument from DLIST_ADD_END
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:17 +01:00
Michael Adam
476672b647 dlist: remove unneeded type argument from DLIST_ADD_END()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:17 +01:00
Martin Schwenke
3e30998ffb util: Move util_strlist.c into samba-util-core
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-02-05 09:00:20 +01:00
Martin Schwenke
c1a75ab5a4 util: Make util_strlist.c standalone with its own header file
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-02-05 09:00:20 +01:00
Martin Schwenke
c4c1592408 util: Split str_list_make_v3() into separate file
str_list_make_v3() calls next_token_talloc(), which has deep
dependencies, so can't be used without dragging in a lot of code.  The
other functions in this file are generally useful and have minimal
dependencies.

So leave the easily reusable code and split out the more difficult
stuff.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-02-05 09:00:20 +01:00
Michael Adam
498383afef lib:socket: fix CID 1350010 - integer OVERFLOW_BEFORE_WIDEN
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Feb  4 00:35:11 CET 2016 on sn-devel-144
2016-02-04 00:35:10 +01:00
Volker Lendecke
372bf525bf asn1: Fix whitespace
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2016-02-03 15:04:11 +01:00
Volker Lendecke
e46e030ee2 asn1: Simplify _ber_read_OID_String_impl
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2016-02-03 15:04:11 +01:00
Volker Lendecke
d56e42de64 ldb: Avoid a "talloc_steal"
There's only one caller of "next_chunk" that does a talloc_steal right
after the call. Pass in a talloc context.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2016-02-03 15:04:11 +01:00
Volker Lendecke
11c5513bb1 ldb: Fix some whitespace
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2016-02-03 15:04:11 +01:00
Uri Simchoni
f0c43ceec5 dbwrap_file: fix use of read_data()
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 27 00:09:05 CET 2016 on sn-devel-144
2016-01-27 00:09:05 +01:00
Uri Simchoni
798fcfdabc loadparm: introduce lp_parm_ulonglong() and lpcfg_parm_ulonglong()
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-01-26 15:58:11 +01:00
Anoop C S
549a9abc7e lib:socket: detect link speed with ethtool ioctl in get_interfaces (on linux)
Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-01-26 07:33:16 +01:00
Michael Adam
1862aa6c25 build: detect support for ethtool
Pair-Programmed-With: Anoop C S <anoopcs@redhat.com>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-01-26 07:33:16 +01:00
Michael Adam
64be8e73ff lib:socket: set defaults for linkspeed and capability in get_interfaces()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-01-26 07:33:16 +01:00
Michael Adam
235f37baa7 lib:socket: get interface index from kernel
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-01-26 07:33:16 +01:00
Michael Adam
d392e0a66d lib:socket: add linkspeed, capability and if_index to iface_struct
Pair-Programmed-With: Anoop C S <anoopcs@redhat.com>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-01-26 07:33:16 +01:00
Adrian Cochrane
594778e580 ldb-samba: Expand testing of recursive search
Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jan 18 07:49:43 CET 2016 on sn-devel-144
2016-01-18 07:49:43 +01:00
Adrian Cochrane
10e32377a4 ldb-samba: Correct error reporting to match Windows
In some cases instead of replying with an error Windows instead returns
0 results.

Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-01-18 04:42:21 +01:00
Adrian Cochrane
a52bcaaf20 ldb-samba: critical bugfix on original recursive search implementation
In the original patch (listed previously), when the search recurses it
will inevitably reallocate the visited list to a new array in memory.
When this happens the original patch didn't update it's reference to the
array.

This patch adds an extra level of indirection on the visited list in
order to fix this bug.

Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-01-18 04:42:21 +01:00
Samuel Cabrero
177ac584c9 ldb-samba: Implement transitive extended matching
Documented in [MS-ADTS] section 3.1.1.3.4.4.3 LDAP_MATCHING_RULE_TRANSITIVE_EVAL

This allows a search filter such as:

 member:1.2.840.113556.1.4.1941:=cn=user,cn=users,dc=samba,dc=example,dc=com

This searches not only the member attribute, but also any member
attributes that point at an object with this member in them.  All the
various DN syntax types are supported, not just plain DNs.

Signed-off-by: Samuel Cabrero <samuelcabrero@kernevil.me>
(abartlet: Fixed compile error: return makes integer from pointer without a cast)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

(returned to Samba by revert of
dc2d5ccd56, returning the original
commit 2a22ba34cd)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-01-18 04:42:21 +01:00
Volker Lendecke
d1235c79ec ldb: Fix CID 1348110 Uninitialized scalar variable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 15 07:12:06 CET 2016 on sn-devel-144
2016-01-15 07:12:06 +01:00
Justin Maggard
8c2609f318 Change default LDAP page size to 1000.
This matches Windows' Active Directory maximum page size.

Signed-off-by: Justin Maggard <jmaggard@netgear.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-01-15 00:54:26 +01:00
Volker Lendecke
f7583be442 asn1: Make asn1_peek_tag_needed_size static
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-01-13 07:48:31 +01:00
Volker Lendecke
2aa1cf48fc asn1: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-01-13 07:48:31 +01:00
Jelmer Vernooij
da8674c72a Rename 'errors' to 'samba-errors' and make it public.
This is necessary because it has public headers.

Signed-off-by: Jelmer Vernooij <jelmer@jelmer.uk>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-By: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Wed Jan 13 07:47:04 CET 2016 on sn-devel-144
2016-01-13 07:47:04 +01:00
Jelmer Vernooij
ffbd9c4584 Add a new header file for functions in lib/util/util.c.
This allows public headers to not include samba_util.h, but rather
specific header files under lib/util.

Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-By: Stefan Metzmacher <metze@samba.org>
2016-01-13 04:43:23 +01:00
Jelmer Vernooij
773cfba9af Avoid including libds/common/roles.h in public loadparm.h header.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-By: Stefan Metzmacher <metze@samba.org>
2016-01-13 04:43:23 +01:00
Jelmer Vernooij
ce32f26647 ldb: Only set public headers field when installing as a public library.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-By: Stefan Metzmacher <metze@samba.org>
2016-01-13 04:43:23 +01:00
Jelmer Vernooij
1860e98d31 time_basic.h: Remove unnecessary dependency on replace.h
Forward declare struct timeval

Signed-off-by: Jelmer Vernooij <jelmer@jelmer.uk>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-By: Stefan Metzmacher <metze@samba.org>
2016-01-13 04:43:23 +01:00
Jelmer Vernooij
2f7dde3af7 Make libtorture private, for now.
Signed-Off-By: Jelmer Vernooij <jelmer@jelmer.uk>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-By: Stefan Metzmacher <metze@samba.org>
2016-01-13 04:43:23 +01:00
Jelmer Vernooij
5d67d555f0 talloc: Only set public headers field when installing as a public library.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
2016-01-13 04:43:23 +01:00
Jelmer Vernooij
68a3576629 tdb: Only set public headers field when installing as a public library.
Signed-Off-By: Jelmer Vernooij <Jelmer@samba.org>
2016-01-13 04:43:22 +01:00
Jelmer Vernooij
2cba4918db tevent: Only set public headers field when installing as a public library.
Signed-off-by: Jelmer Vernooij <jelmer@jelmer.uk>
2016-01-13 04:43:22 +01:00
Martin Schwenke
7c4d802370 talloc: Fix a documentation typo
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jan 11 18:34:53 CET 2016 on sn-devel-144
2016-01-11 18:34:53 +01:00
Michael Adam
7cec3092ff nss_wrapper: bump version to 1.1.2
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Jan 11 15:30:49 CET 2016 on sn-devel-144
2016-01-11 15:30:49 +01:00
Andreas Schneider
da292b6062 nwrap: Fix segfaults while reloading hosts file
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:32 +01:00
Andreas Schneider
19b2dcbeb2 nwrap: Don't fail if we want to add an existing entry
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:32 +01:00
Andreas Schneider
9b7902090d nwrap: Fix the build on Solaris
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:32 +01:00
Andreas Schneider
5f621977fd nwrap: Don't leak memory from gethostbyname*() functions
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:32 +01:00
Andreas Schneider
b54bbb2b83 nwrap: Fix the build on FreeBSD
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:32 +01:00
Michael Adam
766e795518 nwrap: fix a copy and paste error in the destructor.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-01-11 12:25:32 +01:00
Andreas Schneider
554963d887 nwrap: Cleanup shadow getspnam() memory
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:32 +01:00
Michael Adam
159fdb0185 nwrap: fix leaking the entlists
Track the list heads in a vector in the newrap_he_global
struct and free the structures upon nwrap_he_unload.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-01-11 12:25:32 +01:00
Michael Adam
bf496153bc nwrap: catch error to add item to vector in nwrap_he_parse_line()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-01-11 12:25:32 +01:00
Michael Adam
736fa61a95 nwrap: rename nwrap_he.entdata to nwrap_he.entries
That's what is is the list of entries. In the guise
nwrap_entdata structures but the code reads more
naturally this way.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-01-11 12:25:32 +01:00
Michael Adam
e94a7c5a56 nwrap: remove unused member list from struct nwrap_he
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-01-11 12:25:31 +01:00