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

5079 Commits

Author SHA1 Message Date
Petr Viktorin
d584d5ee2a pyldb: Split text/byte strings for compatibility with Python 3
Compatibility with Python 2, and backwards compatibility on Python 2,
is kept.

Under Python 3, DNs, attribute names, filters, controls are always text
(unicode) strings, encoded to/from UTF-8 for storage.
Attribute values are byte strings.

When creating DNs and attribute values, both text and bytes are accepted.
This allows creating messages from homogeneous dicts.

LDB Messages and MessageElements have a .text attribute, which offers
a text view on the contents: any value retrieved from it will be a text
string. The wrapper is implemented in a new Python module.

Thanks to Stefan Metzmacher for const warning fixes

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-11-05 18:04:24 +01:00
Petr Viktorin
0b384f60dd pyldb: Modernize test suite
This gets rid of deprecation warnings for the old method names.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 18:04:24 +01:00
Petr Viktorin
b509cbd8fc pyldb: Add Python 3 compatibility (except strings)
- Use a macro for adding constants to module
(This also ensures that the Python constants have the same
name as the C ones. One existing misspelling is retained.)

- Use new module initialization for Python 3

- Use rich comparison for ldb objects

- Prepare tests for Python 3

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 18:04:24 +01:00
Petr Viktorin
a04cfaa179 pyldb: DECREF old debug function when resetting it
Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 18:04:24 +01:00
Petr Viktorin
2e298c131e pyldb: Don't use the internal macro PyObject_REPR
Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 18:04:24 +01:00
Petr Viktorin
7935796c48 pyldb: Properly increase refcount of returned values
Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 18:04:24 +01:00
Petr Viktorin
c54fc3f2b6 ldb: Run the Python testsuite
Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 18:04:23 +01:00
Stefan Metzmacher
9884a8fa58 tevent: version 0.9.26
* New tevent_thread_proxy API
* Minor build fixes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 18:04:23 +01:00
Jeremy Allison
68077c617b lib: tevent: docs: Add tutorial on thread usage.
Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
2015-11-05 18:04:23 +01:00
Jeremy Allison
a132320b4c lib: tevent: tests: Add a second thread test that does request/reply.
Both tests run cleanly with valgrind --tool=drd and
valgrind --tool=helgrind

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
2015-11-05 18:04:23 +01:00
Jeremy Allison
187aebb25b lib: tevent: Initial test of tevent threaded context code.
Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
2015-11-05 18:04:23 +01:00
Jeremy Allison
49bddd8e47 lib: tevent: Initial checkin of threaded tevent context calling code.
Adds 2 new functions:

struct tevent_thread_proxy *tevent_thread_proxy_create(
                struct tevent_context *dest_ev_ctx);

void tevent_thread_proxy_schedule(struct tevent_thread_proxy *tp,
		struct tevent_immediate **pp_im,
		tevent_immediate_handler_t handler,
		void *pp_private_data);

Brief doc included. Tests, docs and tutorial to follow.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 18:04:23 +01:00
Stefan Metzmacher
bb0050a332 tdb: version 1.3.8
* Fix broken build with --disable-python
* Minor build fixes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 18:04:23 +01:00
Stefan Metzmacher
4f6eb58381 talloc: version 2.1.5
* Minor build fixes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 18:04:23 +01:00
Andreas Schneider
fae40ec5b4 uwrap: Bump version to 1.2.0
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Nov  5 12:30:02 CET 2015 on sn-devel-104
2015-11-05 12:30:02 +01:00
Andreas Schneider
2dae19c43b uwrap: Fix build warning with release build
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 09:23:16 +01:00
Andreas Schneider
3328bcede7 uwrap: Add the EINVAL check to setegid()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 09:23:16 +01:00
Andreas Schneider
6e30b2e638 uwrap: Allow setgid calls only for privileged users
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 09:23:16 +01:00
Andreas Schneider
be0cb8ab4d uwrap: Allow setregid calls only for privileged users
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 09:23:16 +01:00
Andreas Schneider
6b388799e1 uwrap: Allow setresgid calls only for privileged users
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 09:23:16 +01:00
Andreas Schneider
2232db8173 uwrap: Move the EINVAL check down in seteuid()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 09:23:16 +01:00
Andreas Schneider
56970b467b uwrap: Allow setuid calls only for privileged users
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 09:23:16 +01:00
Andreas Schneider
253f42c837 uwrap: Allow setreuid calls only for privileged users
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 09:23:16 +01:00
Andreas Schneider
5a9c80da7f uwrap: Allow setresuid calls only for privileged users
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 09:23:15 +01:00
Andreas Schneider
656f0db652 uwrap: Fix a possible null pointer dereference
If uid_wrapper is loaded but not enabled (UID_WRAPPER environment
variable not set), then we dereference a NULL pointer while forking.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 09:23:15 +01:00
Andreas Schneider
aad7019e2d uwrap: Improve debug output
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 09:23:15 +01:00
Andreas Schneider
8922654f84 uwrap: Fix debug line in uwrap_init()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 09:23:15 +01:00
Felix Janda
89d254ddca lib/replace: Make sure that replacement strto[u]ll does not reset errno unexpectedly
Fix the replacement functions for strtoll and strtoull to not set errno
to 0 if errno is EINVAL before calling, strto[u]ll does not modify errno
and the base is ok.

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

Signed-off-by: Felix Janda <felix.janda@posteo.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-10-31 22:03:14 +01:00
Felix Janda
8343c70753 lib/replace: Replace BSD strtoull by wrapping strtoull instead of strtouq
Same as commit e50bf6d537 but for strtoull
instead of strtoll.

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

Signed-off-by: Felix Janda <felix.janda@posteo.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-10-31 22:03:14 +01:00
Volker Lendecke
6404c07266 ldb: Fix a "ignoring return value" warning
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): Wed Oct 28 19:04:15 CET 2015 on sn-devel-104
2015-10-28 19:04:15 +01:00
Volker Lendecke
58418df679 lib: dbwrap_local_open references loadparm_context
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-10-28 16:00:20 +01:00
Jeremy Allison
859e3415b3 lib: util: Make non-critical message a warning.
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>
2015-10-28 09:45:09 +01:00
Thomas Nagy
84b7a9f939 build:wafsamba: dead code removal in gettext detection
Since the --gettext-location command-line option has no effect, the misleading
code is removed. The samba functions ADD_CFLAGS must also be used in the future

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Oct 27 03:34:28 CET 2015 on sn-devel-104
2015-10-27 03:34:28 +01:00
Andrew Bartlett
1c02f2801e ldb: Fix python bindings to accept a string as a DN
This fixes add_base(), add_child() and is_child_of().

This removes a toally incorrect cast of struct ldb_dn to struct ldb_context.

A helper routine is used instead

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:21 +01:00
Tom Schulz
c466ad47d5 texpect: undefined symbol rep_fprintf
Add libreplace dependency to texpect, fixes a linking error on Solaris.

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

Signed-off-by: Tom Schulz <schulz@adi.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Oct 22 14:28:17 CEST 2015 on sn-devel-104
2015-10-22 14:28:17 +02:00
Ralph Boehme
3e705adcab lib/tsocket: fix non-blockging connect() error handling
Non-blockging connect() either returns immediate success, or -1 with
errno EINPROGESS as indication that the connection is pending. All other
errnos indicate immediate failure.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-10-21 23:13:17 +02:00
Christof Schmitt
b041a589ae Remove function name from callers of DBG_*
It is now added automatically.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-21 23:13:17 +02:00
Christof Schmitt
1d3df7e18d debug: Prefix messages from DBG_* with function name
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-21 23:13:17 +02:00
Andrew Bartlett
7cf45539da selftest: Fix memset parameters in test for async_connect_send()
This fixes:

../lib/async_req/async_connect_send_test.c: In function ‘main’:
../lib/async_req/async_connect_send_test.c:88:3: error: ‘memset’ used with constant zero length parameter; this could be due to transposed parameters [-Werror=memset-transposed-args]
   memset(&addr, sizeof(addr), 0);
   ^
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11564

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Oct 21 17:31:00 CEST 2015 on sn-devel-104
2015-10-21 17:31:00 +02:00
Ralph Boehme
05d4dbda83 async_req: fix non-blocking connect()
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>
2015-10-20 20:22:22 +02:00
Ralph Boehme
aa96c75346 selftest: add a test for async_connect_send()
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>
2015-10-20 20:22:22 +02:00
Andrew Bartlett
2bad085305 build: Build *_wrapper without -DNDEBUG for in-tree use
These binaires are not installed, so are only used in make test,
and there we need debug output.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Oct 16 16:36:22 CEST 2015 on sn-devel-104
2015-10-16 16:36:22 +02:00
Volker Lendecke
e73ccc06ef Rely on /dev/urandom
This removes quite a bit of code. All reasonable systems have /dev/urandom
these days. Linux, Solaris and the BSDs do.  In case we find a system
without /dev/urandom, we will have to go hunting in other libraries.

The main reason for this is speed: On Ubuntu 14.04 doing direct reads from
/dev/urandom is 2-3 times faster than our md4 based code. On virtualized
FreeBSD 10 the difference is even larger.

My first approach was to use fopen/fread. It was even faster, but less
than twice as fast. So I thought we could save the additional complexity
when having to deal with throwing away buffers when forking and the
additional memory footprint per process.

With this simple generate_random_buffer it will be easier to adapt new
syscalls to get randomness.

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): Tue Oct 13 04:25:39 CEST 2015 on sn-devel-104
2015-10-13 04:25:38 +02:00
Volker Lendecke
5380f7b636 lib: Add a little tool to perftest generate_random_buffer()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-13 01:23:07 +02:00
Volker Lendecke
258ce91f31 lib: Move sys_rw* to lib/util
genrand.c will require it soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-13 01:23:07 +02:00
Volker Lendecke
b5cf80a7b5 talloc: Fix the O3 developer build
Compilers can't see that the child exits. Thus "exit_status" is
used uninitialized in the child.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-10-12 14:02:11 +02:00
Adrian Cochrane
7b6d1a2a5d talloc: Test that talloc magic differs between processes.
Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct  9 23:15:06 CEST 2015 on sn-devel-104
2015-10-09 23:15:06 +02:00
Adrian Cochrane
2b9bfab36d talloc: Increment minor version due to added talloc_test_get_magic.
Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-09 20:14:07 +02:00
Adrian Cochrane
906a26a2ab talloc: Provide tests access to talloc_magic
Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-09 20:14:07 +02:00
Adrian Cochrane
f5135bda94 talloc: Test magic protection measures.
Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-09 20:14:07 +02:00
Andrew Bartlett
4a4664a80e lib/talloc: Provide multiple-loading detection for libtalloc via rand()
The use of rand() is strongly discrouanged, but here is it ideal, as we just want to select a different
set of random bytes if we are called again within the same process.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-09 20:14:06 +02:00
Andrew Bartlett
30ea897194 lib/talloc: Disrupt buffer overflow attacks on Samba by using random magic
By setting the talloc magic to a random value, we make it much harder to overwrite a talloc_chunk
in a valid way with a simple buffer overflow.

The flags are placed before more senstive variables so they have to be overwritten first.

Inspired by the exploit in: http://blog.csnc.ch/wp-content/uploads/2012/07/sambaexploit_v1.0.pdf

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-09 20:14:06 +02:00
Andrew Bartlett
1dc05386f2 build: Move __attribute__ ((destructor)) and ((constructor)) tests to wafsamba
This allows us to use them in talloc as well.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-09 20:14:06 +02:00
Amitay Isaacs
670db6ac1d lib/util: Create a new library for tevent_unix.c
This is required for ctdb.  This avoids adding dependency on wstatus
and ntstatus to ctdb build.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-10-07 14:53:28 +02:00
Volker Lendecke
b191632701 lib: Fix the build on Solaris
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-10-01 02:55:21 +02:00
Volker Lendecke
d9000cbc94 libreplace: Fix the build on Solaris
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-10-01 02:55:21 +02:00
Volker Lendecke
22c5699751 lib: Fix server_id_db_set_exclusive
For server_id_db_set_exclusive we need to store the unique id along
with the vnn:pid combo. I had tested all this just with some
smbtorture and net command tests, all of which have a unique id of
zero. When trying to exclusively register "notify-daemon" when smbd
is running, this fails because serverid_exists only tests with zero
unique id. notifyd does have a non-zero unique id, so server_id_exists
will think the existing notifyd is another non-samba process that
happened to claim notifyd's pid.

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): Thu Oct  1 02:53:58 CEST 2015 on sn-devel-104
2015-10-01 02:53:58 +02:00
Volker Lendecke
2c12b516a9 lib: Add "pid/unique" format for server_id_from_string
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 23:51:13 +02:00
Volker Lendecke
a4f64500a5 lib: Fix server_id_from_string
sscanf overwrites vars as numbers come in. So the first sscanf will
overwrite "vnn", although it can't scan the whole thing. This leads
to the string "1234" return .vnn=1234, pid=1234. Bad.

While there, save the temp variables. The SCNu32/64 thingies look
ugly, but it's actually c99.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 23:51:13 +02:00
Volker Lendecke
8044e2dcc0 lib: Add server_id_str_buf_unique
A representation including the unique id

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 23:51:13 +02:00
Volker Lendecke
dea49cc7c0 ldb: Fix CID 1034781 Unsigned compared against 0
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 23:51:12 +02:00
Christof Schmitt
6788a5f449 lib: Fix prctl detection for prctl_set_comment
Include config.h to make HAVE_PRCTL available for the precompile check.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-09-24 08:00:16 +02:00
Volker Lendecke
9964d60e3e dbwrap: Make dbwrap_db_id return size_t
This will make an on-stack db-id easier

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-09-22 04:51:16 +02:00
Volker Lendecke
71a407edad dbwrap: Remove talloc_reference()
We want to know (by crashing) when we free the database with records still
around. This would be a serious violation of our data structure hierarchies.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-09-22 04:51:16 +02:00
Volker Lendecke
225cba6e41 dbwrap: Remove unused dbwrap_hash_size()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-09-22 04:51:16 +02:00
Volker Lendecke
5d12eb8908 dbwrap: Remove loadparm_context from db_open_tdb
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-09-22 04:51:16 +02:00
Stefan Metzmacher
25dcdc9270 lib/param: fix hiding of FLAG_SYNONYM values
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11526

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-09-21 01:50:15 +02:00
Thomas Nagy
8262ecb988 build:wafsamba: Use the samba-provided CHECK_CFG method in configuration tests
This is for forward compatibility with waf 1.8. All other tests
use CHECK_CFG, but check_cfg was re-introduced for some reason.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-09-21 01:50:15 +02:00
Ralph Boehme
a36a734717 Revert "tdb: Add tdbdump -u"
This reverts commit ea53e86c25.

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

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Sep 18 14:03:12 CEST 2015 on sn-devel-104
2015-09-18 14:03:12 +02:00
Volker Lendecke
ea53e86c25 tdb: Add tdbdump -u
The reverse of tdbdump

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 Sep 18 03:04:35 CEST 2015 on sn-devel-104
2015-09-18 03:04:35 +02:00
Andreas Schneider
cf5c28da00 replace: Fix check for gettimeofday()
The check does not include <sys/time.h> the test might fail with a
implicit function declaration error.

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 Sep 10 00:36:16 CEST 2015 on sn-devel-104
2015-09-10 00:36:16 +02:00
Andreas Schneider
e7b6990284 swrap: Bump version to 1.1.4
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Sep  8 16:49:23 CEST 2015 on sn-devel-104
2015-09-08 16:49:23 +02:00
Andreas Schneider
9fe5eac9e9 swrap: Call dlclose() in the destructor
Signed-off-by: Andreas Schneider <asn@samba.org>
2015-09-08 13:47:20 +02:00
Andreas Schneider
5bd1ec1037 swrap: Fix signed comparsion warnings
Signed-off-by: Andreas Schneider <asn@samba.org>
2015-09-08 13:47:20 +02:00
Andreas Schneider
830e3dd14f swrap: Add environment variable to specify mtu size
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-09-08 13:47:20 +02:00
Andreas Schneider
55432439e2 swrap: Fix TCP support with sendmsg/recvmsg
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-09-08 13:47:20 +02:00
Andreas Schneider
049b7c8022 swrap: Correctly update the msg_name in recvmsg()
This has been found while debugging nsupdate.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-09-08 13:47:20 +02:00
Andreas Schneider
73a62af0df rwrap: Bump version to 1.1.3
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-09-08 13:47:20 +02:00
Andreas Schneider
278facd197 rwrap: Fix strict aliasing warnings for symbol binding
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-09-08 13:47:20 +02:00
Andrew Bartlett
fee843722c Find the correct symbol when res_* is a define to __res_*
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-09-08 13:47:20 +02:00
Stefan Metzmacher
2947a7041b ldb:wscript: make it possible to build samba with a system ldb again
This fixes a regression in commit fcf4a89194.

If we check for 'ldb' later the 'pyldb-util' can't depend on the 'ldb' check.

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

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

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Aug 31 18:53:16 CEST 2015 on sn-devel-104
2015-08-31 18:53:15 +02:00
Stefan Metzmacher
d9166eb2d7 lib/crypto: make it possible to use only parts of aes.[ch]
This can be used in order to optimize some parts later.

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

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 Aug 27 23:23:54 CEST 2015 on sn-devel-104
2015-08-27 23:23:54 +02:00
Stefan Metzmacher
aaad9e9618 lib/crypto: sync AES_cfb8_encrypt() from heimdal
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11451

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-27 20:23:20 +02:00
Stefan Metzmacher
e9d3379d72 lib/crypto: make use of aes_test.h in aes_gcm_128_test.c
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11451

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-27 20:23:20 +02:00
Stefan Metzmacher
965f04d5e6 lib/crypto: optimize aes_gcm_128
- We avoid variables in order to do a lazy cleanup
  in aes_ccm_128_digest() via ZERO_STRUCTP(ctx)
- We use the optimized aes_block_{xor,rshift}() functions
- Align AES_BLOCK_SIZE arrays to 8 bytes

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-27 20:23:20 +02:00
Stefan Metzmacher
7e8333dac3 lib/crypto: optimize aes_ccm_128
- We avoid variables in order to do a lazy cleanup
  in aes_ccm_128_digest() via ZERO_STRUCTP(ctx)
- We use the optimized aes_block_xor() function
- We reuse A_i instead of rebuilding it everything completely.
- Align AES_BLOCK_SIZE arrays to 8 bytes

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-27 20:23:20 +02:00
Stefan Metzmacher
8795ad2030 lib/crypto: optimize aes_cmac_128
- We avoid variables in order to do a lazy cleanup
  in aes_cmac_128_final() via ZERO_STRUCTP(ctx)
- We avoid unused memcpy() calls
- We use the optimized aes_block_{xor,lshift}() functions
- Align AES_BLOCK_SIZE arrays to 8 bytes

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-27 20:23:20 +02:00
Stefan Metzmacher
0824221b4a lib/crypto: add optimized helper functions aes_block_{xor,lshift,rshift}()
These are typical operations on an AES_BLOCK used by different modes.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-27 20:23:20 +02:00
Stefan Metzmacher
77c3d504b2 lib/crypto: add aes_ccm_128 tests
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11451

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-27 20:23:20 +02:00
Stefan Metzmacher
80c8a1ca95 lib/crypto: verify 0 updates in aes_gcm_128 tests
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11451

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-27 20:23:20 +02:00
Stefan Metzmacher
683eda2f92 lib/crypto: run all aes_gcm_128 testcases
We should not skip the first one.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-27 20:23:20 +02:00
Stefan Metzmacher
7c4117f5da lib/crypto: add aes_cmac_128 chunked tests
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11451

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-27 20:23:20 +02:00
Andreas Schneider
f504681c83 uwrap: Bump version to 1.1.1
Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Aug 21 17:48:45 CEST 2015 on sn-devel-104
2015-08-21 17:48:45 +02:00
Andreas Schneider
a71610cbfa uwrap: Removed double newline
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-21 14:46:15 +02:00
Andreas Schneider
fc68e845e2 uwrap: Fix build if getres(uid|gid) are not available.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-08-21 14:46:15 +02:00
Volker Lendecke
53e8d527f3 param: Use talloc_pooled_object
Reduce memory fragmentation a bit and obsolete NULL checks

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): Fri Aug 21 14:45:58 CEST 2015 on sn-devel-104
2015-08-21 14:45:58 +02:00
Volker Lendecke
0f600c3459 param: Simplify set_param_opt()
"not_added" is not a very good boolean flag concept... An early
return serves the same purpose just as well.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-08-21 11:43:05 +02:00
Volker Lendecke
78d7512db9 lib: Remove unused parmlist code
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-21 11:43:04 +02:00
Volker Lendecke
2146f39111 ctdb: Use talloc_report_str in ctdb
This fixes CID 1125620 Insecure temporary file

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-08-20 12:49:22 +02:00
Volker Lendecke
a44a7c7598 lib: Add the pointer itself to talloc_report_str
A ctdb test found this discrepancy to talloc_report_full :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-08-20 12:49:21 +02:00