samba.git
9 years agos3: lib: libsmbclient: If reusing a server struct, check every cli->timout milisecond...
Jeremy Allison [Wed, 18 Mar 2015 21:15:16 +0000 (14:15 -0700)]
s3: lib: libsmbclient: If reusing a server struct, check every cli->timout miliseconds if it's still valid before use.

Uses an cli_echo() call to do so.

Based on code from <shargagan@novell.com>

Bug 11079 - libsmbclient not checking the cached connection alive status before re-using it from connection cache

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Mar 20 13:48:26 CET 2015 on sn-devel-104

(cherry picked from commit 4f4151ea050a5f34e42d73a4bf9448c673a35787)

9 years agos3: libcli: smb1: Ensure we correctly finish a tevent req if the writev fails in...
Jeremy Allison [Thu, 19 Mar 2015 17:40:56 +0000 (10:40 -0700)]
s3: libcli: smb1: Ensure we correctly finish a tevent req if the writev fails in the SMB1 case.

We haven't added the req to the pending array yet, as SMB1 requests can
be one-way (no reply needed). So if we error out after the writev, but
before we add to the pending array we must rember to terminate our current
tevent req with a tevent_req_nterror call.

Fixes bug 11173 - SMB1 Server disconnect can cause timeout on client write error.

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

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): Fri Mar 20 05:08:25 CET 2015 on sn-devel-104

(cherry picked from commit 00d92f59257ce8fe1729becd72e13a42dfff0589)

9 years agos3: lib: ntlmssp: If NTLMSSP_NEGOTIATE_TARGET_INFO isn't set, cope with servers that...
Jeremy Allison [Mon, 9 Mar 2015 21:27:43 +0000 (14:27 -0700)]
s3: lib: ntlmssp: If NTLMSSP_NEGOTIATE_TARGET_INFO isn't set, cope with servers that don't send the 2 unused fields.

Packet traces showing such servers are found in the bug this fixes:

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

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): Thu Mar 19 12:05:56 CET 2015 on sn-devel-104

(cherry picked from commit ffe33940faa6fb762fd2483f0245448b0434be00)

9 years agos4: lib: auth: If NTLMSSP_NEGOTIATE_TARGET_INFO isn't set, cope with servers that...
Jeremy Allison [Mon, 9 Mar 2015 21:21:22 +0000 (14:21 -0700)]
s4: lib: auth: If NTLMSSP_NEGOTIATE_TARGET_INFO isn't set, cope with servers that don't send the 2 unused fields.

Packet traces showing such servers are found in the bug this fixes:

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 5137af570d8a173d7775754ad2e60d6d8efbe3a2)

9 years agodocs/idmap_rid: remove deprecated base_rid from example
David Disseldorp [Fri, 16 Jan 2015 15:21:24 +0000 (16:21 +0100)]
docs/idmap_rid: remove deprecated base_rid from example

The base_rid option has been deprecated for some time. Specifying a
value of 1000 (as recommended in the parameter description and example
section) can result in failed mapping of group SIDs, where RIDs do not
start at 1000.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Jan 19 09:09:22 CET 2015 on sn-devel-104

(cherry picked from commit 8466587c589f01d59294be36ad0b347f5d82a11f)

9 years agolibcli/auth: Match Declaration of netlogon_creds_cli_context_tmp with implementation
Thomas Schulz [Mon, 16 Mar 2015 17:21:46 +0000 (10:21 -0700)]
libcli/auth: Match Declaration of netlogon_creds_cli_context_tmp with implementation

I have been building 4.2.0 with the GNU C compiler but I decided to see
how it works with the Sun C 5.11 compiler. The Sun compiler complains
about a identifier being redeclared in libcli/auth/netlogon_creds_cli.c

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

Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 820a0a91fbd341f3172b0d048a920cb2538bbd38)

9 years agoUpdate libwbclient version to 0.12
Matthew Newton [Sun, 1 Mar 2015 23:14:07 +0000 (23:14 +0000)]
Update libwbclient version to 0.12

Increment the minor version of the libwbclient library after new
context functions added. (Major version increase not required as
the only two functions with changed parameters are private to the
library.)

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

Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 10 03:24:45 CET 2015 on sn-devel-104

(cherry picked from commit c6cb2d650872a8c37820b65bb2d5882207263e88)

9 years agoMove wbc global variables into global context instead
Matthew Newton [Sun, 22 Feb 2015 23:31:48 +0000 (23:31 +0000)]
Move wbc global variables into global context instead

There are some global variables in use in the libwbclient
library. Now that we have a context, move these into it so that
they are thread-safe when the wbcCtx* functions are used.

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

Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 2664d9070f3c21231627380822e619fb695db662)

9 years agoAdd context versions of wbclient functions
Matthew Newton [Sat, 21 Feb 2015 22:30:11 +0000 (22:30 +0000)]
Add context versions of wbclient functions

To make the libwbclient library thread-safe, all functions
that call through to wb_common winbindd_request_response need
to have context that they can use. This commit adds all the
necessary functions.

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

Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 063c56dba590eec69439eb791a420b40505d4cc0)

9 years agoAdd wbcContext to wbcRequestResponse
Matthew Newton [Sat, 24 Jan 2015 00:30:00 +0000 (00:30 +0000)]
Add wbcContext to wbcRequestResponse

To enable libwbclient to pass winbindd context through
to the winbind client library in wb_common.

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

Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 348f93ff6e25c43e0233432bd2134bb9eacb0b87)

9 years agoAdd wbcContext struct, create and free functions
Matthew Newton [Sat, 21 Feb 2015 00:19:32 +0000 (00:19 +0000)]
Add wbcContext struct, create and free functions

The basic context structure and functions for libwbclient so that
libwbclient can be made thread-safe.

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

Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit bc75e723ce063149278c95327ef91959718d27be)

9 years agoUse global context for winbindd_request_response
Matthew Newton [Fri, 23 Jan 2015 23:58:53 +0000 (23:58 +0000)]
Use global context for winbindd_request_response

Updating API call in libwbclient, wbinfo, ntlm_auth and
winbind_nss_* as per previous commit to wb_common.c.

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

Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 83cfb84b78ce7141652f1fdc7f01978cdb69343f)

9 years agoMake winbind client library thread-safe by adding context
Matthew Newton [Fri, 23 Jan 2015 22:35:50 +0000 (22:35 +0000)]
Make winbind client library thread-safe by adding context

Rather than keep state in global variables, store the current
context such as the winbind file descriptor in a struct that is
passed in. This makes the winbind client library thread-safe.

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

Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 60c7571984d7f1612828a72fae3ed8e66037d1f7)

9 years agotalloc: version 2.1.2
Stefan Metzmacher [Mon, 9 Mar 2015 08:07:24 +0000 (09:07 +0100)]
talloc: version 2.1.2

Changes:
- Allow destructors to reparent the object
- Allow destructors to remove itself
- Build improvements

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
The last 5 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11144
Memory leak in SMB2 notify handling.

9 years agotalloc: fix _talloc_total_limit_size prototype
Stefan Metzmacher [Tue, 27 Jan 2015 12:07:34 +0000 (13:07 +0100)]
talloc: fix _talloc_total_limit_size prototype

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 years agolib: talloc: Test suite for the new destructor reparent logic.
Jeremy Allison [Wed, 4 Mar 2015 01:12:32 +0000 (17:12 -0800)]
lib: talloc: Test suite for the new destructor reparent logic.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Mar  8 20:52:43 CET 2015 on sn-devel-104

9 years agolib: talloc: Allow destructors to reparent the object they're called on.
Jeremy Allison [Wed, 4 Mar 2015 01:02:47 +0000 (17:02 -0800)]
lib: talloc: Allow destructors to reparent the object they're called on.

If a destructor returns failure (-1) when freeing a child, talloc
must then reparent the child.

Firstly it tries the owner of any reference, next the parent of the
current object calling _talloc_free_children_internal(), and finally
the null context in the last resort.

If a destructor reparented its own object, which can be a very
desirable thing to do (a destructor can make a decision it isn't
time to die yet, and as the parent may be going away it might
want to move itself to longer-term storage) then this new parent
gets overwritten by the existing reparenting logic.

This patch checks when freeing a child if it already reparented
itself, and if it did doesn't then overwrite the new parent.

Makes destructors more flexible.

Needed for bug:

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agolib: talloc: Fix bug when calling a destructor.
Jeremy Allison [Thu, 5 Mar 2015 20:48:47 +0000 (12:48 -0800)]
lib: talloc: Fix bug when calling a destructor.

If the destructor itself calls talloc_set_destructor()
and returns -1, the new destructor set is overwritten
by talloc.

Dectect that and leave the new destructor in place.

Needed for bug:

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3-winbind: Fix chached user group lookup of trusted domains.
Michael Adam [Mon, 9 Mar 2015 14:15:37 +0000 (15:15 +0100)]
s3-winbind: Fix chached user group lookup of trusted domains.

If a user group lookup has aleady been done before with a machine
account we did always return the incomplete information from the cache.
This patch makes sure we return the correct group information from the
netsamlogon cache.

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

Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit f5d0204bfa1eb641fe7697613c1f773b6a7e65de)

9 years agoBe consistent about what functions add $LISTOPT and $LOADLIST to the command-line.
Jelmer Vernooij [Sat, 1 Nov 2014 23:36:54 +0000 (16:36 -0700)]
Be consistent about what functions add $LISTOPT and $LOADLIST to the command-line.

Change-Id: Ife86624b53a99d48ce9f00d146b14f798c9bdb24
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Sun Nov 30 16:43:52 CET 2014 on sn-devel-104

(cherry picked from commit 02e063bd5be06925489f735c51225b65ff961d6b)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoselftest: Add separate command line for listing tests, allowing us of subunit-filter...
Jelmer Vernooij [Sat, 1 Nov 2014 22:13:18 +0000 (15:13 -0700)]
selftest: Add separate command line for listing tests, allowing us of subunit-filter (which doesn't support subunit v2).

Change-Id: Icb877214a422c63fd38ef92425c7b4fe7ee19ad5
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 0f408599f83f5d8e68f0fb0f765143aa6620651e)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoselftest/tests.py: Remove testsuite samba.tests.samdb which does not have any tests.
Jelmer Vernooij [Sat, 1 Nov 2014 23:06:09 +0000 (16:06 -0700)]
selftest/tests.py: Remove testsuite samba.tests.samdb which does not have any tests.

Change-Id: I8edcf73aa4a9b61c6e5c7cfb592a4692d4030a29
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit c3855dae71e557b824ad2679acd8bb5ad85936e2)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoRe-use add_prefix function.
Jelmer Vernooij [Sat, 1 Nov 2014 21:40:30 +0000 (14:40 -0700)]
Re-use add_prefix function.

Change-Id: I6e91bc9fc6714c147427e920ca0e3e22cb9a076b
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit afe94aa53549ec66cb48959260753a4fa424e481)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoselftest: Drop support for TESTSUITE-IDLIST, and remove its last user.
Jelmer Vernooij [Mon, 27 Oct 2014 03:17:20 +0000 (20:17 -0700)]
selftest: Drop support for TESTSUITE-IDLIST, and remove its last user.

Change-Id: Ic616676bb770fa4769195d73c4309915646caae0
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit f6e3cd7f03a15595a2fa65c22a56c60d7d3f8bff)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agosam: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 17:00:09 +0000 (09:00 -0800)]
sam: Use samba.tests.subunitrun.

Change-Id: Ic2ac4b335cf805ddbd442a065c4eaf6ef2b210d9
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 869a9f7a3a01810c1c1e3287b82034f67457b0b5)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoUse samba.tests.subunitrun in dsdb ldap and ldap_schema tests.
Jelmer Vernooij [Sun, 2 Nov 2014 04:31:18 +0000 (21:31 -0700)]
Use samba.tests.subunitrun in dsdb ldap and ldap_schema tests.

Change-Id: I51ddc55720a23013a2c6ae20e3225f027348083c
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 4f75f17ba7c9b80cf3aa0ce2db57e1754464403a)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoUse samba.tests.subunitrun in urgent replication test.
Jelmer Vernooij [Sun, 2 Nov 2014 04:22:59 +0000 (21:22 -0700)]
Use samba.tests.subunitrun in urgent replication test.

Change-Id: I3e7a32876d557ac376326ab75e851298e874d584
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 98b5380af65ea1ec760d00187355384de0757b04)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoInclude mimeparse, which is used by subunit/testtools.
Jelmer Vernooij [Sat, 1 Nov 2014 14:09:00 +0000 (07:09 -0700)]
Include mimeparse, which is used by subunit/testtools.

Change-Id: I984c82acc0bc82a165e8ea17d8948c465c786905
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Sat Nov 22 04:44:11 CET 2014 on sn-devel-104

(cherry picked from commit 2c67d55614668583dc6290c6db86d5229fb654ea)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoldap: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 17:44:05 +0000 (09:44 -0800)]
ldap: Use samba.tests.subunitrun.

Change-Id: I872654afb31a5eda8c88aac716f9ce79816e5f05
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit d857e7b1a7a2cc1f7f4f9f2ffd5a11f8c627ae39)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agodeletetest: use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 17:39:17 +0000 (09:39 -0800)]
deletetest: use samba.tests.subunitrun.

Change-Id: I13565c7c14ea186709ce1de9038ef840c5b766b8
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit cfb5e9bbf2bde885c50097ab0a2914c674e65860)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoldap_syntaxes: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 17:32:58 +0000 (09:32 -0800)]
ldap_syntaxes: Use samba.tests.subunitrun.

Change-Id: Ib62b747876b4408fdc8ff44e9b4c63578e1a6408
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 6fb26c0e29d74c793f8714b057e0ed0e5ee0cc37)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agopassword lockout: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 17:30:50 +0000 (09:30 -0800)]
password lockout: Use samba.tests.subunitrun.

Change-Id: I848099d22acd4a0ce7d589de48eb72e2d180ceae
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 3961bd68cad510c3ac06270036b54b065d0c3566)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agopasswords: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 17:13:06 +0000 (09:13 -0800)]
passwords: Use samba.tests.subunitrun.

Change-Id: Ib806f63ef412fec264445eefd82146e5140b0bac
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit eae1efca41f4714afedff74afe330aad970f44ab)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agosec_descriptor: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 16:57:37 +0000 (08:57 -0800)]
sec_descriptor: Use samba.tests.subunitrun.

Change-Id: I5caba3e27ad21cc5381883a823e0ec5e2966a264
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 0c82bdda0fddab4aa6bdbbbe13b6f888ed1c2c67)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agotoken_group: Use samba.tests.subunitrun.
Andrew Bartlett [Fri, 6 Mar 2015 01:41:50 +0000 (14:41 +1300)]
token_group: Use samba.tests.subunitrun.

Change-Id: Id7c247451532eded1f44ef9b1aa1808dd18098c6
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(backport similar to commit fc0b8aac9d5f1f77aa9a412fa5da2cc6b1a984ae)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agosites: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 16:37:08 +0000 (08:37 -0800)]
sites: Use samba.tests.subunitrun.

Change-Id: Ic06e1a0f7174683b6b817a5412b8635145329c00
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 330597507c796db55a48b084c7542f03ee4a93ee)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agospeedtest: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 16:32:24 +0000 (08:32 -0800)]
speedtest: Use samba.tests.subunitrun.

Change-Id: Id842c3f74aec24faeab68e975ff4d9e9a0dc337b
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit d6545fe27b35e63781f9f87fe9262bb933ffa9be)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agocredentials test: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 16:30:23 +0000 (08:30 -0800)]
credentials test: Use samba.tests.subunitrun.

Change-Id: I8970c66de9535cb8d48b17d88b2759b7d1e39cb8
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 8d933a84c96859cbb782d5ac693f9badf2531947)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agosec_descriptor test: Simplify, use samba.tests.subunitrun module.
Jelmer Vernooij [Sun, 2 Nov 2014 16:23:36 +0000 (08:23 -0800)]
sec_descriptor test: Simplify, use samba.tests.subunitrun module.

Change-Id: I4ffda49cf3e209eaa28fc83f6fd9ded47f0ad7ee
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 21280da0d6a4e3c547de8f486fe6ae84eea3f135)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoMove option handling into samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 04:17:39 +0000 (21:17 -0700)]
Move option handling into samba.tests.subunitrun.

Change-Id: I65a73b74854af636413f4f284147f3bcf28b6f82
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit ee281c61d01b5fb167571b8ace5e739758100db6)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoMove option parsing to samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 04:08:49 +0000 (21:08 -0700)]
Move option parsing to samba.tests.subunitrun.

Change-Id: I2939c1b6ebb9739530efa9bc4667668cff7a7aeb
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 24035a6b3ed5ffdb1e75ebd375c3f7c2129742ff)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agosubunitrun: Use new samba.tests.subunitrun module.
Jelmer Vernooij [Sun, 2 Nov 2014 03:57:09 +0000 (20:57 -0700)]
subunitrun: Use new samba.tests.subunitrun module.

Change-Id: Ie32f16d72c80c831adfd9a8d32735fa348962123
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit ed4c07b34b5571c021684e3df6bf5fc63cde69c5)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoAdd convenience class for old-style Samba subunit python tests.
Jelmer Vernooij [Sun, 2 Nov 2014 03:51:46 +0000 (20:51 -0700)]
Add convenience class for old-style Samba subunit python tests.

Change-Id: I84a97cc71cfa99c14e0c93ec19ff9eea6149bb5a
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 8d8d800a0f8ea3e822ee4d3693058b24307ba4e2)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoAdd bundled copy of 'extras' python module used by newer versions of testtools/subunit.
Jelmer Vernooij [Sat, 25 Oct 2014 18:09:10 +0000 (11:09 -0700)]
Add bundled copy of 'extras' python module used by newer versions of testtools/subunit.

Change-Id: I5ad9222ccb4228a4b16d54a578276d4b9d4e6c4d
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit a92877f955baf0ed8420f77898bd4405bd319c67)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agofilter-subunit: Consistently use spaces rather than tabs.
Jelmer Vernooij [Sun, 26 Oct 2014 18:31:38 +0000 (11:31 -0700)]
filter-subunit: Consistently use spaces rather than tabs.

Change-Id: I760399cb4bf0aa9753f5f1e842919b386e1caca9
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Wed Nov 19 20:50:29 CET 2014 on sn-devel-104

(cherry picked from commit 71a9e5da2be8feae2f7cbb248b7c091f435d964e)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoSupport using system ldbmodify.
Jelmer Vernooij [Sat, 1 Nov 2014 17:17:23 +0000 (10:17 -0700)]
Support using system ldbmodify.

Fixes this test when bin/ldbmodify isn't built because we're using the
system ldbmodify.

Change-Id: I2ff0d9808245353006c6be4989976a3edad8f98e
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 49445541e750328fc9b766593eddc61a65f97ccb)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoFix subunit test suite name.
Jelmer Vernooij [Sat, 1 Nov 2014 22:57:35 +0000 (15:57 -0700)]
Fix subunit test suite name.

Only run it when testscenarios is installed, as it depends on that.

Change-Id: I1e1284024cf94f909e585a55b8a15e33273f167b
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit fb08cd5310c2c806e49597da4c3a310b058645ae)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agodsdb.tests.acl: Create and run a single testsuite, should easy migration to regulary...
Jelmer Vernooij [Sun, 2 Nov 2014 03:06:52 +0000 (20:06 -0700)]
dsdb.tests.acl: Create and run a single testsuite, should easy migration to regulary Python unit tests.

Change-Id: I89072d3af1d90e87a47c197d28943f47cedc5deb
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 1800bc567d56d0c193410a83692185ebbbce7f43)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agodsdb.tests.ldap: Create and run a single testsuite, should easy migration to regulary...
Jelmer Vernooij [Sun, 2 Nov 2014 03:07:02 +0000 (20:07 -0700)]
dsdb.tests.ldap: Create and run a single testsuite, should easy migration to regulary Python unit tests.

Change-Id: I07216ff1063e127b541bf4e5d6349d5a75cec678
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit d8177912be179dc4342118827ce439048df43ef9)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agospeedtest: Create and run a single testsuite, should easy migration to regulary Pytho...
Jelmer Vernooij [Sun, 2 Nov 2014 03:09:12 +0000 (20:09 -0700)]
speedtest: Create and run a single testsuite, should easy migration to regulary Python unit tests.

Change-Id: Ib31eb26b8f6094a51cd4985b9ae98d018ae95c2d
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 5757c5071e3cf5f207bc9772beffe5c2a7eb22f3)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agodirsync test: Create and run a single testsuite, should easy migration to regulary...
Jelmer Vernooij [Sun, 2 Nov 2014 03:27:30 +0000 (20:27 -0700)]
dirsync test: Create and run a single testsuite, should easy migration to regulary Python unit tests.

Change-Id: I6fbffd6453f8af966938943f2895bd6d93f8fb59
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 7f0969d79a45c7ae4c62a319889680bf3117b71c)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agofilter-subunit: Drop support for allow_empty_output hack.
Jelmer Vernooij [Mon, 13 Oct 2014 04:18:08 +0000 (21:18 -0700)]
filter-subunit: Drop support for allow_empty_output hack.

Change-Id: If4f336ef770202dcf69484b9bccc6c0c80bd5f9b
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): Tue Oct 14 09:06:05 CEST 2014 on sn-devel-104

(cherry picked from commit 0c2c75a2d7afdb3e08aa29f6b996d953dcc3b5a1)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agosamba3dump: Add subunit-enabled test for samba3dump.
Jelmer Vernooij [Mon, 13 Oct 2014 04:17:05 +0000 (21:17 -0700)]
samba3dump: Add subunit-enabled test for samba3dump.

Change-Id: Ie9682c715fc91d923dcd1951236f8b36fa519327
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 77b72d4c8e02e6bba9ef8c90287455a784afe9d8)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agourgent_replication: Use subunit reporting, remove allow_empty_output.
Jelmer Vernooij [Mon, 13 Oct 2014 04:11:22 +0000 (21:11 -0700)]
urgent_replication: Use subunit reporting, remove allow_empty_output.

Change-Id: I6d479b218eff6c4292fbb99e4760bbd62ce1f380
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 23ac8d130c1f476fda5d984531266a6c210c2982)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agoRemove unused imports.
Jelmer Vernooij [Sat, 1 Nov 2014 13:56:09 +0000 (06:56 -0700)]
Remove unused imports.

Change-Id: I8915f62206edb53ffc2d89434e46d9e71db8bb9a
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit f0fa5636e30063a75f2942013fc1579afa3525c2)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11137

9 years agospoolss: retrieve published printer GUID if not in registry
Andreas Schneider [Thu, 18 Dec 2014 15:14:36 +0000 (15:14 +0000)]
spoolss: retrieve published printer GUID if not in registry

When a printer is published, the GUID for the published DN is retrieved
from the domain controller and stored in the registry.
When handling a spoolss GetPrinter(level=7) request, the same GUID is
obtained from the registry and returned to the client.

This change sees the spoolss server query the DC for the published
printer GUID if it is not present in the registry when handling a
spoolss GetPrinter(level=7) request.

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

Pair-Programmed-With: David Disseldorp <ddiss@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit a4157e7c5d75be7003ad0b72fdfe9856a9e5ba8f)

9 years agoprinting: rework nt_printer_guid_store to return errors
Andreas Schneider [Thu, 18 Dec 2014 15:13:27 +0000 (15:13 +0000)]
printing: rework nt_printer_guid_store to return errors

Callers can now choose whether or not to ignore errors.

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

Pair-programmed-with: David Disseldorp <ddiss@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 6595ced146a53dcef9bbd5d2deb82a44c8ce1a1a)

9 years agoprinting: add nt_printer_guid_retrieve() helper
David Disseldorp [Thu, 18 Dec 2014 17:23:11 +0000 (18:23 +0100)]
printing: add nt_printer_guid_retrieve() helper

This function connects to the domain controller and retrieves the
GUID for the corresponding printer DN.

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

Pair-programmed-with: Andreas Schneider <asn@samba.org>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 38dbd054dc331a441b10fdebbdb4bd0fc51cfc0a)

9 years agoprinting: split out printer DN and GUID retrieval
David Disseldorp [Thu, 18 Dec 2014 17:18:21 +0000 (18:18 +0100)]
printing: split out printer DN and GUID retrieval

This functions are used for printer publishing.

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

Pair-programmed-with: Andreas Schneider <asn@samba.org>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 7cabd89789a50d37fc32735968c493092a37e69f)

9 years agobrlock: Use 0 instead of empty initializer list
Christof Schmitt [Wed, 11 Mar 2015 22:54:55 +0000 (15:54 -0700)]
brlock: Use 0 instead of empty initializer list

C does not allow empty initializer lists. Although gcc accepts that, the
SunOS compiler fails in this case with an error.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Thu Mar 12 02:49:36 CET 2015 on sn-devel-104
(cherry picked from commit ddcf3614ce14e7cb03195e36f872043542bc4ec1)

9 years agolib: texpect. Fix the build on Solaris.
Tom Schulz [Fri, 13 Feb 2015 21:47:14 +0000 (13:47 -0800)]
lib: texpect. Fix the build on Solaris.

Bug 11092 - texpect requires routines err and errx

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

Signed-off-by: Tom Schulz <schulz@adi.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Feb 17 18:09:52 CET 2015 on sn-devel-104

(cherry picked from commit 4bbfc54d09d813d1fb827de5855ce40e8eab1095)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Tue Mar 10 00:21:35 CET 2015 on sn-devel-104

9 years agolib/texpect: prefer bsd/libutil.h if available
Stefan Metzmacher [Wed, 10 Dec 2014 12:23:04 +0000 (12:23 +0000)]
lib/texpect: prefer bsd/libutil.h if available

Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Dec 18 16:31:48 CET 2014 on sn-devel-104

(cherry picked from commit 0da7295fbc34170385d2b6bd165685aa092ab0ec)

9 years agolib/texpect: fix compiler warnings
Stefan Metzmacher [Fri, 26 Sep 2014 07:06:59 +0000 (09:06 +0200)]
lib/texpect: fix compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit e27a23e6aa27ae2a9b6ae2e2a2560943157aaa5c)

9 years agolib/texpect: make the code more portable by using "replace.h" and "system/wait.h"
Stefan Metzmacher [Wed, 29 Oct 2014 10:48:59 +0000 (11:48 +0100)]
lib/texpect: make the code more portable by using "replace.h" and "system/wait.h"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 0f0148e020b6f85447f26de17c2b0b002bcdf498)

9 years agolib/texpect: portability fix, include signal.h
Ralph Boehme [Thu, 9 Oct 2014 12:34:02 +0000 (14:34 +0200)]
lib/texpect: portability fix, include signal.h

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit ccb0d9d6169594e8dd1c8935c9dfec51ee7125c4)

9 years agobuild:wafadmin: fix use of spaces instead of tabs.
Michael Adam [Tue, 3 Mar 2015 12:33:10 +0000 (13:33 +0100)]
build:wafadmin: fix use of spaces instead of tabs.

Indentation should not be a mixture of tabs and spaces.
Waf uses tabs.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
(cherry picked from commit 1826f06be7b286c8e343f272766fdb81a930013f)

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

9 years agowaf: Fix the build on openbsd
Volker Lendecke [Mon, 2 Feb 2015 20:08:25 +0000 (21:08 +0100)]
waf: Fix the build on openbsd

We have single-digit vnum='0', make the assignment deal with it

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): Tue Mar  3 03:33:24 CET 2015 on sn-devel-104

(cherry picked from commit a3adad7a1799703c6620d7e6590321d796291831)

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

9 years agoInitialize dwFlags field of DNS_RPC_NODE structure
Samuel Cabrero [Mon, 20 Oct 2014 12:31:01 +0000 (14:31 +0200)]
Initialize dwFlags field of DNS_RPC_NODE structure

This fixes issue #9791, where the MMC shows random data
listing the zone contents.

Signed-off-by: Samuel Cabrero <samuelcabrero@kernevil.me>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 13f0b6fe7720f7c81f11a896337b366a5f050546)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9791

9 years agoVERSION: Bump version up to 4.2.1...
Karolin Seeger [Wed, 4 Mar 2015 19:44:57 +0000 (20:44 +0100)]
VERSION: Bump version up to 4.2.1...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoVERSION: Disable git snapshot for the 4.2.0 release. samba-4.2.0
Karolin Seeger [Wed, 4 Mar 2015 19:44:15 +0000 (20:44 +0100)]
VERSION: Disable git snapshot for the 4.2.0 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoWHATSNEW: Add release notes for Samba 4.2.0.
Karolin Seeger [Wed, 4 Mar 2015 19:48:28 +0000 (20:48 +0100)]
WHATSNEW: Add release notes for Samba 4.2.0.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agotevent: version 0.9.24
David Disseldorp [Tue, 3 Mar 2015 22:58:09 +0000 (23:58 +0100)]
tevent: version 0.9.24

* Ignore unsolicited signal wakeup in tevent_port event loop.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Mar  4 08:33:06 CET 2015 on sn-devel-104

(cherry picked from commit 89788dd3193633f5e88ff194219ad838dcdfab96)

Autobuild-User(v4-2-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-2-test): Wed Mar  4 15:07:48 CET 2015 on sn-devel-104

9 years agotevent: Ignore unexpected signal events in the same way the epoll backend does.
Jeremy Allison [Tue, 3 Mar 2015 00:17:54 +0000 (16:17 -0800)]
tevent: Ignore unexpected signal events in the same way the epoll backend does.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Mar  3 17:33:06 CET 2015 on sn-devel-104

(cherry picked from commit 7be3a5f92ddbb378a3c80e455cb7403f7861efa1)

9 years agobackupkey: Explain more why we use GnuTLS here
Andrew Bartlett [Sun, 15 Feb 2015 22:26:37 +0000 (11:26 +1300)]
backupkey: Explain more why we use GnuTLS here

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 927ea9791e3d1a91516b1cec6918772da83a7fbb)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11097
Win8.1 Credentials Manager issue after KB2992611 on Samba domain

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Wed Mar  4 00:28:59 CET 2015 on sn-devel-104

9 years agotorture-backupkey: Check the dcerpc call return code before calling ndr pull
Garming Sam [Fri, 13 Feb 2015 03:55:07 +0000 (16:55 +1300)]
torture-backupkey: Check the dcerpc call return code before calling ndr pull

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 5ca9a4ebe53fd225e2491a4da4635468fef60829)

9 years agobackupkey: replace heimdal rsa key generation with GnuTLS
Garming Sam [Thu, 12 Feb 2015 20:54:50 +0000 (09:54 +1300)]
backupkey: replace heimdal rsa key generation with GnuTLS

We use GnuTLS because it can reliably generate 2048 bit keys every time.

Windows clients strictly require 2048, no more since it won't fit and no
less either. Heimdal would almost always generate a smaller key.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10980
(cherry picked from commit 43d3e90418b5e0ac5986e08f9483146f4f5d2357)

9 years agobuild: Require GnuTLS if building with Active Directory
Garming Sam [Fri, 13 Feb 2015 03:49:58 +0000 (16:49 +1300)]
build: Require GnuTLS if building with Active Directory

Without GnuTLS, we don't have ldaps:// support and we are unable to
readily create RSA keys of the correct length for the BackupKey
protocol.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit a1f1db277a2c452b63b9fe2d67cabfe0df60223d)

9 years agotorture-backupkey: Add tests that read the secret from the server, and validate
Andrew Bartlett [Thu, 12 Feb 2015 23:59:45 +0000 (12:59 +1300)]
torture-backupkey: Add tests that read the secret from the server, and validate

These show that MS-BKRP 3.1.4.1.1 BACKUPKEY_BACKUP_GUID is incorrect when it
states that the key must be the leading 64 bytes, it must be the whole 256 byte
buffer.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit f7b6e696ed552f02195c87a7eede5a0090f8df1f)

9 years agobackupkey: Better handling for different wrap version headers
Andrew Bartlett [Thu, 12 Feb 2015 03:15:41 +0000 (16:15 +1300)]
backupkey: Better handling for different wrap version headers

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 3254f9bc009bae3d8463035d63eb1625f23606e6)

9 years agobackupkey: Add tests for ServerWrap protocol
Andrew Bartlett [Wed, 11 Feb 2015 04:46:42 +0000 (17:46 +1300)]
backupkey: Add tests for ServerWrap protocol

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit d8cc370d01445b5120678dde02955f13f3773bb2)

9 years agobackupkey: Change expected error codes to match Windows 2008R2 and Windows 2012R2
Andrew Bartlett [Wed, 11 Feb 2015 00:37:16 +0000 (13:37 +1300)]
backupkey: Change expected error codes to match Windows 2008R2 and Windows 2012R2

This is done in both smbtoture and in our server

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 93510eb513598431c260cd0b85a02d0e49cc821b)

9 years agobackupkey: Implement ServerWrap Decrypt
Andrew Bartlett [Tue, 10 Feb 2015 20:53:58 +0000 (09:53 +1300)]
backupkey: Implement ServerWrap Decrypt

We implement both modes in BACKUPKEY_RESTORE_GUID, as it may decrypt
both ServerWrap and ClientWrap data, and we implement
BACKUPKEY_RESTORE_GUID_WIN2K.

BUG: https://bugzilla.samba.org/attachment.cgi?bugid=11097

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit c3c54b9bf36ef5075fdca9042296f033db8673ce)

9 years agobackupkey: Handle more clearly the case where we find the secret, but it has no value
Andrew Bartlett [Tue, 10 Feb 2015 03:26:23 +0000 (16:26 +1300)]
backupkey: Handle more clearly the case where we find the secret, but it has no value

This happen on the RODC, a case that we try not to permit at all.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit cdecd8540a8e5ef1266684fda0dd10d72466d4d8)

9 years agobackupkey: Improve variable names to make clear this is client-provided data
Andrew Bartlett [Tue, 10 Feb 2015 03:23:17 +0000 (16:23 +1300)]
backupkey: Improve variable names to make clear this is client-provided data

The values we return here are client-provided passwords or other keys, that we decrypt for them.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 51086f30dd1f0ca656b5391e1500cc65480564e3)

9 years agobackupkey: Use the name lsa_secret rather than just secret
Andrew Bartlett [Tue, 10 Feb 2015 03:16:20 +0000 (16:16 +1300)]
backupkey: Use the name lsa_secret rather than just secret

This makes it clear that this is the data stored on the LSA secrets store
and not the client-provided data to be encrypted.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 0ff9733479f27cf40a9cc0f749de088d33591272)

9 years agobackupkey: Implement ServerWrap Encrypt protocol
Andrew Bartlett [Tue, 10 Feb 2015 03:02:00 +0000 (16:02 +1300)]
backupkey: Implement ServerWrap Encrypt protocol

BUG: https://bugzilla.samba.org/attachment.cgi?bugid=11097

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 33c616406726a3e144b5b4bbc2c8d3166e0c4be5)

9 years agobackupkey: Improve function names and comments for clarity
Andrew Bartlett [Tue, 10 Feb 2015 02:50:15 +0000 (15:50 +1300)]
backupkey: Improve function names and comments for clarity

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit c55f3936490a89004364a203361d201bee5fce08)

9 years agobackupkey: Move SID comparison to inside get_and_verify_access_check()
Andrew Bartlett [Tue, 10 Feb 2015 02:48:06 +0000 (15:48 +1300)]
backupkey: Move SID comparison to inside get_and_verify_access_check()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit f69b180cf86ad2c43dbbd89c7e906e7ab2350ee2)

9 years agobackupkey: Improve IDL
Garming Sam [Thu, 5 Feb 2015 05:17:58 +0000 (18:17 +1300)]
backupkey: Improve IDL

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit bc0b90a300654a248a08e4796133bb6b880e9789)

9 years agobackupkey: begin by factoring out the server wrap functions
Garming Sam [Wed, 4 Feb 2015 22:07:30 +0000 (11:07 +1300)]
backupkey: begin by factoring out the server wrap functions

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit a4e6873c4356fa221a0833336413f70e7c9411ca)

9 years agotorture-backupkey: Assert dcerpc_bkrp_BackupKey_r call was successful
Andrew Bartlett [Tue, 10 Feb 2015 22:45:45 +0000 (11:45 +1300)]
torture-backupkey: Assert dcerpc_bkrp_BackupKey_r call was successful

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 286223f150dbb84022d48ef845119cd47afc30d3)

9 years agotorture-backupkey: Add consistent assertions that createRestoreGUIDStruct() suceeds
Andrew Bartlett [Tue, 10 Feb 2015 20:51:27 +0000 (09:51 +1300)]
torture-backupkey: Add consistent assertions that createRestoreGUIDStruct() suceeds

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit d9529dbab6f0482d408bf9c4ea9bd911da8897e5)

9 years agos4:torture/rpc/backupkey: Require 2048 bit RSA key
Arvid Requate [Tue, 23 Dec 2014 17:56:20 +0000 (18:56 +0100)]
s4:torture/rpc/backupkey: Require 2048 bit RSA key

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(fixed cleanup of memory)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 16ad6de6b8d4481b1e00630c9a23895d1371d971)

9 years agos4-backupkey: consistent naming of werr variable
Arvid Requate [Tue, 8 Jul 2014 15:25:53 +0000 (17:25 +0200)]
s4-backupkey: consistent naming of werr variable

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit e6e9e490ae1352b0d572dbd3d546c14d367cbedb)

9 years agos4-backupkey: improve variable name
Arvid Requate [Tue, 8 Jul 2014 14:12:13 +0000 (16:12 +0200)]
s4-backupkey: improve variable name

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit e25c61c5f17230a6932f704ed849f140b00a45aa)

9 years agos4-backupkey: typo fix
Arvid Requate [Mon, 7 Jul 2014 16:56:39 +0000 (18:56 +0200)]
s4-backupkey: typo fix

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 8473f6da6902d753ed46073e453a496aa90cb94b)

9 years agos4-backupkey: IDL for ServerWrap subprotocol
Arvid Requate [Mon, 7 Jul 2014 16:48:41 +0000 (18:48 +0200)]
s4-backupkey: IDL for ServerWrap subprotocol

This adds some IDL structs for the ServerWrap subprotocol, allowing
parsing of the incoming RPC calls and returning WERR_NOT_SUPPORTED
instead of WERR_INVALID_PARAM.

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 879b65710b266fecaca01b9dd40474b2cc35d417)

9 years agos4-backupkey: fix ndr_pull error on empty input
Arvid Requate [Mon, 7 Jul 2014 16:43:05 +0000 (18:43 +0200)]
s4-backupkey: fix ndr_pull error on empty input

[MS-BKRP] 3.1.4.1 specifies for BACKUPKEY_RETRIEVE_BACKUP_KEY_GUID that
the server must ignore the input data. This patch fixes
  ndr_pull_error(11): Pull bytes 4 (../librpc/ndr/ndr_basic.c:148)

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 3bc3bec6d702ef62bf026ff64855edc8fb900088)

9 years agos4-backupkey: Initialize ndr->switchlist for print
Arvid Requate [Mon, 7 Jul 2014 16:36:49 +0000 (18:36 +0200)]
s4-backupkey: Initialize ndr->switchlist for print

ndr_print_bkrp_data_in_blob requires the level to be set in the
proper ndr->switch_list context.

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 6af3cf60e31fdaa0873f45fd821165e265335c55)

9 years agos4-backupkey: Comply with [MS-BKRP] 2.2.1
Arvid Requate [Mon, 7 Jul 2014 16:25:29 +0000 (18:25 +0200)]
s4-backupkey: Comply with [MS-BKRP] 2.2.1

[MS-BKRP] 2.2.1 specifies "The Common Name field of the Subject name
field SHOULD contain the name of the DNS domain assigned to the server."

In fact Windows 7 clients don't seem to care. Also in certificates
generated by native AD the domain name (after CN=) is encoded as
UTF-16LE. Since hx509_parse_name only supports UTF-8 strings currently
we just leave the encoding as it is for now.

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 007c3978a46d5f50051605752a76d12f30c5a0de)