metze/test/samba.git
8 years agoVERSION: Disable git snapshots for the 4.2.3 release. v4-2-stable samba-4.2.3
Karolin Seeger [Sat, 11 Jul 2015 19:40:54 +0000 (21:40 +0200)]
VERSION: Disable git snapshots for the 4.2.3 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
8 years agoWHATSNEW: Add release notes for Samba 4.2.3.
Karolin Seeger [Sat, 11 Jul 2015 19:39:27 +0000 (21:39 +0200)]
WHATSNEW: Add release notes for Samba 4.2.3.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
8 years agoncacn_http: fix GNUism
Ralph Boehme [Thu, 9 Oct 2014 14:41:10 +0000 (16:41 +0200)]
ncacn_http: fix GNUism

%a format conversion is a GNU extension, use the more portable %m.
It's at least in SUSv4, supported by glibc since 2.7 and FreeBSD 10.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct  9 22:05:26 CEST 2014 on sn-devel-104

(cherry picked from commit 9ae65baf3cd6382678624864f13fc053d942d013)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Sun Jul  5 23:51:47 CEST 2015 on sn-devel-104

8 years agos4:torture:vfs_fruit: check offset and length when reading AFP_AfpInfo stream
Ralph Boehme [Thu, 25 Jun 2015 14:25:05 +0000 (16:25 +0200)]
s4:torture:vfs_fruit: check offset and length when reading AFP_AfpInfo stream

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Jul  3 01:47:29 CEST 2015 on sn-devel-104

(cherry picked from commit c6e044ea33d1f16809196833e9e96a10e65b092e)

8 years agovfs_fruit: check offset and length for AFP_AfpInfo read requests
Ralph Boehme [Thu, 25 Jun 2015 13:42:04 +0000 (15:42 +0200)]
vfs_fruit: check offset and length for AFP_AfpInfo read requests

fruit_pread doesn't check the offset and length parameters and instead
always writes 60 bytes, the size of the AFP_AfpInfo blob, to the the
passed buffer. If the passed in buffer is smaller, we overwrite
something somewhere.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 25f302a47c3119d454531dc992183552b9a42b13)

8 years agowinbindd: disconnect child process if request is cancelled at main process
Uri Simchoni [Wed, 24 Jun 2015 07:55:06 +0000 (10:55 +0300)]
winbindd: disconnect child process if request is cancelled at main process

When cancelling a request at the main winbindd process, that is currently
being served by a child winbindd process, just freeing all objects related
to the request is not enough, as the next bytes to come through the pipe
from the child process are the response to the cancelled request, and the
object reading those bytes will be the next request. This breaks the protocol.

This change, upon canceling a request that is being served, closes the
connection to the child process, causing the next request to be served
by a new child process (and the detached child to die eventually).

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

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jun 29 14:00:24 CEST 2015 on sn-devel-104

(cherry picked from commit eaf99203093cabc3069f1c69345d38d739b0663d)

8 years agos4:selftest: also run rpc.winreg with kerberos and all possible auth options
Stefan Metzmacher [Tue, 23 Jun 2015 08:27:27 +0000 (10:27 +0200)]
s4:selftest: also run rpc.winreg with kerberos and all possible auth options

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jun 23 17:31:08 CEST 2015 on sn-devel-104

(cherry picked from commit 6dd117b21ef06da68af67051f2822f71193d193a)

8 years agos4:selftest: run rpc.echo tests also with krb5 krb5,sign krb5,seal
Stefan Metzmacher [Thu, 18 Jun 2015 22:35:29 +0000 (00:35 +0200)]
s4:selftest: run rpc.echo tests also with krb5 krb5,sign krb5,seal

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 5b917fd6226952a1f792d1ad921d2ae54ab6ab42)

8 years agos4:rpc_server: fix padding caclucation in dcesrv_auth_response()
Stefan Metzmacher [Sat, 20 Jun 2015 15:49:02 +0000 (17:49 +0200)]
s4:rpc_server: fix padding caclucation in dcesrv_auth_response()

This is simplified by using DCERPC_AUTH_PAD_LENGTH() and changes the behaviour
so that we will use no padding if the stub_length is already aligned
to DCERPC_AUTH_PAD_ALIGNMENT (16 bytes).

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 69c1b4b7c10dd5fd9cacaa3a76c47bc854ee3fed)

8 years agos4:rpc_server: let dcesrv_auth_response() handle sig_size == 0 with auth_info as...
Stefan Metzmacher [Sat, 20 Jun 2015 15:47:14 +0000 (17:47 +0200)]
s4:rpc_server: let dcesrv_auth_response() handle sig_size == 0 with auth_info as error

Don't send plaintext on the wire because of an internal error...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 1bf7ab49b4459e81ab2b82d9668b3d7cb76372f4)

8 years agos4:rpc_server: let dcesrv_reply() use a sig_size for a padded payload
Stefan Metzmacher [Fri, 19 Jun 2015 20:35:44 +0000 (22:35 +0200)]
s4:rpc_server: let dcesrv_reply() use a sig_size for a padded payload

The sig_size could differ depending on the aligment/padding.
So should use the same alignment as we use for the payload.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 16f3837e026e4cae135bbdddf09b44a02af25b05)

8 years agos4:rpc_server: let dcesrv_reply() use DCERPC_AUTH_PAD_ALIGNMENT define
Stefan Metzmacher [Fri, 19 Jun 2015 20:35:44 +0000 (22:35 +0200)]
s4:rpc_server: let dcesrv_reply() use DCERPC_AUTH_PAD_ALIGNMENT define

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 3fbdb255e3ac7ad5261c5fa3836e4a38a0d59221)

8 years agos4:librpc/rpc: fix padding caclucation in ncacn_push_request_sign()
Stefan Metzmacher [Sat, 20 Jun 2015 15:49:02 +0000 (17:49 +0200)]
s4:librpc/rpc: fix padding caclucation in ncacn_push_request_sign()

This is simplified by using DCERPC_AUTH_PAD_LENGTH() and changes the behaviour
so that we will use no padding if the stub_length is already aligned
to DCERPC_AUTH_PAD_ALIGNMENT (16 bytes).

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 114c52e73ed9e0adeac8ad1bc1dc014f3c10f4d6)

8 years agos4:librpc/rpc: let ncacn_push_request_sign() handle sig_size == 0 with auth_info...
Stefan Metzmacher [Sat, 20 Jun 2015 15:47:14 +0000 (17:47 +0200)]
s4:librpc/rpc: let ncacn_push_request_sign() handle sig_size == 0 with auth_info as internal error

Don't send plaintext on the wire because of an internal error...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 48f2c383e1d7f52114223cd2a54857426bf64025)

8 years agos4:librpc/rpc: let dcerpc_ship_next_request() use a sig_size for a padded payload
Stefan Metzmacher [Fri, 19 Jun 2015 20:35:44 +0000 (22:35 +0200)]
s4:librpc/rpc: let dcerpc_ship_next_request() use a sig_size for a padded payload

The sig_size could differ depending on the aligment/padding.
So should use the same alignment as we use for the payload.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit fc249d542fcb8d043ae72eb7963d3a85eb79253a)

8 years agos4:librpc/rpc: let dcerpc_ship_next_request() use DCERPC_AUTH_PAD_ALIGNMENT define
Stefan Metzmacher [Fri, 19 Jun 2015 20:35:44 +0000 (22:35 +0200)]
s4:librpc/rpc: let dcerpc_ship_next_request() use DCERPC_AUTH_PAD_ALIGNMENT define

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit ef801bae95403e96042f5d8c87085bce21436013)

8 years agos3:rpc_server: remove pad handling from api_pipe_alter_context()
Stefan Metzmacher [Fri, 19 Jun 2015 20:09:57 +0000 (22:09 +0200)]
s3:rpc_server: remove pad handling from api_pipe_alter_context()

This is not needed and windows doesn't use it.
The padding is for the payload in request and response.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit a6a6795826954eef6763a39b129a4db578edca01)

8 years agos3:librpc/rpc: fix padding calculation in dcerpc_guess_sizes()
Stefan Metzmacher [Fri, 19 Jun 2015 13:52:11 +0000 (15:52 +0200)]
s3:librpc/rpc: fix padding calculation in dcerpc_guess_sizes()

The padding needs to be relative to the payload start not to the pdu start.
We also need align the padding to DCERPC_AUTH_PAD_ALIGNMENT (16 bytes).

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit b2e042ad9652e2dfb39640de43e09030efc41d3d)

8 years agos3:librpc/rpc: allow up to DCERPC_AUTH_PAD_ALIGNMENT padding bytes in dcerpc_add_auth...
Stefan Metzmacher [Fri, 19 Jun 2015 14:55:39 +0000 (16:55 +0200)]
s3:librpc/rpc: allow up to DCERPC_AUTH_PAD_ALIGNMENT padding bytes in dcerpc_add_auth_footer()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 3e6e9e3acd17531148457be59a32727fb87ae43d)

8 years agolibrpc/rpc: add DCERPC_AUTH_PAD_LENGTH(stub_length) helper macro
Stefan Metzmacher [Sat, 20 Jun 2015 15:43:47 +0000 (17:43 +0200)]
librpc/rpc: add DCERPC_AUTH_PAD_LENGTH(stub_length) helper macro

This calculates the required padding DCERPC_AUTH_PAD_ALIGNMENT
and the stub_length.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit f1e3ad269ca8f76876afd8e3837c9c9b48688941)

8 years agodcerpc.idl: add DCERPC_AUTH_PAD_ALIGNMENT (=16)
Stefan Metzmacher [Fri, 19 Jun 2015 14:48:48 +0000 (16:48 +0200)]
dcerpc.idl: add DCERPC_AUTH_PAD_ALIGNMENT (=16)

Windows pads the payload aligned to 16 bytes.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 2cb3ec5856ab5b7edad8ffd67a5d0f927c161138)

8 years agoauth/gensec: make sure gensec_start_mech_by_authtype() resets SIGN/SEAL before starting
Stefan Metzmacher [Sat, 20 Jun 2015 14:19:31 +0000 (16:19 +0200)]
auth/gensec: make sure gensec_start_mech_by_authtype() resets SIGN/SEAL before starting

We want to set GENSEC_FEATURE_SIGN and GENSEC_FEATURE_SEAL based on the given
auth_level and should not have GENSEC_FEATURE_SEAL if
DCERPC_AUTH_LEVEL_INTEGRITY is desired.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 756508c8c37b0370301a096e35abc171fe08d31c)

8 years agoauth/gensec: gensec_[un]seal_packet() should only work with GENSEC_FEATURE_DCE_STYLE
Stefan Metzmacher [Fri, 19 Jun 2015 12:46:53 +0000 (14:46 +0200)]
auth/gensec: gensec_[un]seal_packet() should only work with GENSEC_FEATURE_DCE_STYLE

gensec_sig_size() also requires GENSEC_FEATURE_DCE_STYLE if
GENSEC_FEATURE_SEAL is negotiated.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 3542d33314e32279340f07f995c1dcbd16106352)

8 years agos3:auth_domain: fix talloc problem in connect_to_domain_password_server()
Stefan Metzmacher [Mon, 9 Feb 2015 08:33:01 +0000 (09:33 +0100)]
s3:auth_domain: fix talloc problem in connect_to_domain_password_server()

s3:auth_domain: fix talloc problem in connect_to_domain_password_server()

return values of connect_to_domain_password_server() need to be exported
to the callers memory context.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11367
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
8 years agos3:smb2_setinfo: fix memory leak in the defer_rename case
Stefan Metzmacher [Mon, 15 Jun 2015 06:34:12 +0000 (08:34 +0200)]
s3:smb2_setinfo: fix memory leak in the defer_rename case

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

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

8 years agowinbindd: winbindd_raw_kerberos_login - ensure logon_info exists in PAC.
Jeremy Allison [Wed, 10 Jun 2015 23:31:21 +0000 (16:31 -0700)]
winbindd: winbindd_raw_kerberos_login - ensure logon_info exists in PAC.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jun 11 07:30:38 CEST 2015 on sn-devel-104

(cherry picked from commit 4c5fefe0723ae4cd3cacaabc5ae4c500d2306968)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11328
we should use resource group sids obtained from pac logon_info

8 years agokerberos auth info3 should contain resource group ids available from pac_logon
Noel Power [Wed, 10 Jun 2015 12:13:25 +0000 (13:13 +0100)]
kerberos auth info3 should contain resource group ids available from pac_logon

successful pam auth (e.g. from ssh) will cache group sids (but not any
resource group sids)) The subsequent cached entry used for groups lookups
can be missing those resource groups

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit efadcb31215f9ccaf7942341c698a8eb2ac166ce)

8 years agodocs: overhaul the description of "smb encrypt" to include SMB3 encryption.
Michael Adam [Thu, 23 Apr 2015 08:38:15 +0000 (10:38 +0200)]
docs: overhaul the description of "smb encrypt" to include SMB3 encryption.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr 24 00:53:20 CEST 2015 on sn-devel-104

(cherry picked from commit 51ae17b0703eaa481d602ffc7d8231a629fcb5fd)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Tue Jun 30 06:40:27 CEST 2015 on sn-devel-104

8 years agopidl: Make the compilation of PIDL producing the same results if the content hasn...
Matthieu Patou [Tue, 23 Sep 2014 04:52:14 +0000 (21:52 -0700)]
pidl: Make the compilation of PIDL producing the same results if the content hasn't change

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

Newer perl versions don't generate stable results anymore.

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

Change-Id: I2fb1e12da392ca85bfd0fb8b50b69851076144ee
Signed-off-by: Matthieu Patou <mat@matws.net>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 4986359816704f38d4fad3ddd0d07a0f0a25b335)

8 years agos3: smbd: Codenomicon crash in do_smb_load_module().
Jeremy Allison [Thu, 18 Jun 2015 17:21:07 +0000 (10:21 -0700)]
s3: smbd: Codenomicon crash in do_smb_load_module().

Inside api_pipe_bind_req() we look for a pipe module name using

dcerpc_default_transport_endpoint(pkt,
                                NCACN_NP, table)

which returns NULL when given invalid pkt data from the Codenomicon fuzzer.

This gets passed directly to smb_probe_module(), which then calls
do_smb_load_module() which tries to deref the (NULL) module name.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 18 22:14:01 CEST 2015 on sn-devel-104

(cherry picked from commit 5a82cc21379e3fe28441cd82647313c9390b41e7)

8 years agoselftest: Change chgdcpass environment to use winbindd
Andrew Bartlett [Wed, 17 Jun 2015 00:05:58 +0000 (12:05 +1200)]
selftest: Change chgdcpass environment to use winbindd

This allows us to test that winbindd starts up without secrets.tdb, as happens after
a classicupgrade.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10991
(backport of master commit db59f9ec731e3abbeba3070925a6dedaac26e6e5)

8 years agowinbindd: Sync secrets.ldb into secrets.tdb on startup
Andrew Bartlett [Thu, 11 Jun 2015 23:57:07 +0000 (11:57 +1200)]
winbindd: Sync secrets.ldb into secrets.tdb on startup

This ensures that the domain SID and machine account password are written into
secrets.tdb if the secrets.tdb file was either never written or was deleted.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10991
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
(backport of master commit 5de7621cbfba1e1fb52cddf41a5a13d027d45b46)

8 years agowinbindd: Use pdb_get_domain_info() to get exactly the local domain info when we...
Andrew Bartlett [Thu, 11 Jun 2015 23:54:21 +0000 (11:54 +1200)]
winbindd: Use pdb_get_domain_info() to get exactly the local domain info when we are an AD DC

This also triggers pdb_samba_dsdb_init_secrets(), to force the
correct SID into secrets.tdb.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10991
(backport of master commit b209cd1677b306d72e56a98ecb02db421a5ca35a)

8 years agoselftest: Run winbind tests in chgdcpass environment
Andrew Bartlett [Tue, 16 Jun 2015 23:10:15 +0000 (11:10 +1200)]
selftest: Run winbind tests in chgdcpass environment

This ensures that winbind both starts and operates without a secrets.tdb

(chgdcpass deliberatly removes the secrets.tdb file after provision, like has happend with classicupgrade).

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
(backport of master commit 5bb647b78806413a94f959d0b2b417a97b7a2173)

8 years agos3: smbd: Use separate flag to track become_root()/unbecome_root() state.
Jeremy Allison [Wed, 17 Jun 2015 17:23:30 +0000 (10:23 -0700)]
s3: smbd: Use separate flag to track become_root()/unbecome_root() state.

Early function exit can mean backup_priv is set but we haven't called
become_root(). *Lots* of work by the reviewers went in to checking this
isn't a security issue.

Found by Codenomicon at the Redmond plugfest.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 25 22:14:58 CEST 2015 on sn-devel-104

(cherry picked from commit e2c4b8967d33b610f9f076c614352e4b8fc7c558)

8 years agodocs-xml: Update sharesec manpage to reflect current output
Christof Schmitt [Tue, 9 Jun 2015 17:29:21 +0000 (10:29 -0700)]
docs-xml: Update sharesec manpage to reflect current output

Update the sharesec man page to reflect the output currently used, and
also add a note that the OWNER and GROUP fields are not used for share
ACLs.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jun 17 13:36:23 CEST 2015 on sn-devel-104
(cherry picked from commit 8406d4dd1593b4a4d7bcbdc7b7c7893339f8e814)

8 years agoselftest: Add test for sharesec command
Christof Schmitt [Tue, 9 Jun 2015 17:28:17 +0000 (10:28 -0700)]
selftest: Add test for sharesec command

Add a test for the sharesec command to ensure that it works, and to also
verify that the output does not change.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit a6650d74d1b7cc051637c1a19daff5a8009f405b)

8 years agosharesec: Use non-numerical output for sharesec
Christof Schmitt [Tue, 9 Jun 2015 16:50:18 +0000 (09:50 -0700)]
sharesec: Use non-numerical output for sharesec

This is an easy change to get the sharesec output back to the format
used before. It is also easier to understand than the output of the
flags.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 0b9fa2849dc8b7c61467a6517c40e6e15c104d4a)

8 years agoctdb-ib: make sure the tevent_fd is removed before the fd is closed
Stefan Metzmacher [Fri, 5 Jun 2015 08:30:39 +0000 (10:30 +0200)]
ctdb-ib: make sure the tevent_fd is removed before the fd is closed

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 53ff3e4f31f3debd98f9293171c023a0a406858d)

8 years agolibcli/smb: make sure we remove the writev_send() request when a request is destroyed
Stefan Metzmacher [Fri, 29 May 2015 14:14:40 +0000 (16:14 +0200)]
libcli/smb: make sure we remove the writev_send() request when a request is destroyed

This way smbXcli_conn_disconnect() removes all tevent_fd structures attached to
the sock_fd before closing it.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 006042ac126261e87089fb9835c28789e8aeae1b)

8 years agolibcli/smb: add smb1 requests to the pending array before writev_send()
Stefan Metzmacher [Fri, 29 May 2015 13:48:26 +0000 (15:48 +0200)]
libcli/smb: add smb1 requests to the pending array before writev_send()

This way we have a change to destroy the pending writev_send request before
closing the socket in smbXcli_conn_disconnect().

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit f3982eb2c7f1d17a013dacfd430a3752e6ef4ae4)

8 years agolibcli/smb: make sure the writev_send of smbXcli_conn_samba_suicide() is removed...
Stefan Metzmacher [Fri, 29 May 2015 13:29:31 +0000 (15:29 +0200)]
libcli/smb: make sure the writev_send of smbXcli_conn_samba_suicide() is removed before closing the socket

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 59338434274799db1ac60b082a6453bd924c5f4c)

8 years agolibcli/smb: remove unused split of read_fd and write_fd
Stefan Metzmacher [Thu, 28 May 2015 11:22:19 +0000 (13:22 +0200)]
libcli/smb: remove unused split of read_fd and write_fd

The tevent epoll backend supports separate read and write tevent_fd structure
on a single fd, so there's no need for a dup() anymore.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 8f42df235dc825a103631fdf0e37e1c1d03cf420)

8 years agolibcli/smb: close the socket fd at the end of smbXcli_conn_disconnect()
Stefan Metzmacher [Thu, 28 May 2015 11:09:11 +0000 (13:09 +0200)]
libcli/smb: close the socket fd at the end of smbXcli_conn_disconnect()

We need to cancel all pending requests before closing the socket fds,
otherwise we cause problem with the interaction with the epoll event backend.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 46e1aa22b12eacc3567f7897716ae07837545c23)

8 years agolibcli/smb: use tevent_req_received(req) in read_smb_recv()
Stefan Metzmacher [Thu, 21 May 2015 20:29:55 +0000 (22:29 +0200)]
libcli/smb: use tevent_req_received(req) in read_smb_recv()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 26c4b3fc9db507557b2539dd7d1f9e593c3fa35a)

8 years agolib/async_req: remove the tevent_fd as early as possible via a wait_for_read_cleanup...
Stefan Metzmacher [Thu, 21 May 2015 20:28:14 +0000 (22:28 +0200)]
lib/async_req: remove the tevent_fd as early as possible via a wait_for_read_cleanup() hook

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 64640cc99c7b8543ee8d35ca243c57c048cdb490)

8 years agolib/async_req: remove the tevent_fd as early as possible via a read_packet_cleanup...
Stefan Metzmacher [Thu, 21 May 2015 20:28:14 +0000 (22:28 +0200)]
lib/async_req: remove the tevent_fd as early as possible via a read_packet_cleanup() hook

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit a2a7cbc66c4713493e6ade45d0cdde25f64c9007)

8 years agolib/async_req: use tevent_req_nomem/tevent_req_post in read_packet_send()
Stefan Metzmacher [Thu, 21 May 2015 20:28:14 +0000 (22:28 +0200)]
lib/async_req: use tevent_req_nomem/tevent_req_post in read_packet_send()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 9a116b28bab20507760f50f25214635a60ea6c43)

8 years agolib/async_req: s/result/req/ in read_packet_send()
Stefan Metzmacher [Thu, 21 May 2015 20:28:14 +0000 (22:28 +0200)]
lib/async_req: s/result/req/ in read_packet_send()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 4f05f68abc1d756bb114260e80d3532f3f959fec)

8 years agolib/async_req: remove the tevent_fd as early as possible via a writev_cleanup() hook
Stefan Metzmacher [Thu, 21 May 2015 20:28:14 +0000 (22:28 +0200)]
lib/async_req: remove the tevent_fd as early as possible via a writev_cleanup() hook

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 0c1109695639a177d3d739b343e7588a6ecf0949)

8 years agolib/async_req: simplify async_connect_* using a _cleanup() hook
Stefan Metzmacher [Thu, 21 May 2015 20:28:14 +0000 (22:28 +0200)]
lib/async_req: simplify async_connect_* using a _cleanup() hook

This makes sure we remove the tevent_fd as soon as possible
and always reset the old_sockflags.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit d5a4b30f894f0d4d4fa728ebd2c435254bf3b142)

8 years agolib/async_req: s/result/req/ in async_connect_send()
Stefan Metzmacher [Fri, 5 Jun 2015 11:58:19 +0000 (13:58 +0200)]
lib/async_req: s/result/req/ in async_connect_send()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit be8c2ff10353df00f05cd378c251a33a9e08563a)

8 years agolib/async_req: remove unused sendto_{send,recv} and recvfrom_{send,recv}
Stefan Metzmacher [Thu, 21 May 2015 10:25:38 +0000 (12:25 +0200)]
lib/async_req: remove unused sendto_{send,recv} and recvfrom_{send,recv}

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit ccd038e1523a69197a9aaeca00305b0958f09ff0)

8 years agos3:libsmb: convert nb_trans_send/recv internals to tdgram
Stefan Metzmacher [Thu, 21 May 2015 02:43:27 +0000 (04:43 +0200)]
s3:libsmb: convert nb_trans_send/recv internals to tdgram

This simplifies/fixes the cleanup, because we need to remove any
tevent_fd object before closing the socket fd.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit a3282911f6ceb76b2ada567e569a55af8c7ef160)

8 years agos3:libsmb: convert nb_packet_reader to tstream_* functions
Stefan Metzmacher [Thu, 21 May 2015 00:18:26 +0000 (02:18 +0200)]
s3:libsmb: convert nb_packet_reader to tstream_* functions

By using the tstream abstraction we don't need to take care
error handling regarding dangling tevent_fd structures.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit ecb4d041de89441941a112ab3a724887e568117e)

8 years agos3:libsmb: convert nb_packet_client to tstream_* functions
Stefan Metzmacher [Wed, 20 May 2015 23:53:44 +0000 (01:53 +0200)]
s3:libsmb: convert nb_packet_client to tstream_* functions

By using the tstream abstraction we don't need to take care
error handling regarding dangling tevent_fd structures.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 3ecf4ec6574de9bdd5a2d55529ed81b17c74d452)

8 years agos3:libsmb: let nb_packet_server_destructor() explicitly destroy the tevent_fd
Stefan Metzmacher [Thu, 21 May 2015 00:20:00 +0000 (02:20 +0200)]
s3:libsmb: let nb_packet_server_destructor() explicitly destroy the tevent_fd

The need to destroy the tevent_fd before closing the socket fd.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 9ccf8e6d36618498c4952bb1d4b74152f75ab793)

8 years agos3:libsmb: remove pending requests as early as possible via a smbsock_any_connect_cle...
Stefan Metzmacher [Thu, 21 May 2015 01:01:30 +0000 (03:01 +0200)]
s3:libsmb: remove pending requests as early as possible via a smbsock_any_connect_cleanup() hook

Once we got an error or a valid connection we should destroy all other
connection attempts as early as possible.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 058d84747e75a5f97a02e31bac9c8d0d147174bc)

8 years agos3:libsmb: remove subreqs as early as possible via a smbsock_connect_cleanup() hook
Stefan Metzmacher [Thu, 21 May 2015 01:01:05 +0000 (03:01 +0200)]
s3:libsmb: remove subreqs as early as possible via a smbsock_connect_cleanup() hook

open_socket_out_send() or nb_connect_send() likely use socket fds and
tevent_fd objects. We should clean them up as early as possible.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 04f89d4255ed95631aa8f0ada4bcf5f888e126d4)

8 years agos3:libsmb: remove the cli_session_request as early as possible via a nb_connect_clean...
Stefan Metzmacher [Thu, 21 May 2015 01:00:17 +0000 (03:00 +0200)]
s3:libsmb: remove the cli_session_request as early as possible via a nb_connect_cleanup() hook

cli_session_request_send() is likely to use tevent_fd objects on the given
socket fd, so we need to destroy the request before closing the socket fd.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 992be06f165c3d05e85d16baf514dba49f55d1ec)

8 years agos3:lib/addrchange: make use of tdgram_* in addrchange_*()
Stefan Metzmacher [Thu, 21 May 2015 10:17:24 +0000 (12:17 +0200)]
s3:lib/addrchange: make use of tdgram_* in addrchange_*()

This makes the cleanup handling easier to get right,
as we need to make sure any tevent_fd is removed before
closing a socket fd.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 0d161e42d9aeb155eae2b04eccec497b21de8029)

8 years agos3:lib/addrchange: look at the correct nl_pid in addrchange_done()
Stefan Metzmacher [Fri, 5 Jun 2015 12:19:00 +0000 (14:19 +0200)]
s3:lib/addrchange: look at the correct nl_pid in addrchange_done()

state->fromaddr is the address we got from recvfrom_send/recv.

state->addr is completely untouched after tevent_req_create().

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 257bc586c22f9a7f34b913823d5c89592d433454)

8 years agos3:lib/background: make sure we destroy a pending read_packet_send() before closing...
Stefan Metzmacher [Thu, 28 May 2015 11:31:17 +0000 (13:31 +0200)]
s3:lib/background: make sure we destroy a pending read_packet_send() before closing the pipe fd

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 9d3444ad887bb3a118eaecd141c79dfd6de53f41)

8 years agos3:wscript: move lib/util_tsock.c from 'TLDAP' to 'samba3util'
Stefan Metzmacher [Thu, 21 May 2015 01:45:36 +0000 (03:45 +0200)]
s3:wscript: move lib/util_tsock.c from 'TLDAP' to 'samba3util'

tstream_read_packet_send/recv() is a generic helper function...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(similar to commit 0c108f55d9c3cca0bde1c15c66dccabbc40e6133)

8 years agos4:libcli/raw: make sure smbcli_transport_connect_send/recv correctly cleanup on...
Stefan Metzmacher [Thu, 28 May 2015 12:25:27 +0000 (14:25 +0200)]
s4:libcli/raw: make sure smbcli_transport_connect_send/recv correctly cleanup on error

We need to make sure that we remove any pending writev_send or read_smb_send
request before closing the socket fd. As a side effect we always close the
socket fd if we don't return success for any any reason.

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

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

8 years agolib/tsocket: add tdgram_inet_udp_broadcast_socket()
Stefan Metzmacher [Thu, 21 May 2015 09:39:38 +0000 (11:39 +0200)]
lib/tsocket: add tdgram_inet_udp_broadcast_socket()

This is similar to tdgram_inet_udp_socket(), but it allows
the use of ipv4 broadcast traffic.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 36b97d0bb9fe004f3d8a500f3af83dff34f86d7b)

8 years agolib/tsocket: add tdgram_bsd_existing_socket() helper function
Stefan Metzmacher [Thu, 21 May 2015 09:37:06 +0000 (11:37 +0200)]
lib/tsocket: add tdgram_bsd_existing_socket() helper function

This is similar to tstream_bsd_existing_socket().
Both help to migrate strange code path to using the tstream or tdgram
abstractions.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 3a8b7b0518b33b016d2dbb8dd23d35ef1c6aaa5c)

8 years agolib: Add tevent_req_simple_recv_unix
Volker Lendecke [Sat, 8 Nov 2014 09:00:31 +0000 (09:00 +0000)]
lib: Add tevent_req_simple_recv_unix

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit f5c17d41e085e083ef970692ff7f50f7a6642ea3)

8 years agoGroup creation: Add msSFU30Name only when --nis-domain was given
Marc Muehlfeld [Thu, 11 Jun 2015 19:20:55 +0000 (21:20 +0200)]
Group creation: Add msSFU30Name only when --nis-domain was given

This fixes a bug, that all new created groups automatically get an
msSFU30Name attribute added. This should only be the case, when
we also have a nis-domain (samba-tool --nis-domain=...).

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

Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Tue Jun 16 11:58:02 CEST 2015 on sn-devel-104

(cherry picked from commit 9df07e6f1bcea55fcdab777c3f45a1a6ca88f69e)

8 years agos3:param/loadparm fix testparm --show-all-parameters
Christian Ambach [Mon, 8 Jun 2015 21:48:54 +0000 (23:48 +0200)]
s3:param/loadparm fix testparm --show-all-parameters

it didn't know about the new types of config parameters

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

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): Tue Jun  9 11:49:18 CEST 2015 on sn-devel-104

8 years agotdb: version 1.3.6
Stefan Metzmacher [Fri, 12 Jun 2015 07:10:39 +0000 (09:10 +0200)]
tdb: version 1.3.6

* Fix runtime detection for robust mutexes in the standalone build.
  bug #11326
* Possible fix for the build with robust mutexes on solaris 11
  bug #11319

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 12 19:55:34 CEST 2015 on sn-devel-104

(cherry picked from commit 4ddf78a282c85e84b6201a79b707fad9487f3ccd)

The last 13 patches address

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11331
Backport tdb-1.3.6.

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Sat Jun 20 23:13:17 CEST 2015 on sn-devel-104

8 years agolib/replace: remove unused HAVE_DECL_PTHREAD_{MUTEXATTR_SETROBUST,MUTEX_CONSISTENT...
Stefan Metzmacher [Fri, 12 Jun 2015 09:01:21 +0000 (11:01 +0200)]
lib/replace: remove unused HAVE_DECL_PTHREAD_{MUTEXATTR_SETROBUST,MUTEX_CONSISTENT}_NP checks

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 89dcfbf3f45f448e515a1da82e09002a0aafb7b4)

8 years agolib/replace: fix PTHREAD_MUTEX_ROBUST fallback to PTHREAD_MUTEX_ROBUST_NP on solaris 11
Stefan Metzmacher [Fri, 12 Jun 2015 09:01:21 +0000 (11:01 +0200)]
lib/replace: fix PTHREAD_MUTEX_ROBUST fallback to PTHREAD_MUTEX_ROBUST_NP on solaris 11

Without this we got the following defines in config.h:

   #define HAVE_DECL_PTHREAD_MUTEXATTR_SETROBUST_NP 1
   #define HAVE_DECL_PTHREAD_MUTEX_CONSISTENT_NP 1
   #define HAVE_PTHREAD_MUTEXATTR_SETROBUST 1
   #define HAVE_PTHREAD_MUTEX_CONSISTENT 1
   #define HAVE_ROBUST_MUTEXES 1
   #define USE_TDB_MUTEX_LOCKING 1

And the build failed with PTHREAD_MUTEX_ROBUST being unknown.

Note that PTHREAD_MUTEX_ROBUST and PTHREAD_MUTEX_ROBUST_NP are enum values
while they're defines on solaris 11
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11319

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 34cf1d213ec0261af41ef6a16f5b37e5015c614b)

8 years agowafsamba: let CHECK_DECLS() find enum values
Stefan Metzmacher [Fri, 12 Jun 2015 10:13:23 +0000 (12:13 +0200)]
wafsamba: let CHECK_DECLS() find enum values

In the current state this still generates the same config.h
at least on ubuntu 14.04 amd64.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit ff072a633660780cf72d204f4620c664957a6072)

8 years agos3:wscript: remove signal related configure checks
Stefan Metzmacher [Wed, 10 Jun 2015 12:33:35 +0000 (14:33 +0200)]
s3:wscript: remove signal related configure checks

These are done in lib/replace now.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Jun 10 17:50:41 CEST 2015 on sn-devel-104

(cherry picked from commit a5fd4ca0dbe4f7cbf0d3ead4214af283aabe4790)

8 years agolib/util: remove signal related configure checks
Stefan Metzmacher [Wed, 10 Jun 2015 12:33:35 +0000 (14:33 +0200)]
lib/util: remove signal related configure checks

These are done in lib/replace now.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 322f4b76e5cae9f2513ef68d7d86ad19d4a88244)

8 years agolib/replace: add signal related configure checks
Stefan Metzmacher [Wed, 10 Jun 2015 12:33:35 +0000 (14:33 +0200)]
lib/replace: add signal related configure checks

These should be in a central place available for
all lib/replace users instead of having each caller
do its own checks.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit a82acb076e78eb513fb1228595b220f61377e23c)

8 years agotdb: version 1.3.5
Alexander Drozdov [Tue, 28 Apr 2015 07:31:43 +0000 (10:31 +0300)]
tdb: version 1.3.5

ABI change: tdb_chainlock_read_nonblock() has been added.

Signed-off-by: Alexander Drozdov <al.drozdov@gmail.com>
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): Wed Apr 29 00:05:29 CEST 2015 on sn-devel-104

(cherry picked from commit 3f35c1d52ee77f7cabd52dd503565cec360f1de2)

8 years agotdb: introduce tdb_chainlock_read_nonblock(), a nonblock variant of tdb_chainlock_read()
Alexander Drozdov [Tue, 28 Apr 2015 04:42:43 +0000 (07:42 +0300)]
tdb: introduce tdb_chainlock_read_nonblock(), a nonblock variant of tdb_chainlock_read()

Signed-off-by: Alexander Drozdov <al.drozdov@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit e4fe0aff5252b37536eec4a130d4e40a05a56ddb)

8 years agoAdd set date to tdb manpages.
Jelmer Vernooij [Sun, 26 Apr 2015 10:13:05 +0000 (10:13 +0000)]
Add set date to tdb manpages.

This makes builds reproducible.

Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reveiewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 38553a305fe4021e2bd034bed11eaef18863aa0a)

8 years agotdb: Do not build test binaries if it's not a standalone build
Amitay Isaacs [Fri, 15 Aug 2014 01:36:40 +0000 (11:36 +1000)]
tdb: Do not build test binaries if it's not a standalone build

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 31 01:56:02 CEST 2015 on sn-devel-104

(cherry picked from commit 48e90ba062ecde71d03c3cf4bc9a809f805fabe4)

8 years agotdb: Fix CID 1034842 Resource leak
Volker Lendecke [Sun, 8 Mar 2015 19:21:23 +0000 (19:21 +0000)]
tdb: Fix CID 1034842 Resource leak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Mar 11 00:23:20 CET 2015 on sn-devel-104

(cherry picked from commit 006328b81b2dd3416c20b0f19b438c614c1932cc)

8 years agotdb: Fix CID 1034841 Resource leak
Volker Lendecke [Sun, 8 Mar 2015 19:18:21 +0000 (19:18 +0000)]
tdb: Fix CID 1034841 Resource leak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
(cherry picked from commit 1b8c07ac7d51eb2a1957d79ea05b170106a9c0e8)

8 years agosmbd/trans2: add a useful diagnostic for files with bad encoding
Ralph Boehme [Wed, 3 Jun 2015 15:07:46 +0000 (17:07 +0200)]
smbd/trans2: add a useful diagnostic for files with bad encoding

Catch conversion error and log the path of the offending file.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jun  9 21:00:02 CEST 2015 on sn-devel-104

(cherry picked from commit 0615b72a6b62d590831f1c24c5678dd29b9a2338)

8 years agolib/util/charset: fix conversion failure logging
Ralph Boehme [Wed, 3 Jun 2015 14:58:22 +0000 (16:58 +0200)]
lib/util/charset: fix conversion failure logging

Move catch-all debug statement with loglevel 0 from behind the switch
clause into the switch clause as default case. Fixes an issue that
resulted in the log being flooded with level 0 messages in case someone
put a file with an illegal UTF8 encoding (eg '\xA0test') on the server.

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

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

8 years agovfs_fruit: add option veto_appledouble
Ralph Boehme [Sat, 9 May 2015 06:31:24 +0000 (08:31 +0200)]
vfs_fruit: add option veto_appledouble

vfs_fruit adds a wildcard path "._*" to the vetolist in order to prevent
client access to ._ AppleDouble files created internally by vfs_fruit
for storing the Mac resource fork stream.

Unfortunately there are legitimite use cases where an OS X client may
want to use such filenames, extracting ZIP archives (where the archive
contains ._ files) being one of them.

A possible simple solution to this problem would be to not veto ._ files
in the first place, even though that exposes internally created ._ files
which the client shouldn't be able to access.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Jun  9 14:48:14 CEST 2015 on sn-devel-104

(cherry picked from commit b26a1449a0e6d01d5ddca89547df739732c8a230)

8 years agoctdb-locking: move all auto_mark logic into process_callbacks()
Stefan Metzmacher [Tue, 2 Jun 2015 10:43:17 +0000 (12:43 +0200)]
ctdb-locking: move all auto_mark logic into process_callbacks()

The caller should not dereference lock_ctx after invoking
process_callbacks(), it might be destroyed already.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Jun 12 15:28:57 CEST 2015 on sn-devel-104

(cherry picked from commit b3a18d66c00dba73a3f56a6f95781b4d34db1fe2)

8 years agoctdb-locking: make process_callbacks() more robust
Stefan Metzmacher [Tue, 2 Jun 2015 10:39:17 +0000 (12:39 +0200)]
ctdb-locking: make process_callbacks() more robust

We should not dereference lock_ctx after invoking the callback
in the auto_mark == false case. The callback could have destroyed it.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit a2690bc3f4e28a2ed50ccb47cb404fc8570fde6d)

8 years agoctdb-locking: Add a comment to explain auto_mark usage
Amitay Isaacs [Tue, 2 Jun 2015 03:15:37 +0000 (13:15 +1000)]
ctdb-locking: Add a comment to explain auto_mark usage

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 89849c4d31c0bb0c47864e11abc89efe7d812d87)

8 years agoctdb-locking: Avoid resetting talloc destructor
Amitay Isaacs [Tue, 2 Jun 2015 01:25:44 +0000 (11:25 +1000)]
ctdb-locking: Avoid resetting talloc destructor

Let ctdb_lock_request_destructor() take care of the proper cleanup.
If the request if freed from the callback function, then the lock context
should not be freed.  Setting request->lctx to NULL takes care of that
in the destructor.

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit bc747030d435447e62262541cf2e74be4c4229d8)

8 years agoctdb-locking: Avoid memory leak in the failure case
Amitay Isaacs [Tue, 2 Jun 2015 01:15:11 +0000 (11:15 +1000)]
ctdb-locking: Avoid memory leak in the failure case

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 2b352ff20597b9e34b3777d35deca1bf56209f8a)

8 years agoctdb-locking: Set destructor when lock_context is created
Amitay Isaacs [Mon, 1 Jun 2015 14:22:07 +0000 (00:22 +1000)]
ctdb-locking: Set destructor when lock_context is created

There is already code in the destructor to correctly remove it from the
pending or the active queue.  This also ensures that when lock context
is in pending queue and if the lock request gets freed, the lock context
is correctly removed from the pending queue.

Thanks to Stefan Metzmacher for noticing this and suggesting the fix.

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 5ae6a8f2fff5b5f4d46f496fd83f555be4b3d448)

8 years agoctdb-locking: Set the lock_ctx->request to NULL when request is freed
Stefan Metzmacher [Mon, 1 Jun 2015 14:15:11 +0000 (00:15 +1000)]
ctdb-locking: Set the lock_ctx->request to NULL when request is freed

The code was added to ctdb_lock_context_destructor() to ensure that
the if a lock_ctx gets freed first, the lock_request does not have a
dangling pointer.  However, the reverse is also true.  When a lock_request
is freed, then lock_ctx should not have a dangling pointer.

In commit 374cbc7b0ff68e04ee4e395935509c7df817b3c0, the code for second
condition was dropped causing a regression.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 752ec31bcbbfe9f5b3b1c5dde4179d69f41cb53c)

8 years agoctdb-locking: Avoid memory corruption in ctdb_lock_context_destructor
Stefan Metzmacher [Tue, 26 May 2015 14:45:34 +0000 (16:45 +0200)]
ctdb-locking: Avoid memory corruption in ctdb_lock_context_destructor

If the lock request is freed from within the callback, then setting
lock_ctx->request to NULL in ctdb_lock_context_destructor will end up
corrupting memory.  In this case, lock_ctx->request could be reallocated
and pointing to something else.  This may cause unexpected abort trying
to dereference a NULL pointer.

So, set lock_ctx->request to NULL before processing callbacks.

This avoids the following valgrind problem.

==3636== Invalid write of size 8
==3636==    at 0x151F3D: ctdb_lock_context_destructor (ctdb_lock.c:276)
==3636==    by 0x58B3618: _talloc_free_internal (talloc.c:993)
==3636==    by 0x58AD692: _talloc_free_children_internal (talloc.c:1472)
==3636==    by 0x58AD692: _talloc_free_internal (talloc.c:1019)
==3636==    by 0x58AD692: _talloc_free (talloc.c:1594)
==3636==    by 0x15292E: ctdb_lock_handler (ctdb_lock.c:471)
==3636==    by 0x56A535A: epoll_event_loop (tevent_epoll.c:728)
==3636==    by 0x56A535A: epoll_event_loop_once (tevent_epoll.c:926)
==3636==    by 0x56A3826: std_event_loop_once (tevent_standard.c:114)
==3636==    by 0x569FFFC: _tevent_loop_once (tevent.c:533)
==3636==    by 0x56A019A: tevent_common_loop_wait (tevent.c:637)
==3636==    by 0x56A37C6: std_event_loop_wait (tevent_standard.c:140)
==3636==    by 0x11E03A: ctdb_start_daemon (ctdb_daemon.c:1320)
==3636==    by 0x118557: main (ctdbd.c:321)
==3636==  Address 0x9c5b660 is 96 bytes inside a block of size 120 free'd
==3636==    at 0x4C29D17: free (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==3636==    by 0x58B32D3: _talloc_free_internal (talloc.c:1063)
==3636==    by 0x58B3232: _talloc_free_children_internal (talloc.c:1472)
==3636==    by 0x58B3232: _talloc_free_internal (talloc.c:1019)
==3636==    by 0x58B3232: _talloc_free_children_internal (talloc.c:1472)
==3636==    by 0x58B3232: _talloc_free_internal (talloc.c:1019)
==3636==    by 0x58AD692: _talloc_free_children_internal (talloc.c:1472)
==3636==    by 0x58AD692: _talloc_free_internal (talloc.c:1019)
==3636==    by 0x58AD692: _talloc_free (talloc.c:1594)
==3636==    by 0x11EC30: daemon_incoming_packet (ctdb_daemon.c:844)
==3636==    by 0x136F4A: lock_fetch_callback (ctdb_ltdb_server.c:268)
==3636==    by 0x152489: process_callbacks (ctdb_lock.c:353)
==3636==    by 0x152489: ctdb_lock_handler (ctdb_lock.c:468)
==3636==    by 0x56A535A: epoll_event_loop (tevent_epoll.c:728)
==3636==    by 0x56A535A: epoll_event_loop_once (tevent_epoll.c:926)
==3636==    by 0x56A3826: std_event_loop_once (tevent_standard.c:114)
==3636==    by 0x569FFFC: _tevent_loop_once (tevent.c:533)
==3636==    by 0x56A019A: tevent_common_loop_wait (tevent.c:637)
==3636==    by 0x56A37C6: std_event_loop_wait (tevent_standard.c:140)
==3636==    by 0x11E03A: ctdb_start_daemon (ctdb_daemon.c:1320)
==3636==    by 0x118557: main (ctdbd.c:321)

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit ee02e40e869fd46f113d016122dd5384b7887228)

8 years agotevent: version 0.9.25
Stefan Metzmacher [Fri, 12 Jun 2015 06:58:26 +0000 (08:58 +0200)]
tevent: version 0.9.25

* Fix compile error in Solaris ports backend.
* Fix access after free in tevent_common_check_signal(). bug #11308
* Improve pytevent bindings.
* Testsuite fixes.
* Improve the documentation of the tevent_add_fd()
  assumtions. It must be talloc_free'ed before closing the fd!
  See bug #11141 and bug #11316.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit d7bdb30cc1731dc84831e323332a85be2bccf6a7)

The last 14 patches address

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11330
Backport tevent-0.9.25.

8 years agopytevent: add a TeventTimer_Object_ref helper structure to make the code clearer
Stefan Metzmacher [Thu, 11 Jun 2015 07:51:19 +0000 (09:51 +0200)]
pytevent: add a TeventTimer_Object_ref helper structure to make the code clearer

This gives talloc_set_destructor to verify the type,
which removes a compiler warning.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 93ee074f912da02d4c1f1584df9b107364b639be)

8 years agopytevent: remove const warnings using discard_const_p()
Stefan Metzmacher [Thu, 11 Jun 2015 07:50:35 +0000 (09:50 +0200)]
pytevent: remove const warnings using discard_const_p()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit fb04f0f4190005ff21817b79d02897af23ddc7ee)

8 years agopytevent: remove dead code TEVENT_DEPRECATED is never defined
Stefan Metzmacher [Thu, 11 Jun 2015 07:49:18 +0000 (09:49 +0200)]
pytevent: remove dead code TEVENT_DEPRECATED is never defined

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 1a8a5ba0d51f9c2c9e84a3400e05327e7059156b)

8 years agotevent.h: propose tstream_ versions of read_packet_send/recv and writev_send/recv
Stefan Metzmacher [Thu, 28 May 2015 07:32:26 +0000 (09:32 +0200)]
tevent.h: propose tstream_ versions of read_packet_send/recv and writev_send/recv

The functions operating on the raw file descriptor are for advanced callers,
which take extra care and avoid the problems of
https://bugzilla.samba.org/show_bug.cgi?id=11141.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 44584f810720602201a9afaaa087eeb83579eff5)

8 years agotevent/testsuite: make sure we cleanup tevent_fd structures in the correct order
Stefan Metzmacher [Fri, 29 May 2015 23:42:08 +0000 (01:42 +0200)]
tevent/testsuite: make sure we cleanup tevent_fd structures in the correct order

First we need to remove the tevent_fd structures without
tevent_fd_set_auto_close(). Closing the fd needs to be the last
thing...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 88971d4870a197f656ef912911ca1e4ff5b56749)