samba.git
8 years agovfs: Remove smb_traffic_analyzer
Volker Lendecke [Mon, 9 Nov 2015 09:14:26 +0000 (10:14 +0100)]
vfs: Remove smb_traffic_analyzer

Holger Hetterich told me in a personal email that he does not have
time to care about this project anymore and that he is fine to
remove it from Samba.

Why the removal? It contains homegrown crypto that would need to
be thoroughly audited and/or fixed. And if it's neither maintained
nor widely used I'd rather have it removed.

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): Wed Nov 11 00:23:35 CET 2015 on sn-devel-104

8 years agosmbstatus: always initialize a messaing context
Ralph Boehme [Tue, 10 Nov 2015 16:59:09 +0000 (17:59 +0100)]
smbstatus: always initialize a messaing context

Recent changes (b542ce7db394de3023b95288b0c40c4533c02cb1) to serverid
code made serverid_exists() call messaging_dgm_get_unique() which means
we depend on a valid messaging context that initializes
global_dgm_context.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Fix CID 1338432 Unchecked return value
Volker Lendecke [Tue, 10 Nov 2015 08:56:56 +0000 (09:56 +0100)]
lib: Fix CID 1338432 Unchecked return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agodns_server: Fix a clang warning
Volker Lendecke [Mon, 9 Nov 2015 09:01:59 +0000 (10:01 +0100)]
dns_server: Fix a clang warning

clang complains that '\0' is converted to a NULL pointer. This seems
to work fine, so make this pointer explicitly NULL. If instead we
need a "" here, we could of course do that too.

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 Nov 10 10:13:18 CET 2015 on sn-devel-104

8 years agos3-build: Avoid setting CTDB specific include path
Amitay Isaacs [Sat, 7 Nov 2015 12:21:34 +0000 (23:21 +1100)]
s3-build: Avoid setting CTDB specific include path

The include paths for CTDB are set via ctdb/wscript.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Nov  9 14:31:24 CET 2015 on sn-devel-104

8 years agoctdb-scripts: Add support for CTDB_DBDIR in tmpfs
Martin Schwenke [Fri, 23 Oct 2015 03:04:04 +0000 (14:04 +1100)]
ctdb-scripts: Add support for CTDB_DBDIR in tmpfs

The tmpfs is mounted and unmounted by ctdbd_wrapper.  Format is
CTDB_DBDIR=tmpfs:<tmpfs-options>.  The only default for the tmpfs is
mode=700 - to override, specify a different value in <tmpfs-options>.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Nov  9 10:58:32 CET 2015 on sn-devel-104

8 years agoctdb-scripts: Improve CTDB wrapper shutdown code
Martin Schwenke [Fri, 23 Oct 2015 03:04:04 +0000 (14:04 +1100)]
ctdb-scripts: Improve CTDB wrapper shutdown code

This will make it easier to run things after CTDB is stopped.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoctdb-tests: Fix "setreclock" test
Martin Schwenke [Fri, 30 Oct 2015 02:06:24 +0000 (13:06 +1100)]
ctdb-tests: Fix "setreclock" test

1. Waiting for generation to change isn't enough.  It now changes
   early in recovery and reclock might not have been set on all nodes.
   So wait until recovery is complete before checking reclock.

2. Use onnode -p when setting reclock on all nodes.  That will cause
   it to be set quickly on all nodes, to avoid the situation where the
   recovery master is the late in the list and resets the reclock on
   earlier nodes back to the old value.  This shouldn't matter if (1)
   is done but it can't hurt.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoctdb-tests: Fix the name of the "setreclock" test
Martin Schwenke [Mon, 9 Nov 2015 00:35:03 +0000 (11:35 +1100)]
ctdb-tests: Fix the name of the "setreclock" test

It currently claims to test "setrecmaster".

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agovfs_acl_*: Only sha256 needed
Volker Lendecke [Sun, 8 Nov 2015 10:34:40 +0000 (11:34 +0100)]
vfs_acl_*: Only sha256 needed

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agovfs_cap: Fix a warning
Volker Lendecke [Sun, 8 Nov 2015 09:43:59 +0000 (10:43 +0100)]
vfs_cap: Fix a warning

clang warns about increased alignment cast. talloc_size does align properly.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agolib: messages.h references struct iovec
Volker Lendecke [Mon, 2 Nov 2015 11:46:35 +0000 (12:46 +0100)]
lib: messages.h references struct iovec

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agolib: Move some procid functions out of util.c
Volker Lendecke [Fri, 6 Nov 2015 15:59:44 +0000 (16:59 +0100)]
lib: Move some procid functions out of util.c

Including proto.h just for pid_to_procid() is a pain...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agolib: Increase a debuglevel
Volker Lendecke [Fri, 6 Nov 2015 14:39:45 +0000 (15:39 +0100)]
lib: Increase a debuglevel

We do this every time when a process exits. If that process has
properly cleaned up after itself, we spit out this message.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agovfs_fruit: Fix a typo
Volker Lendecke [Sun, 8 Nov 2015 09:16:04 +0000 (10:16 +0100)]
vfs_fruit: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoFix various spelling errors
Mathieu Parent [Sun, 26 Jul 2015 21:02:57 +0000 (23:02 +0200)]
Fix various spelling errors

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Nov  6 13:43:45 CET 2015 on sn-devel-104

8 years agobuild:wafsamba: Remove the print_commands code from the build scripts
Thomas Nagy [Thu, 5 Nov 2015 18:00:18 +0000 (19:00 +0100)]
build:wafsamba: Remove the print_commands code from the build scripts

Using the print_commands tool makes it easier to upgrade to Waf 1.8.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Uri Simchoni uri@samba.org
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agobuild:wafsamba: Include the print_commands.py tool from upstream
Thomas Nagy [Thu, 5 Nov 2015 17:57:14 +0000 (18:57 +0100)]
build:wafsamba: Include the print_commands.py tool from upstream

The tool 'print_commands' is provided by default in Waf 1.8. Keeping
the old code in Samba complicates the Waf upgrade.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Uri Simchoni uri@samba.org
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agobuild:wafsamba: Remove samba_utils.runonce
Thomas Nagy [Thu, 5 Nov 2015 01:06:42 +0000 (02:06 +0100)]
build:wafsamba: Remove samba_utils.runonce

The decorator order matters in the following:
"""
@runonce
@conf
function()
"""

First, the @conf decorator binds the function to the configuration context
and then returns the same function. The @runonce decorator then takes
the output function and replaces it by another that performs caching. This new
function remains in the current script and is never bound to the configuration
context, so caching never occurs.

The declaration would have been correct if written like this:
"""
@conf
@runonce
function()
"""

Yet the decorator @run_once does not keep the function name (__name__), so the
annotation with @conf would fail. The straightforward approach is to remove
all the incorrect @runonce occurrences.

Besides that, the function Utils.run_once is already present in the Waf library,
and is sufficient for the current needs of the Samba code (it caches only the
first argument). Therefore samba_utils.runonce can be safely replaced by
Utils.run_once, which is also present in Waf 1.8.

Note: at runtime, only SETUP_BUILD_GROUPS seems to actually use caching.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Uri Simchoni uri@samba.org
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agobuild:wafsamba: Remove the unnecessary intltool module dependency
Thomas Nagy [Wed, 4 Nov 2015 23:41:38 +0000 (00:41 +0100)]
build:wafsamba: Remove the unnecessary intltool module dependency

The 'intltool' module is completely unnecessary for the build process,
and it does not exist in waf 1.8

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Uri Simchoni uri@samba.org
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agobuild:wafsamba: Moved samba_before_apply_obj_vars to samba_utils
Thomas Nagy [Wed, 4 Nov 2015 23:39:25 +0000 (00:39 +0100)]
build:wafsamba: Moved samba_before_apply_obj_vars to samba_utils

The function samba_before_apply_obj_vars serves to remove system paths,
it is certainly not an optimisation and has no place in that module.
By optimisation, we mean that the build process could run without it.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Uri Simchoni uri@samba.org
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agobuild:wafsamba: Removed unnecessary and misleading variables
Thomas Nagy [Wed, 4 Nov 2015 23:34:03 +0000 (00:34 +0100)]
build:wafsamba: Removed unnecessary and misleading variables

There is no 'allow_duplicates' attribute anywhere.
The function 'check_duplicate_sources' always returns True unless it raises an exception
There is no list of source files to use
The variable 'tstart' is unused

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Uri Simchoni uri@samba.org
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoFix up some aesthetics ... ie, align things as they were intended.
Richard Sharpe [Thu, 5 Nov 2015 23:30:18 +0000 (15:30 -0800)]
Fix up some aesthetics ... ie, align things as they were intended.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Nov  6 10:36:37 CET 2015 on sn-devel-104

8 years agospec files: remove pam_smbpass
Alexander Bokovoy [Wed, 4 Nov 2015 15:58:42 +0000 (17:58 +0200)]
spec files: remove pam_smbpass

Remove remaining pam_smbpass options from RHEL spec file templates.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agosource3/wscript: remove pam_smbpass option as it was removed
Alexander Bokovoy [Wed, 4 Nov 2015 15:50:15 +0000 (17:50 +0200)]
source3/wscript: remove pam_smbpass option as it was removed

pam_smbpass module was removed in 3c00e8d76a2ef6194a8ce522c15853e5b8e9262b
but corresponding configure option wasn't removed.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agodoc: fix a typo in the smb.conf manpage, explanation of idmap config
Michael Adam [Thu, 5 Nov 2015 15:43:34 +0000 (16:43 +0100)]
doc: fix a typo in the smb.conf manpage, explanation of idmap config

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Nov  6 06:26:34 CET 2015 on sn-devel-104

8 years agovfs_gpfs: Re-enable share modes
Volker Lendecke [Thu, 5 Nov 2015 12:22:33 +0000 (13:22 +0100)]
vfs_gpfs: Re-enable share modes

is_ntfs_default_stream_smb_fname returns false for a NULL stream name, so for
streamless filenames we do not set gpfs share modes without this patch.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11243
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Nov  6 03:21:01 CET 2015 on sn-devel-104

8 years agovfs_gpfs: Fix the build with -Werror=declaration-after-statement
Volker Lendecke [Thu, 5 Nov 2015 12:35:23 +0000 (13:35 +0100)]
vfs_gpfs: Fix the build with -Werror=declaration-after-statement

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11243
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoremove many valgrind errors for base.lock test
Noel Power [Thu, 29 Oct 2015 11:11:00 +0000 (11:11 +0000)]
remove many valgrind errors for base.lock test

mostly "Conditional jump or move depends on uninitialised value" &
"Use of uninitialised value of size 8" errors, suspect this is
related to compiler padding for the struct

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Nov  6 00:16:53 CET 2015 on sn-devel-104

8 years agofix uninitialised read in process_host_announce
Noel Power [Wed, 28 Oct 2015 21:17:42 +0000 (21:17 +0000)]
fix uninitialised read in process_host_announce

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agofix writev(vector[...]) points to uninitialised bytes in call_trans2findnext
Noel Power [Wed, 28 Oct 2015 19:53:49 +0000 (19:53 +0000)]
fix writev(vector[...]) points to uninitialised bytes in call_trans2findnext

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agofix 'Invalid read of size 1' in reply_search
Noel Power [Wed, 28 Oct 2015 17:08:28 +0000 (17:08 +0000)]
fix 'Invalid read of size 1' in reply_search

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agofix writev(vector[...]) points to uninitialised bytes in call_trans2findfirst
Noel Power [Wed, 28 Oct 2015 15:42:06 +0000 (15:42 +0000)]
fix writev(vector[...]) points to uninitialised bytes in call_trans2findfirst

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agoldb: version 1.1.23 ldb-1.1.23
Stefan Metzmacher [Thu, 6 Aug 2015 20:59:26 +0000 (22:59 +0200)]
ldb: version 1.1.23

* Test improvements
* Improved python3 bindings
* Minor build fixes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Nov  5 21:11:35 CET 2015 on sn-devel-104

8 years agopyldb: Improve test coverage
Petr Viktorin [Fri, 21 Aug 2015 08:22:22 +0000 (10:22 +0200)]
pyldb: Improve test coverage

Add tests for:
 - ldb.Dn.{get,set}_{extended_,}component_{name,value}
 - ldb.Dn.{get,set}_rdn_{name,value}
 - ldb.Dn.get_casefold
 - ldb.Dn.get_linearized
 - ldb.Dn.canonical_str

Add negative test for Dn.__contains__

Add a helper function to register a dummy DN extension for testing.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agopyldb: Fixes and Python3 compat for Dn component accessors
Petr Viktorin [Fri, 21 Aug 2015 08:10:28 +0000 (10:10 +0200)]
pyldb: Fixes and Python3 compat for Dn component accessors

Use "s#"/"z#" argument specifiers in set_component and
set_extended_component instead of converting strings manually.
(Under Python 3, This means both text strings and bytes are accepted.)

Raise error on set_component(None), instead of crashing.

Return text strings from get_{extended}_component under Python 3.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agopyldb: Prevent segfault when first module is NULL
Petr Viktorin [Fri, 21 Aug 2015 08:07:17 +0000 (10:07 +0200)]
pyldb: Prevent segfault when first module is NULL

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoldb: Build for two Python versions at once
Petr Viktorin [Fri, 14 Aug 2015 10:43:41 +0000 (12:43 +0200)]
ldb: Build for two Python versions at once

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agopyldb: Adapt tests to Python 3
Petr Viktorin [Wed, 29 Jul 2015 10:45:43 +0000 (12:45 +0200)]
pyldb: Adapt tests to Python 3

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agopyldb: Split text/byte strings for compatibility with Python 3
Petr Viktorin [Tue, 9 Jun 2015 15:44:40 +0000 (17:44 +0200)]
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>
8 years agopyldb: Modernize test suite
Petr Viktorin [Wed, 10 Jun 2015 08:21:24 +0000 (10:21 +0200)]
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>
8 years agopyldb: Add Python 3 compatibility (except strings)
Petr Viktorin [Tue, 9 Jun 2015 08:36:26 +0000 (10:36 +0200)]
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>
8 years agopyldb: DECREF old debug function when resetting it
Petr Viktorin [Wed, 10 Jun 2015 13:40:34 +0000 (15:40 +0200)]
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>
8 years agopyldb: Don't use the internal macro PyObject_REPR
Petr Viktorin [Wed, 10 Jun 2015 13:41:57 +0000 (15:41 +0200)]
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>
8 years agopyldb: Properly increase refcount of returned values
Petr Viktorin [Thu, 11 Jun 2015 08:16:48 +0000 (10:16 +0200)]
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>
8 years agoldb: Run the Python testsuite
Petr Viktorin [Mon, 8 Jun 2015 12:17:12 +0000 (14:17 +0200)]
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>
8 years agotevent: version 0.9.26 tevent-0.9.26
Stefan Metzmacher [Mon, 24 Aug 2015 13:47:51 +0000 (15:47 +0200)]
tevent: version 0.9.26

* New tevent_thread_proxy API
* Minor build fixes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
8 years agolib: tevent: docs: Add tutorial on thread usage.
Jeremy Allison [Wed, 22 Jul 2015 18:52:06 +0000 (11:52 -0700)]
lib: tevent: docs: Add tutorial on thread usage.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
8 years agolib: tevent: tests: Add a second thread test that does request/reply.
Jeremy Allison [Fri, 24 Jul 2015 16:27:21 +0000 (09:27 -0700)]
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>
8 years agolib: tevent: Initial test of tevent threaded context code.
Jeremy Allison [Fri, 24 Jul 2015 15:50:31 +0000 (08:50 -0700)]
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>
8 years agolib: tevent: Initial checkin of threaded tevent context calling code.
Jeremy Allison [Thu, 23 Jul 2015 22:23:50 +0000 (15:23 -0700)]
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>
8 years agotdb: version 1.3.8 tdb-1.3.8
Stefan Metzmacher [Mon, 24 Aug 2015 13:41:33 +0000 (15:41 +0200)]
tdb: version 1.3.8

* Fix broken build with --disable-python
* Minor build fixes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
8 years agotalloc: version 2.1.5 talloc-2.1.5
Stefan Metzmacher [Mon, 24 Aug 2015 13:47:18 +0000 (15:47 +0200)]
talloc: version 2.1.5

* Minor build fixes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
8 years agouwrap: Bump version to 1.2.0
Andreas Schneider [Wed, 4 Nov 2015 11:54:05 +0000 (12:54 +0100)]
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

8 years agouwrap: Fix build warning with release build
Andreas Schneider [Fri, 30 Oct 2015 12:41:47 +0000 (13:41 +0100)]
uwrap: Fix build warning with release build

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agouwrap: Add the EINVAL check to setegid()
Andreas Schneider [Fri, 30 Oct 2015 12:41:18 +0000 (13:41 +0100)]
uwrap: Add the EINVAL check to setegid()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agouwrap: Allow setgid calls only for privileged users
Andreas Schneider [Fri, 30 Oct 2015 12:40:45 +0000 (13:40 +0100)]
uwrap: Allow setgid calls only for privileged users

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agouwrap: Allow setregid calls only for privileged users
Andreas Schneider [Fri, 30 Oct 2015 12:40:18 +0000 (13:40 +0100)]
uwrap: Allow setregid calls only for privileged users

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agouwrap: Allow setresgid calls only for privileged users
Andreas Schneider [Fri, 30 Oct 2015 12:39:55 +0000 (13:39 +0100)]
uwrap: Allow setresgid calls only for privileged users

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agouwrap: Move the EINVAL check down in seteuid()
Andreas Schneider [Fri, 30 Oct 2015 12:39:30 +0000 (13:39 +0100)]
uwrap: Move the EINVAL check down in seteuid()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agouwrap: Allow setuid calls only for privileged users
Andreas Schneider [Fri, 30 Oct 2015 12:39:02 +0000 (13:39 +0100)]
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>
8 years agouwrap: Allow setreuid calls only for privileged users
Andreas Schneider [Fri, 30 Oct 2015 12:38:32 +0000 (13:38 +0100)]
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>
8 years agouwrap: Allow setresuid calls only for privileged users
Andreas Schneider [Fri, 30 Oct 2015 12:37:51 +0000 (13:37 +0100)]
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>
8 years agouwrap: Fix a possible null pointer dereference
Andreas Schneider [Fri, 30 Oct 2015 12:37:11 +0000 (13:37 +0100)]
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>
8 years agouwrap: Improve debug output
Andreas Schneider [Fri, 30 Oct 2015 12:36:39 +0000 (13:36 +0100)]
uwrap: Improve debug output

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agouwrap: Fix debug line in uwrap_init()
Andreas Schneider [Fri, 30 Oct 2015 12:36:04 +0000 (13:36 +0100)]
uwrap: Fix debug line in uwrap_init()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agontvfs: Add error debug statements for set_unix_security
Andreas Schneider [Tue, 13 Oct 2015 12:43:08 +0000 (14:43 +0200)]
ntvfs: Add error debug statements for set_unix_security

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoselftest: Start Samba AD DC as root
Andreas Schneider [Tue, 13 Oct 2015 11:02:07 +0000 (13:02 +0200)]
selftest: Start Samba AD DC as root

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agos4-rpc_server: Get the real initial uid for selftest
Andreas Schneider [Wed, 4 Nov 2015 09:15:13 +0000 (10:15 +0100)]
s4-rpc_server: Get the real initial uid for selftest

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoselftest: Start smbd, nmbd and winbindd as root
Andreas Schneider [Fri, 30 Oct 2015 13:30:58 +0000 (14:30 +0100)]
selftest: Start smbd, nmbd and winbindd as root

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agos3-lib: Get the real initial uid for selftest
Andreas Schneider [Fri, 30 Oct 2015 13:31:33 +0000 (14:31 +0100)]
s3-lib: Get the real initial uid for selftest

We need this that if we connect as the user who started smbd, we are
able to perform privileged operation like creating a user.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agovfs_offline: add documentation
Uri Simchoni [Wed, 4 Nov 2015 19:18:20 +0000 (21:18 +0200)]
vfs_offline: add documentation

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): Thu Nov  5 01:22:48 CET 2015 on sn-devel-104

8 years agovfs_offline: add a blackbox test
Uri Simchoni [Wed, 4 Nov 2015 10:06:03 +0000 (12:06 +0200)]
vfs_offline: add a blackbox test

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agovfs_offline: add vfs_offline module
Uri Simchoni [Wed, 4 Nov 2015 06:44:29 +0000 (08:44 +0200)]
vfs_offline: add vfs_offline module

This module marks all file in the share as offline.
It can be useful for shares mounted on top of a remote file
system (either through a samba VFS module or via FUSE).

Offline files change the behavior of Windows explorer, and
prevent it from peeking inside folders just for the sake of
drawing a nice icon of them. This greatly reduces the number
of requests Windows Explorer makes, and improves user experience
when dealing with remote file systems.

The offline bit also has an effect on the behavior of Windows
redirector.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agos3: rpcclient: Prevent null ptr access by returning error if no creds available
Noel Power [Mon, 2 Nov 2015 09:59:12 +0000 (09:59 +0000)]
s3: rpcclient: Prevent null ptr access by returning error if no creds available

Prevent rpccli_netlogon_password_logon being called with 'NULL' credentials.

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agos3: winbind: Prevent null ptr access by returning error if no creds available
Noel Power [Thu, 22 Oct 2015 11:37:17 +0000 (12:37 +0100)]
s3: winbind: Prevent null ptr access by returning error if no creds available

Prevent rpccli_netlogon_network_logon/rpccli_netlogon_password_logon
being called with 'NULL' credentials

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agos3: smbd: If EA's are turned off on a share don't allow an SMB2 create containing...
Jeremy Allison [Wed, 4 Nov 2015 17:34:57 +0000 (09:34 -0800)]
s3: smbd: If EA's are turned off on a share don't allow an SMB2 create containing them.

Otherwise a create that should have failed may succeed.

Based on an original patch from John Mulligan <phlogistonjohn@asynchrono.us>
and comments from Uri Simchoni <uri@samba.org>

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Nov  4 22:14:22 CET 2015 on sn-devel-104

8 years agowafsamba: detect programmer errors in CHECK_BUNDLED_SYSTEM()
Stefan Metzmacher [Thu, 27 Aug 2015 08:47:05 +0000 (10:47 +0200)]
wafsamba: detect programmer errors in CHECK_BUNDLED_SYSTEM()

All prerequisite libraries of CHECK_BUNDLED_SYSTEM[_PKG](onlyif='lib1 lib2')
need to be checked before.

That means conf.env['FOUND_SYSTEMLIB_lib1'] and conf.env['FOUND_SYSTEMLIB_lib2']
need to exist independed of its value (True or False). Otherwise this is a logic error.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Nov  4 18:38:18 CET 2015 on sn-devel-104

8 years agotests: Add tests for net ads (join|leave)
Andreas Schneider [Tue, 20 Oct 2015 13:54:39 +0000 (15:54 +0200)]
tests: Add tests for net ads (join|leave)

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Nov  4 15:35:57 CET 2015 on sn-devel-104

8 years agoctdb-build: Add ctdb/ directory to include path for top-level build
Amitay Isaacs [Thu, 29 Oct 2015 07:28:29 +0000 (18:28 +1100)]
ctdb-build: Add ctdb/ directory to include path for top-level build

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Nov  4 03:52:27 CET 2015 on sn-devel-104

8 years agoctdb-include: Use new protocol definitions
Amitay Isaacs [Thu, 29 Oct 2015 06:51:52 +0000 (17:51 +1100)]
ctdb-include: Use new protocol definitions

This gets rid of the duplicate definitions from ctdb_protocol.h.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-protocol: Rename G_LOCK_READ/WRITE to CTDB_G_LOCK_READ/WRITE
Amitay Isaacs [Thu, 29 Oct 2015 07:37:42 +0000 (18:37 +1100)]
ctdb-protocol: Rename G_LOCK_READ/WRITE to CTDB_G_LOCK_READ/WRITE

to avoid clash with definitions from source3/include/g_lock.h.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-client: Rename g_lock datatypes as per new protocol.h
Amitay Isaacs [Thu, 29 Oct 2015 06:55:35 +0000 (17:55 +1100)]
ctdb-client: Rename g_lock datatypes as per new protocol.h

struct server_id => ctdb_server_id
enum g_lock_type => ctdb_g_lock_type
struct g_lock_rec => ctdb_g_lock
struct g_lock_recs => ctdb_g_lock_list

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Remove unused definitions
Amitay Isaacs [Thu, 29 Oct 2015 06:36:23 +0000 (17:36 +1100)]
ctdb-include: Remove unused definitions

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-tools: Use replace headers instead of system headers
Amitay Isaacs [Wed, 28 Oct 2015 08:52:02 +0000 (19:52 +1100)]
ctdb-tools: Use replace headers instead of system headers

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Remove explicit include of ctdb_protocol.h
Amitay Isaacs [Wed, 28 Oct 2015 08:52:53 +0000 (19:52 +1100)]
ctdb-daemon: Remove explicit include of ctdb_protocol.h

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename struct ctdb_control_get_ifaces to ctdb_iface_list_old
Amitay Isaacs [Wed, 28 Oct 2015 08:43:48 +0000 (19:43 +1100)]
ctdb-daemon: Rename struct ctdb_control_get_ifaces to ctdb_iface_list_old

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename struct ctdb_control_public_ip_info to ctdb_public_ip_info_old
Amitay Isaacs [Wed, 28 Oct 2015 08:39:51 +0000 (19:39 +1100)]
ctdb-daemon: Rename struct ctdb_control_public_ip_info to ctdb_public_ip_info_old

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename struct ctdb_control_iface_info to ctdb_iface
Amitay Isaacs [Wed, 28 Oct 2015 08:37:17 +0000 (19:37 +1100)]
ctdb-daemon: Rename struct ctdb_control_iface_info to ctdb_iface

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename struct ctdb_control_transdb to ctdb_transdb
Amitay Isaacs [Wed, 28 Oct 2015 08:22:23 +0000 (19:22 +1100)]
ctdb-daemon: Rename struct ctdb_control_transdb to ctdb_transdb

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename struct ctdb_control_set_tunable to ctdb_tunable_old
Amitay Isaacs [Wed, 28 Oct 2015 08:18:02 +0000 (19:18 +1100)]
ctdb-daemon: Rename struct ctdb_control_set_tunable to ctdb_tunable_old

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename struct ctdb_control_pulldb to ctdb_pulldb
Amitay Isaacs [Wed, 28 Oct 2015 08:10:53 +0000 (19:10 +1100)]
ctdb-daemon: Rename struct ctdb_control_pulldb to ctdb_pulldb

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename struct ctdb_control_gratious_arp to ctdb_addr_info_old
Amitay Isaacs [Thu, 29 Oct 2015 03:47:54 +0000 (14:47 +1100)]
ctdb-daemon: Rename struct ctdb_control_gratious_arp to ctdb_addr_info_old

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename struct ctdb_control_ip_iface to ctdb_addr_info_old
Amitay Isaacs [Thu, 29 Oct 2015 03:46:21 +0000 (14:46 +1100)]
ctdb-daemon: Rename struct ctdb_control_ip_iface to ctdb_addr_info_old

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename struct ctdb_tunable to ctdb_tunable_list
Amitay Isaacs [Wed, 28 Oct 2015 07:51:22 +0000 (18:51 +1100)]
ctdb-daemon: Rename struct ctdb_tunable to ctdb_tunable_list

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename struct ctdb_control_tcp_tickle_list to ctdb_tickle_list_old
Amitay Isaacs [Wed, 28 Oct 2015 07:44:19 +0000 (18:44 +1100)]
ctdb-daemon: Rename struct ctdb_control_tcp_tickle_list to ctdb_tickle_list_old

Also remove unnecessary struct ctdb_tcp_wire_array.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename struct srvid_request_data to ctdb_disable_message
Amitay Isaacs [Wed, 28 Oct 2015 07:23:13 +0000 (18:23 +1100)]
ctdb-daemon: Rename struct srvid_request_data to ctdb_disable_message

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename struct srvid_request to ctdb_srvid_message
Amitay Isaacs [Thu, 29 Oct 2015 03:32:49 +0000 (14:32 +1100)]
ctdb-daemon: Rename struct srvid_request to ctdb_srvid_message

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename struct ctdb_ban_time to ctdb_ban_state
Amitay Isaacs [Wed, 28 Oct 2015 07:18:33 +0000 (18:18 +1100)]
ctdb-daemon: Rename struct ctdb_ban_time to ctdb_ban_state

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Rename struct ctdb_tcp_connection to ctdb_connection
Amitay Isaacs [Wed, 28 Oct 2015 07:14:21 +0000 (18:14 +1100)]
ctdb-daemon: Rename struct ctdb_tcp_connection to ctdb_connection

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