mat/samba.git
10 years agoCVE-2013-4408:s3:Ensure we always check call_id when validating an RPC reply.
Jeremy Allison [Thu, 17 Oct 2013 21:44:35 +0000 (14:44 -0700)]
CVE-2013-4408:s3:Ensure we always check call_id when validating an RPC reply.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoCVE-2013-4408:s3:ctdb_conn: add some length verification to ctdb_packet_more()
Stefan Metzmacher [Wed, 16 Oct 2013 14:26:58 +0000 (16:26 +0200)]
CVE-2013-4408:s3:ctdb_conn: add some length verification to ctdb_packet_more()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoCVE-2013-4408:libcli/util: add some size verification to tstream_read_pdu_blob_done()
Stefan Metzmacher [Wed, 16 Oct 2013 12:17:49 +0000 (14:17 +0200)]
CVE-2013-4408:libcli/util: add some size verification to tstream_read_pdu_blob_done()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoCVE-2013-4408:s3:util_tsock: add some overflow detection to tstream_read_packet_done()
Stefan Metzmacher [Wed, 16 Oct 2013 12:17:49 +0000 (14:17 +0200)]
CVE-2013-4408:s3:util_tsock: add some overflow detection to tstream_read_packet_done()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoCVE-2013-4408:async_sock: add some overflow detection to read_packet_handler()
Stefan Metzmacher [Wed, 16 Oct 2013 12:17:49 +0000 (14:17 +0200)]
CVE-2013-4408:async_sock: add some overflow detection to read_packet_handler()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoCVE-2013-4408:s4:dcerpc_sock: check for invalid frag_len within sock_complete_packet()
Stefan Metzmacher [Tue, 24 Sep 2013 03:03:40 +0000 (05:03 +0200)]
CVE-2013-4408:s4:dcerpc_sock: check for invalid frag_len within sock_complete_packet()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoCVE-2013-4408:s4:dcerpc_smb2: check for invalid frag_len in send_read_request_continue()
Stefan Metzmacher [Wed, 25 Sep 2013 21:25:12 +0000 (23:25 +0200)]
CVE-2013-4408:s4:dcerpc_smb2: check for invalid frag_len in send_read_request_continue()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoCVE-2013-4408:s4:dcerpc_smb: check for invalid frag_len in send_read_request_continue()
Stefan Metzmacher [Wed, 25 Sep 2013 21:25:12 +0000 (23:25 +0200)]
CVE-2013-4408:s4:dcerpc_smb: check for invalid frag_len in send_read_request_continue()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoCVE-2013-4408:s4:dcerpc: check for invalid frag_len in ncacn_pull()
Stefan Metzmacher [Wed, 25 Sep 2013 21:25:12 +0000 (23:25 +0200)]
CVE-2013-4408:s4:dcerpc: check for invalid frag_len in ncacn_pull()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoCVE-2013-4408:s3:rpc_client: verify frag_len at least contains the header size
Stefan Metzmacher [Wed, 25 Sep 2013 21:25:12 +0000 (23:25 +0200)]
CVE-2013-4408:s3:rpc_client: verify frag_len at least contains the header size

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoCVE-2013-4408:s3:rpc_client: check for invalid frag_len in dcerpc_pull_ncacn_packet()
Stefan Metzmacher [Wed, 25 Sep 2013 21:25:12 +0000 (23:25 +0200)]
CVE-2013-4408:s3:rpc_client: check for invalid frag_len in dcerpc_pull_ncacn_packet()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoCVE-2013-4408:librpc: check for invalid frag_len within dcerpc_read_ncacn_packet_next...
Stefan Metzmacher [Tue, 24 Sep 2013 03:03:40 +0000 (05:03 +0200)]
CVE-2013-4408:librpc: check for invalid frag_len within dcerpc_read_ncacn_packet_next_vector()

We should do this explicit instead of relying on
tstream_readv_pdu_ask_for_next_vector() to catch the overflow.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoCVE-2013-4408:librpc: check for invalid frag_len within dcerpc_read_ncacn_packet_done()
Stefan Metzmacher [Tue, 24 Sep 2013 03:03:40 +0000 (05:03 +0200)]
CVE-2013-4408:librpc: check for invalid frag_len within dcerpc_read_ncacn_packet_done()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoctdb:packaging:RPM: don't run autogen.
Michael Adam [Fri, 6 Dec 2013 00:37:34 +0000 (01:37 +0100)]
ctdb:packaging:RPM: don't run autogen.

autogen is already run in maketarball.sh which generates
the tarball for the RPM.

This way, we don't have a rpm build dependency on autoconf.
Recent changes introduced a dependency into autoconf
version >= 2.60, so this fix allows the generated
source RPM to be built also on older platforms.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Dec  9 05:47:00 CET 2013 on sn-devel-104

10 years agoctdb:packaging:RPM: package the new manpages
Michael Adam [Fri, 6 Dec 2013 00:33:57 +0000 (01:33 +0100)]
ctdb:packaging:RPM: package the new manpages

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:build: install the new manpages
Michael Adam [Fri, 6 Dec 2013 00:31:11 +0000 (01:31 +0100)]
ctdb:build: install the new manpages

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agolib/ntdb optimize includes in ntdb tools
Christian Ambach [Fri, 22 Nov 2013 04:19:16 +0000 (05:19 +0100)]
lib/ntdb optimize includes in ntdb tools

use the private header (which will use libreplace or system headers)
instead of direct includes of system includes

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Rusty Russell <rusty@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Sat Dec  7 18:38:21 CET 2013 on sn-devel-104

10 years agolib/ntdb optimize includes in ntdb tests
Christian Ambach [Fri, 22 Nov 2013 04:18:36 +0000 (05:18 +0100)]
lib/ntdb optimize includes in ntdb tests

use the private header (which will use libreplace or system headers)
instead of direct includes of system includes

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Rusty Russell <rusty@samba.org>
10 years agolib/ntdb correct includes in private header
Christian Ambach [Fri, 22 Nov 2013 04:17:38 +0000 (05:17 +0100)]
lib/ntdb correct includes in private header

include all necessary headers when libreplace is not around

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Rusty Russell <rusty@samba.org>
10 years agolib/ntdb fix compilation when libreplace is not around
Christian Ambach [Fri, 22 Nov 2013 04:15:59 +0000 (05:15 +0100)]
lib/ntdb fix compilation when libreplace is not around

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Rusty Russell <rusty@samba.org>
10 years agolib/socket_wrapper fix compilation when libreplace is not around
Christian Ambach [Fri, 22 Nov 2013 04:15:13 +0000 (05:15 +0100)]
lib/socket_wrapper fix compilation when libreplace is not around

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
10 years agos3:vfs_btrfs change includes
Christian Ambach [Fri, 22 Nov 2013 04:13:17 +0000 (05:13 +0100)]
s3:vfs_btrfs change includes

use the ones from libreplace instead of system ones

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
10 years agos3:pam_smbpass change includes
Christian Ambach [Fri, 22 Nov 2013 04:13:56 +0000 (05:13 +0100)]
s3:pam_smbpass change includes

use the ones from libreplace instead of system ones

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
10 years agos3:vfs fix a compile warning
Christian Ambach [Wed, 4 Dec 2013 21:50:31 +0000 (22:50 +0100)]
s3:vfs fix a compile warning

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sat Dec  7 14:20:43 CET 2013 on sn-devel-104

10 years agoldb: bad if test in ldb_comparison_fold()
Jeremy Allison [Fri, 6 Dec 2013 23:58:02 +0000 (15:58 -0800)]
ldb: bad if test in ldb_comparison_fold()

Found by David Binderman <dcb314@hotmail.com>

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sat Dec  7 11:10:47 CET 2013 on sn-devel-104

10 years agodocs: update the manpage of vfs_shadow_copy2
Michael Adam [Wed, 4 Dec 2013 09:27:24 +0000 (10:27 +0100)]
docs: update the manpage of vfs_shadow_copy2

Document the configuration and all the options
available for the shadow_copy2 module.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Dec  6 22:26:31 CET 2013 on sn-devel-104

10 years agos3:modules:shadow_copy2: remove redundant documentation comment block
Michael Adam [Wed, 4 Dec 2013 14:55:19 +0000 (15:55 +0100)]
s3:modules:shadow_copy2: remove redundant documentation comment block

and refer to the manual page instead

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:modules:shadow_copy2: improve headline comment
Michael Adam [Wed, 4 Dec 2013 14:50:26 +0000 (15:50 +0100)]
s3:modules:shadow_copy2: improve headline comment

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:module:shadow_copy2: add my (C)
Michael Adam [Wed, 4 Dec 2013 12:40:14 +0000 (13:40 +0100)]
s3:module:shadow_copy2: add my (C)

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:torture:smb2: add new durable-v2-open.reopen1a test
Michael Adam [Fri, 29 Nov 2013 17:45:35 +0000 (18:45 +0100)]
s4:torture:smb2: add new durable-v2-open.reopen1a test

- open session1 on tcp connection conn1
- open a durable handle on a session1
- do a session reconnect on a new tcp connection conn2
- doing a durable reconnect on session1 gives
  USER_SESSION_DELETED
- doing a durable reconnect on session2 succeeds

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Dec  6 15:59:15 CET 2013 on sn-devel-104

10 years agos4:torture:smb2: add new durable-open.reopen1a test
Michael Adam [Fri, 29 Nov 2013 17:20:01 +0000 (18:20 +0100)]
s4:torture:smb2: add new durable-open.reopen1a test

- open session1 on tcp connection conn1
- open a durable handle on a session1
- do a session reconnect on a new tcp connection conn2
- doing a durable reconnect on session1 gives
  USER_SESSION_DELETED
- doing a durable reconnect on session2 succeeds

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agocldap: quieten error when abandon packet is sent
Garming Sam [Wed, 4 Dec 2013 22:53:14 +0000 (11:53 +1300)]
cldap: quieten error when abandon packet is sent

The specification indicates that no response needs to be sent when receiving
an abandon request packet.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Dec  6 07:13:29 CET 2013 on sn-devel-104

10 years agopyntdb: Add tests for Python API.
Jelmer Vernooij [Sun, 1 Dec 2013 23:20:36 +0000 (23:20 +0000)]
pyntdb: Add tests for Python API.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agopyntdb: Don't segfault when passing in None as filename (for memory db)
Jelmer Vernooij [Sun, 1 Dec 2013 23:20:35 +0000 (23:20 +0000)]
pyntdb: Don't segfault when passing in None as filename (for memory db)

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agopyntdb: Don't allow access after a database is closed.
Jelmer Vernooij [Sun, 1 Dec 2013 23:20:34 +0000 (23:20 +0000)]
pyntdb: Don't allow access after a database is closed.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agotdb tests: Remove custom code for "tdb2", which has been split out into ntdb.
Jelmer Vernooij [Sun, 1 Dec 2013 23:20:33 +0000 (23:20 +0000)]
tdb tests: Remove custom code for "tdb2", which has been split out into ntdb.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoselftest: Remove samba3.smb2.lock.*.rw-exclusive from flapping file
Christof Schmitt [Thu, 5 Dec 2013 22:53:47 +0000 (15:53 -0700)]
selftest: Remove samba3.smb2.lock.*.rw-exclusive from flapping file

This test demonstrates a problem with byte range locks and AIO.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Dec  6 05:19:37 CET 2013 on sn-devel-104

10 years agoselftest: Run smb2.lock tests also against AIO share
Christof Schmitt [Thu, 5 Dec 2013 22:22:13 +0000 (15:22 -0700)]
selftest: Run smb2.lock tests also against AIO share

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoselftest: Introduce share for testing AIO
Christof Schmitt [Thu, 5 Dec 2013 22:20:06 +0000 (15:20 -0700)]
selftest: Introduce share for testing AIO

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3: Return correct error code from SMB2 AIO read failure
Christof Schmitt [Thu, 5 Dec 2013 23:20:26 +0000 (16:20 -0700)]
s3: Return correct error code from SMB2 AIO read failure

This is similar to commit 27e20d5d60ea8aa526bcb7c2dfc18dd2de0bb97b which
fixed the same case for SMB2 writes: When sending the AIO read fails,
return the real error instead of mapping it to NT_STATUS_FILE_CLOSED.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3-aio: Use correct locking context for SMB2
Christof Schmitt [Thu, 5 Dec 2013 22:57:54 +0000 (15:57 -0700)]
s3-aio: Use correct locking context for SMB2

The synchronous SMB2 reads and writes use open_persistent_id. The AIO
codepathes have to use the same, otherwise a write will conflict with a
lock on the same open file.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3-torture: Call cli_flush().
Andreas Schneider [Wed, 4 Dec 2013 13:02:00 +0000 (14:02 +0100)]
s3-torture: Call cli_flush().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Dec  6 03:07:32 CET 2013 on sn-devel-104

10 years agokrb5_wrap: Move function declaration outside the function.
Andreas Schneider [Wed, 4 Dec 2013 13:01:59 +0000 (14:01 +0100)]
krb5_wrap: Move function declaration outside the function.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3-libsmb: Fix a memory leak in get_pdc_ip().
Andreas Schneider [Wed, 4 Dec 2013 13:01:58 +0000 (14:01 +0100)]
s3-libsmb: Fix a memory leak in get_pdc_ip().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3-torture: Make sure status is used initialized.
Andreas Schneider [Wed, 4 Dec 2013 13:01:57 +0000 (14:01 +0100)]
s3-torture: Make sure status is used initialized.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3-torture: Fix several memory leaks in delete_fn().
Andreas Schneider [Wed, 4 Dec 2013 13:01:56 +0000 (14:01 +0100)]
s3-torture: Fix several memory leaks in delete_fn().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3-utils: Fix a memory leak in smbget.
Andreas Schneider [Wed, 4 Dec 2013 13:01:55 +0000 (14:01 +0100)]
s3-utils: Fix a memory leak in smbget.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos4-torture: Use talloc for asprintf.
Andreas Schneider [Wed, 4 Dec 2013 13:01:54 +0000 (14:01 +0100)]
s4-torture: Use talloc for asprintf.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos4-torture: Fix out of bound array access.
Andreas Schneider [Wed, 4 Dec 2013 13:01:53 +0000 (14:01 +0100)]
s4-torture: Fix out of bound array access.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3-torture: Comment out dead code in spoolss test.
Andreas Schneider [Wed, 4 Dec 2013 13:01:52 +0000 (14:01 +0100)]
s3-torture: Comment out dead code in spoolss test.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos4-torture: Fix some compile warnings in spoolss.
Andreas Schneider [Wed, 4 Dec 2013 13:01:51 +0000 (14:01 +0100)]
s4-torture: Fix some compile warnings in spoolss.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos4-torture: Make sure handles are correctly initialized.
Andreas Schneider [Wed, 4 Dec 2013 13:01:50 +0000 (14:01 +0100)]
s4-torture: Make sure handles are correctly initialized.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos4-torture: Make sure the handles are initialized correctly.
Andreas Schneider [Wed, 4 Dec 2013 13:01:49 +0000 (14:01 +0100)]
s4-torture: Make sure the handles are initialized correctly.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos4-torture: Make sure the handles are not used uninitialized.
Andreas Schneider [Wed, 4 Dec 2013 13:01:48 +0000 (14:01 +0100)]
s4-torture: Make sure the handles are not used uninitialized.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos4-libcli: Add smb2_util_handle_empty().
Andreas Schneider [Wed, 4 Dec 2013 13:01:47 +0000 (14:01 +0100)]
s4-libcli: Add smb2_util_handle_empty().

Will be used in the next commit.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agotorture: match Windows responses to bad shadow copy IDs
David Disseldorp [Thu, 5 Dec 2013 19:12:53 +0000 (20:12 +0100)]
torture: match Windows responses to bad shadow copy IDs

test_fsrvp_bad_id() issues DeleteShareMapping requests with invalid
shadow copy IDs, expect Windows Server 2012 return codes.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agotorture: test duplicate shares in FSRVP shadow-copy set
David Disseldorp [Thu, 5 Dec 2013 19:12:52 +0000 (20:12 +0100)]
torture: test duplicate shares in FSRVP shadow-copy set

MS-FSRVP 3.1.4.4 documents the requirement for failure when duplicate
volume names are encountered on AddToShadowCopySet.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agosmbd: Fix a panic when a smb2 brlock times out
Volker Lendecke [Thu, 5 Dec 2013 14:50:58 +0000 (15:50 +0100)]
smbd: Fix a panic when a smb2 brlock times out

Found by Peter Somogyi.

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 Dec  5 21:21:35 CET 2013 on sn-devel-104

10 years agosmbtorture: New torture test for bug #9870.
Jeremy Allison [Wed, 4 Dec 2013 01:26:26 +0000 (17:26 -0800)]
smbtorture: New torture test for bug #9870.

Not fetching the latest modification time on a folder if we have read locks on it.

Prove we should just rely on the mtime value from the underlying
filesystem, even with an open handle.

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

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): Thu Dec  5 10:05:06 CET 2013 on sn-devel-104

10 years agosmbd - allow updates on directory write times on open handles.
Jeremy Allison [Wed, 4 Dec 2013 01:22:19 +0000 (17:22 -0800)]
smbd - allow updates on directory write times on open handles.

If we set a non-null 'old timestamp' in the share mode database
when creating a directory handle, this prevents mtime (write time)
updates from being seen by clients, as we will always return the
timestamp stored in the database whilst the handle is open.

For files this is ok, as we update the stored timestamp
ourselves when we write to the handle. For directories
we should just rely on the mtime value from the underlying
filesystem.

Torture test to follow.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 years agoidmap_cache: Use gencache_parse
Volker Lendecke [Wed, 4 Dec 2013 15:37:21 +0000 (15:37 +0000)]
idmap_cache: Use gencache_parse

This avoids a few tallocs and brings down user CPU a bit more

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Dec  5 03:06:10 CET 2013 on sn-devel-104

10 years agoidmap_cache: Use an fstring instead of talloc_asprintf
Volker Lendecke [Wed, 4 Dec 2013 15:14:03 +0000 (15:14 +0000)]
idmap_cache: Use an fstring instead of talloc_asprintf

In a test doing one million uid2sid calls this brings down user CPU from
1.3 seconds to 0.9 seconds. And it saves a few code lines.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agomessaging3: Do not go through messages.tdb for self-sends
Volker Lendecke [Tue, 3 Dec 2013 13:20:38 +0000 (13:20 +0000)]
messaging3: Do not go through messages.tdb for self-sends

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agotorture: enum snapshots after FSRVP creation
David Disseldorp [Tue, 3 Dec 2013 13:45:50 +0000 (14:45 +0100)]
torture: enum snapshots after FSRVP creation

Issue an SMB2 ENUM_SNAPSHOTS ioctl following FSRVP snapshot creation to
cover Explorer previous file version use-cases.

This test will fail against Windows Server 2012, as FSRVP created
snapshots are not exposed via the ENUM_SNAPSHOTS ioctl.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agotest: add fake_snap.pl for snapshot simulation
David Disseldorp [Tue, 3 Dec 2013 13:45:49 +0000 (14:45 +0100)]
test: add fake_snap.pl for snapshot simulation

The script simulates snapshots by simply copying file data from the base
path to a snapshot path located under .snapshots/@GMT-%Y.%m.%d-%H.%M.%S/

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb:tests: update README
Michael Adam [Fri, 29 Nov 2013 09:15:20 +0000 (10:15 +0100)]
ctdb:tests: update README

explain how to run individual tests and test collections and remove mention of
tests/scripts/run_tests which does not exist any more.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb/tests/scripts: Promote scripts/run_tests
Martin Schwenke [Mon, 2 Dec 2013 04:39:48 +0000 (15:39 +1100)]
ctdb/tests/scripts: Promote scripts/run_tests

The wrapper is not needed anymore.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb/tests/scripts: Simplify the top-level test scripts
Martin Schwenke [Mon, 2 Dec 2013 04:37:18 +0000 (15:37 +1100)]
ctdb/tests/scripts: Simplify the top-level test scripts

At the moment run_tests.sh has quite fragile argument processing.  It
needs that annoying "--" between options and tests.  The random
default (mktemp -d) for TEST_VAR_DIR is wrong and is worked around in
various places.

Instead:

* Change the default behaviour to print a summary, add new option -N
  to turn off summary, and remove old -s option.

* Change the default behaviour to run integration tests with local
  daemons, add new options -c to run on a cluster, remove old -l
  option.

* Make $testdir/var the default if the tests are not installed, and
  $(mktemp -d ) the default if tests are installed.

* Move the default tests for local/cluster into scripts/run_tests.

run_tests.sh (and the run_cluster_tests.sh symlink) should behave as
before but with slightly more reasonable defaults.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb/tests/scripts: Sort command-line options
Martin Schwenke [Mon, 2 Dec 2013 04:30:29 +0000 (15:30 +1100)]
ctdb/tests/scripts: Sort command-line options

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb/tests/integration: Decentralise the daemon restart code
Martin Schwenke [Fri, 29 Nov 2013 03:07:43 +0000 (14:07 +1100)]
ctdb/tests/integration: Decentralise the daemon restart code

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb/tests/integration: Update daemons shutdown pseudo-test
Martin Schwenke [Fri, 29 Nov 2013 03:05:49 +0000 (14:05 +1100)]
ctdb/tests/integration: Update daemons shutdown pseudo-test

Don't scatter the TEST_LOCAL_DAEMONS logic around the code.  Limit it
to the local daemons file.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb/tests/simple: Local daemons version of setup_ctdb() overrides
Martin Schwenke [Thu, 28 Nov 2013 06:27:06 +0000 (17:27 +1100)]
ctdb/tests/simple: Local daemons version of setup_ctdb() overrides

setup_ctdb() doesn't need to do anything on a cluster.  To avoid a
conditional, just override it for local daemons.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb/tests/integration: Remove some unused functions
Martin Schwenke [Thu, 28 Nov 2013 06:26:09 +0000 (17:26 +1100)]
ctdb/tests/integration: Remove some unused functions

This was the start of some refactorisation that was never completed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb/tests/integration: Remove the time logging code
Martin Schwenke [Thu, 28 Nov 2013 06:11:03 +0000 (17:11 +1100)]
ctdb/tests/integration: Remove the time logging code

This hasn't been required for a long time and is probably broken.  If
it is needed in future then we know where to find it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb/tests/simple: Move the local daemons code to its own file
Martin Schwenke [Thu, 28 Nov 2013 06:08:43 +0000 (17:08 +1100)]
ctdb/tests/simple: Move the local daemons code to its own file

This is just a straight move.  The clever stuff will follow.  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb/tests/integration: Update NFS tickles test and supporting code
Martin Schwenke [Thu, 28 Nov 2013 05:43:55 +0000 (16:43 +1100)]
ctdb/tests/integration: Update NFS tickles test and supporting code

This currently requires an eventscript to be dynamically installed.
This eventscript is only used to help determine when a monitor event
has occurred.  This code is horrible and fragile.

A better way is to just monitor the output of "ctdb scriptstatus".
When changes it changes then a monitor event has occurred.

Also remove the old code that checks for tickle information in shared
storage.  CTDB hasn't done things this way for a long time.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agolib/replace remove orphaned code
Christian Ambach [Fri, 22 Nov 2013 04:11:01 +0000 (05:11 +0100)]
lib/replace remove orphaned code

this is not compiled and used anymore

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Wed Dec  4 22:55:12 CET 2013 on sn-devel-104

10 years agos3:utils remove orphaned code
Christian Ambach [Fri, 22 Nov 2013 04:09:08 +0000 (05:09 +0100)]
s3:utils remove orphaned code

this does not even compile at all.. looks like a real orphan

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
10 years agosmbd: Avoid calling notify_filter_string for low debuglevels
Volker Lendecke [Mon, 2 Dec 2013 20:32:47 +0000 (21:32 +0100)]
smbd: Avoid calling notify_filter_string for low debuglevels

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): Wed Dec  4 20:09:39 CET 2013 on sn-devel-104

10 years agoldb: use of NULL pointer bugfix
Pavel Reichl [Tue, 3 Dec 2013 14:37:20 +0000 (14:37 +0000)]
ldb: use of NULL pointer bugfix

Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Tue Dec  3 21:13:53 CET 2013 on sn-devel-104

10 years agos4-rpc: dnsserver: Ignore duplicate dns zones from multiple locations
Amitay Isaacs [Fri, 4 Oct 2013 06:10:31 +0000 (16:10 +1000)]
s4-rpc: dnsserver: Ignore duplicate dns zones from multiple locations

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Kai Blin <kai@samba.org>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Sat Nov 30 06:15:52 CET 2013 on sn-devel-104

10 years agos4-dns: Ignore duplicate dns zones from multiple locations in dlz_bind9
Amitay Isaacs [Wed, 2 Oct 2013 07:28:45 +0000 (17:28 +1000)]
s4-dns: Ignore duplicate dns zones from multiple locations in dlz_bind9

BIND DLZ module currently loads DNS zones from DNS partitions and domain
partitions using following prefixes:

   CN=MicrosoftDNS,DC=DomainDnsZones
   CN=MicrosoftDNS,DC=ForestDNSZones
   CN=MicrosoftDNS,CN=System

Windows supports DNS zones duplicated in DNS partitions and domain
partition and updates both of them simultaneously.

BIND DLZ module can handle DNS zones stored either in DNS partitions
or domain partition, but not both.  This patch ignores duplicate zones
from domain partition and allows BIND9 to work with AD with duplicate
DNS zones.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Kai Blin <kai@samba.org>
10 years agonetcmd/dns: Catch wildcard patterns when querying for name
Amitay Isaacs [Fri, 2 Aug 2013 08:53:56 +0000 (18:53 +1000)]
netcmd/dns: Catch wildcard patterns when querying for name

DNS query should either be '@' to represent entire zone or a fixed string
and not wildcard search pattern.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Kai Blin <kai@samba.org>
10 years agofail authentication for single group name which cannot be converted to sid
Noel Power [Wed, 16 Oct 2013 15:30:55 +0000 (16:30 +0100)]
fail authentication for single group name which cannot be converted to sid

furthermore if more than one name is supplied and no sid is converted
then also fail.

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Nov 29 15:45:11 CET 2013 on sn-devel-104

10 years agoreplace: fix typo in variable name
David Disseldorp [Thu, 28 Nov 2013 14:56:58 +0000 (15:56 +0100)]
replace: fix typo in variable name

13550a2b5eed57084a5d9671d9493a9a2e08d7e3 added a typo causing
compilation failure.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Nov 28 18:16:27 CET 2013 on sn-devel-104

10 years agopam_winbind: Use strlcat in safe_append_string
Volker Lendecke [Thu, 28 Nov 2013 08:37:47 +0000 (09:37 +0100)]
pam_winbind: Use strlcat in safe_append_string

We have that available via libreplace, so use it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Nov 28 14:33:32 CET 2013 on sn-devel-104

10 years agoreplace: Don't run over dst in strlcat
Volker Lendecke [Thu, 28 Nov 2013 08:33:59 +0000 (09:33 +0100)]
replace: Don't run over dst in strlcat

If "d" is not 0-terminated, the pure strlen will read beyond the end
of the given bufsize. strlcat in libbsd deliberately avoids this, so we
should do the same.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agoctdb:tests: in the stub "ip link show" command use echo instead of cat
Michael Adam [Wed, 27 Nov 2013 22:43:53 +0000 (23:43 +0100)]
ctdb:tests: in the stub "ip link show" command use echo instead of cat

This case of "ip link show" does not break autobuild with
"Broken pipe" messages, but let's be consistent.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Nov 28 09:23:03 CET 2013 on sn-devel-104

10 years agoautobuild: Run ctdb regression tests
Amitay Isaacs [Thu, 14 Nov 2013 06:38:29 +0000 (17:38 +1100)]
autobuild: Run ctdb regression tests

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoautobuild: build the "ctdb" target with socket-wrapper enabled
Michael Adam [Thu, 14 Nov 2013 13:13:01 +0000 (14:13 +0100)]
autobuild: build the "ctdb" target with socket-wrapper enabled

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:test: remove unused ip2ipmask from integration.bash
Michael Adam [Wed, 27 Nov 2013 21:28:06 +0000 (22:28 +0100)]
ctdb:test: remove unused ip2ipmask from integration.bash

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:tests:76_ctdb_pdb_recovery: change from using ctdb pstore to ctdb ptrans.
Michael Adam [Wed, 27 Nov 2013 10:42:28 +0000 (11:42 +0100)]
ctdb:tests:76_ctdb_pdb_recovery: change from using ctdb pstore to ctdb ptrans.

This removes the requirement to create a temporary file
and hence makes this test runnable against local daemons
and against a real cluster without further changes.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:tests:76_ctdb_pdb_recovery: fix a typo in a message
Michael Adam [Wed, 27 Nov 2013 22:28:24 +0000 (23:28 +0100)]
ctdb:tests:76_ctdb_pdb_recovery: fix a typo in a message

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:tests:76_ctdb_pdb_recovery: fix a typo in a message
Michael Adam [Wed, 27 Nov 2013 10:40:53 +0000 (11:40 +0100)]
ctdb:tests:76_ctdb_pdb_recovery: fix a typo in a message

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:tests: in the stub ip command, avoid broken pipe by using echo instead of cat
Michael Adam [Wed, 27 Nov 2013 11:13:40 +0000 (12:13 +0100)]
ctdb:tests: in the stub ip command, avoid broken pipe by using echo instead of cat

This fixes running "make autotest" from autobuild, since
it prevents irritating error output in delete_ip_from_iface()
when calling ip addr list ... | grep -Fq "inet ..." .

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:tests: ignore SIGPIPE in unit tests
Michael Adam [Thu, 21 Nov 2013 23:35:35 +0000 (00:35 +0100)]
ctdb:tests: ignore SIGPIPE in unit tests

This makes scripts called in the unit tests behave like
when called from ctdbd which ignodes SIGPIPE.
This also makes the scrips behave the same when
called from "make autotest" directly and via autobuild (python).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:tests: add path of ip command to extra output in the error case
Michael Adam [Thu, 21 Nov 2013 08:29:33 +0000 (09:29 +0100)]
ctdb:tests: add path of ip command to extra output in the error case

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb:tests: remove old now unused script test/recover.sh
Michael Adam [Thu, 21 Nov 2013 07:39:25 +0000 (08:39 +0100)]
ctdb:tests: remove old now unused script test/recover.sh

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb:build: Update mkversion.sh to use samba-* tags
Martin Schwenke [Thu, 28 Nov 2013 01:23:57 +0000 (12:23 +1100)]
ctdb:build: Update mkversion.sh to use samba-* tags

To test CTDB on a cluster we need to be able to build test RPMs with
relatively sane version numbers.  This is a minimal change to allow
that to happen, until CTDB is integrated into the Samba build system.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoCope with first element in hdb_method having a different name in different heimdal...
Jelmer Vernooij [Sat, 23 Nov 2013 19:46:29 +0000 (19:46 +0000)]
Cope with first element in hdb_method having a different name in different heimdal versions.

It's called `interface_version` in older Heimdal versions and
`version` in newer versions.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Nov 28 04:17:55 CET 2013 on sn-devel-104