samba.git
3 years agokrb5_wrap: Fix build error when not using heimdal.
Jose A. Rivera [Sat, 25 Jun 2016 15:47:52 +0000 (10:47 -0500)]
krb5_wrap: Fix build error when not using heimdal.

Just a small typo fix where type and variable were flipped.

Signed-off-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Jun 25 22:43:27 CEST 2016 on sn-devel-144

3 years agos4/torture: add a test for dosmode and hidden files
Ralph Boehme [Thu, 23 Jun 2016 17:13:05 +0000 (19:13 +0200)]
s4/torture: add a test for dosmode and hidden files

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/smbd: only use stored dos attributes for open_match_attributes() check
Ralph Boehme [Thu, 23 Jun 2016 10:24:33 +0000 (12:24 +0200)]
s3/smbd: only use stored dos attributes for open_match_attributes() check

This changes the way we check for old vs new DOS attributes on open with
overwrite: only check against the DOS attributes actually set by a
client and stored in the DOS attributes xattr.

With this change "hide dot files" and "hide files" continue to work with
"store dos attributes = yes".

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/smbd: move check for "hide files" to dos_mode_from_name()
Ralph Boehme [Thu, 23 Jun 2016 15:14:55 +0000 (17:14 +0200)]
s3/smbd: move check for "hide files" to dos_mode_from_name()

Consolidate the "hide dot files" and "hide files" handling stuff in one
function. No change in overall behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/smbd: call dos_mode_from_name after SMB_VFS_GET_DOS_ATTRIBUTES()
Ralph Boehme [Thu, 23 Jun 2016 14:40:15 +0000 (16:40 +0200)]
s3/smbd: call dos_mode_from_name after SMB_VFS_GET_DOS_ATTRIBUTES()

This doesn't change overall behaviour in any way, it just prepares for
the next step where the IS_HIDDEN_PATH() stuff will be moved to the
function dos_mode_from_name().

It allows an optimisation by not checking "hide to files" patch if
FILE_ATTRIBUTE_HIDDEN was already set in the DOS xattr.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/smbd: add helper func dos_mode_from_name()
Ralph Boehme [Thu, 23 Jun 2016 10:23:33 +0000 (12:23 +0200)]
s3/smbd: add helper func dos_mode_from_name()

This just moves the computation of "hide dot files" files to a helper
functions without changing overall behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3-ctdb: Return an error when unexpected reply is received
Amitay Isaacs [Fri, 24 Jun 2016 09:22:02 +0000 (19:22 +1000)]
s3-ctdb: Return an error when unexpected reply is received

CTDB can send CTDB_REPLY_ERROR in case it encounters an error condition.
This is treated as successful migration as "ret" is not set.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jun 24 22:39:23 CEST 2016 on sn-devel-144

3 years agopython/tests: add auth_pad test for the dcerpc raw_protocol test
Stefan Metzmacher [Thu, 23 Jun 2016 10:06:40 +0000 (12:06 +0200)]
python/tests: add auth_pad test for the dcerpc raw_protocol test

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 24 18:08:44 CEST 2016 on sn-devel-144

3 years agos4:rpc_server: generate the correct error when we got an invalid auth_pad_length...
Stefan Metzmacher [Thu, 23 Jun 2016 11:50:39 +0000 (13:50 +0200)]
s4:rpc_server: generate the correct error when we got an invalid auth_pad_length on BIND,ALTER,AUTH3

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agolibrpc/rpc: ignore invalid auth_pad_length values in BIND, ALTER and AUTH3 pdus
Stefan Metzmacher [Mon, 20 Jun 2016 14:26:56 +0000 (16:26 +0200)]
librpc/rpc: ignore invalid auth_pad_length values in BIND, ALTER and AUTH3 pdus

This is a workarround for a bug in old Samba releases.
For BIND_ACK <= 3.5.x and for ALTER_RESP <= 4.2.x (see bug #11061).

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agolibrpc/rpc: let dcerpc_pull_auth_trailer() check that auth_pad_length fits within...
Stefan Metzmacher [Mon, 20 Jun 2016 14:25:12 +0000 (16:25 +0200)]
librpc/rpc: let dcerpc_pull_auth_trailer() check that auth_pad_length fits within the whole pdu.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agolibrpc/rpc: let dcerpc_pull_auth_trailer() only accept auth_length!=NULL or auth_data...
Stefan Metzmacher [Mon, 20 Jun 2016 14:17:45 +0000 (16:17 +0200)]
librpc/rpc: let dcerpc_pull_auth_trailer() only accept auth_length!=NULL or auth_data_only=true

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos4:librpc/rpc: don't ask for auth_length if we ask for auth data only
Stefan Metzmacher [Mon, 20 Jun 2016 14:16:23 +0000 (16:16 +0200)]
s4:librpc/rpc: don't ask for auth_length if we ask for auth data only

dcerpc_pull_auth_trailer() handles auth_length=NULL just fine.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos4:rpc_server: parse auth data only for BIND,ALTER_REQ,AUTH3
Stefan Metzmacher [Mon, 20 Jun 2016 14:11:37 +0000 (16:11 +0200)]
s4:rpc_server: parse auth data only for BIND,ALTER_REQ,AUTH3

We should tell dcerpc_pull_auth_trailer() that we only want
auth data.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:rpc_client: remove unused rpc_pipe_client->max_recv_frag
Stefan Metzmacher [Sat, 26 Sep 2015 00:43:30 +0000 (02:43 +0200)]
s3:rpc_client: remove unused rpc_pipe_client->max_recv_frag

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
3 years agos4:rpc_server: remove unused dcesrv_connection_context->assoc_group
Stefan Metzmacher [Wed, 15 Jul 2015 10:02:32 +0000 (12:02 +0200)]
s4:rpc_server: remove unused dcesrv_connection_context->assoc_group

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
3 years agos4:rpc_server: remove unused '_unused_auth_state'
Stefan Metzmacher [Wed, 15 Jul 2015 10:01:35 +0000 (12:01 +0200)]
s4:rpc_server: remove unused '_unused_auth_state'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
3 years agos4:rpc_server: context_id fields of presentation contexts are just 16bit
Stefan Metzmacher [Wed, 15 Jul 2015 08:15:31 +0000 (10:15 +0200)]
s4:rpc_server: context_id fields of presentation contexts are just 16bit

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
3 years agos4:server_named_pipe: make sure we use lower case pipe name
Stefan Metzmacher [Mon, 29 Jun 2015 10:28:03 +0000 (12:28 +0200)]
s4:server_named_pipe: make sure we use lower case pipe name

This matches what tstream_npa_connect() expects.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
3 years agodcerpc.idl: remove unused DCERPC_NCACN_PAYLOAD_MAX_SIZE
Stefan Metzmacher [Wed, 22 Jun 2016 18:38:01 +0000 (20:38 +0200)]
dcerpc.idl: remove unused DCERPC_NCACN_PAYLOAD_MAX_SIZE

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agosmbd: Fix a valgrind error
Volker Lendecke [Fri, 24 Jun 2016 05:27:43 +0000 (07:27 +0200)]
smbd: Fix a valgrind error

"child" has been free'd via "tmp"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun 24 14:07:56 CEST 2016 on sn-devel-144

3 years agoctdb-recovery: Terminate if recovery fails without any banning credits
Amitay Isaacs [Thu, 23 Jun 2016 11:07:37 +0000 (21:07 +1000)]
ctdb-recovery: Terminate if recovery fails without any banning credits

In case of database recovery failure, if there are no banning credits
assigned, then the async computation is never terminated.  The else
condition is missing in (max_credits >= NUM_RETRIES) check.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Jun 24 09:56:23 CEST 2016 on sn-devel-144

3 years agoctdb-recovery-helper: Fix a comment
Amitay Isaacs [Wed, 8 Jun 2016 07:25:42 +0000 (17:25 +1000)]
ctdb-recovery-helper: Fix a comment

The sequence of events are incorrectly documented.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agos3-libnet: Add a comment to make cleaŕ we want to fall through
Andreas Schneider [Thu, 23 Jun 2016 12:18:35 +0000 (14:18 +0200)]
s3-libnet: Add a comment to make cleaŕ we want to fall through

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jun 24 05:58:35 CEST 2016 on sn-devel-144

3 years agonsswitch: Fix memory leak in test_wbc_trusts()
Andreas Schneider [Wed, 22 Jun 2016 06:53:51 +0000 (08:53 +0200)]
nsswitch: Fix memory leak in test_wbc_trusts()

Found by cppcheck.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agonsswitch: Fix memory leak in test_wbc_groups()
Andreas Schneider [Wed, 22 Jun 2016 06:48:12 +0000 (08:48 +0200)]
nsswitch: Fix memory leak in test_wbc_groups()

Found by cppcheck.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agonsswitch: Fix memory leak in test_wbc_users()
Andreas Schneider [Wed, 22 Jun 2016 06:25:54 +0000 (08:25 +0200)]
nsswitch: Fix memory leak in test_wbc_users()

Found by cppcheck.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agonsswitch: Fix memory leak in test_wbc_domain_info()
Andreas Schneider [Wed, 22 Jun 2016 06:16:11 +0000 (08:16 +0200)]
nsswitch: Fix memory leak in test_wbc_domain_info()

Found by cppcheck.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agonsswitch: Fix memory leak in test_wbc_pingdc2()
Andreas Schneider [Wed, 22 Jun 2016 06:04:53 +0000 (08:04 +0200)]
nsswitch: Fix memory leak in test_wbc_pingdc2()

Found by cppcheck.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agonsswitch: Fix memory leak in test_wbc_get_sidaliases()
Andreas Schneider [Wed, 22 Jun 2016 06:01:05 +0000 (08:01 +0200)]
nsswitch: Fix memory leak in test_wbc_get_sidaliases()

Found by cppcheck.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agonsswitch: Fix memory leak in test_wbc_pingdc()
Andreas Schneider [Wed, 22 Jun 2016 05:56:20 +0000 (07:56 +0200)]
nsswitch: Fix memory leak in test_wbc_pingdc()

Found by cppcheck.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agonsswitch: Fix wbclient torture_assert_wbc_ok_goto_fail macro
Andreas Schneider [Wed, 22 Jun 2016 05:51:45 +0000 (07:51 +0200)]
nsswitch: Fix wbclient torture_assert_wbc_ok_goto_fail macro

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agosmbget: Fix a memory leak
Andreas Schneider [Tue, 21 Jun 2016 13:56:23 +0000 (15:56 +0200)]
smbget: Fix a memory leak

Found by cppcheck.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos3-ctdb: Fail CTDB connection only on INACTIVE state
Amitay Isaacs [Thu, 23 Jun 2016 06:17:51 +0000 (16:17 +1000)]
s3-ctdb: Fail CTDB connection only on INACTIVE state

If the node has flag NODE_FLAGS_PERMANENTLY_DISABLED, then it is
still working.  Only avoid connections if node has any of the flags
in NODE_FLAGS_INACTIVE.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jun 23 23:38:44 CEST 2016 on sn-devel-144

3 years agos4:rpc_server: use a variable for the max total reassembled request payload
Stefan Metzmacher [Wed, 22 Jun 2016 15:18:28 +0000 (17:18 +0200)]
s4:rpc_server: use a variable for the max total reassembled request payload

We still use the same limit of 4 MByte (DCERPC_NCACN_REQUEST_DEFAULT_MAX_SIZE)
by default.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jun 23 04:51:16 CEST 2016 on sn-devel-144

3 years agos4:librpc/rpc: allow a total reassembled response payload of 240 MBytes
Stefan Metzmacher [Wed, 22 Jun 2016 15:18:28 +0000 (17:18 +0200)]
s4:librpc/rpc: allow a total reassembled response payload of 240 MBytes

This will replace DCERPC_NCACN_PAYLOAD_MAX_SIZE (4 MByte),
The limit of DCERPC_NCACN_PAYLOAD_MAX_SIZE (4 MByte) was too
strict for some workloads, e.g. DRSUAPI replication with large objects.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agodcerpc.idl: add DCERPC_NCACN_{REQUEST,RESPONSE}_DEFAULT_MAX_SIZE
Stefan Metzmacher [Wed, 22 Jun 2016 14:58:03 +0000 (16:58 +0200)]
dcerpc.idl: add DCERPC_NCACN_{REQUEST,RESPONSE}_DEFAULT_MAX_SIZE

This will replace DCERPC_NCACN_PAYLOAD_MAX_SIZE (4 MByte),
this limit is too strict for some workloads, e.g. DRSUAPI replication
with large objects.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4-ntlm: Fix a NULL pointer dereference in error path
Andreas Schneider [Wed, 22 Jun 2016 13:53:59 +0000 (15:53 +0200)]
s4-ntlm: Fix a NULL pointer dereference in error path

Found by clang compiler.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 22 23:21:33 CEST 2016 on sn-devel-144

3 years agos4-dsdb: Fix a possible NULL pointer dereference
Andreas Schneider [Wed, 22 Jun 2016 13:48:10 +0000 (15:48 +0200)]
s4-dsdb: Fix a possible NULL pointer dereference

Detected by clang compiler.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3-torture: Do some code hygiene in the ldb test
Andreas Schneider [Wed, 22 Jun 2016 13:15:05 +0000 (15:15 +0200)]
s3-torture: Do some code hygiene in the ldb test

Coverity is confused if in a expresion we use = and not ==.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibrpc: Check for negative return value of socket_get_fd()
Andreas Schneider [Wed, 22 Jun 2016 07:25:16 +0000 (09:25 +0200)]
librpc: Check for negative return value of socket_get_fd()

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoutil: Fix a possible null pointer dereference
Andreas Schneider [Wed, 22 Jun 2016 07:17:07 +0000 (09:17 +0200)]
util: Fix a possible null pointer dereference

Found by cppcheck.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3: libsmb: Correctly trim a trailing \\ character in cli_smb2_create_fnum_send(...
Jeremy Allison [Tue, 21 Jun 2016 22:49:27 +0000 (15:49 -0700)]
s3: libsmb: Correctly trim a trailing \\ character in cli_smb2_create_fnum_send() when passing a pathname to SMB2 create.

We already trim any leading \\ characters in this function, so this is the simplest place
to clean the pathname.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Jun 22 10:33:29 CEST 2016 on sn-devel-144

3 years agolibnet: ignore realm setting for domain security joins to AD domains if 'winbind...
Michael Adam [Wed, 15 Jun 2016 21:03:32 +0000 (23:03 +0200)]
libnet: ignore realm setting for domain security joins to AD domains if 'winbind rpc only = true'

Inspired by initial patch from Matt Rogers @ RedHat.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Jun 22 05:05:47 CEST 2016 on sn-devel-144

3 years agoRevert "s3:libnet: accept empty realm for AD domains when only security=domain is...
Michael Adam [Thu, 16 Jun 2016 09:20:15 +0000 (11:20 +0200)]
Revert "s3:libnet: accept empty realm for AD domains when only security=domain is set."

This reverts commit 234a470f198f8f09f46aaeaf58f966faccedef18.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agosmbd: Fix a signed/unsigned hickup
Volker Lendecke [Tue, 21 Jun 2016 14:23:38 +0000 (16:23 +0200)]
smbd: Fix a signed/unsigned hickup

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jun 21 22:22:03 CEST 2016 on sn-devel-144

3 years agoctdb-daemon: make bool assignment more obvious
Michael Adam [Mon, 20 Jun 2016 08:42:43 +0000 (10:42 +0200)]
ctdb-daemon: make bool assignment more obvious

(showing what is the rule and what is the exception)

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jun 21 11:48:29 CEST 2016 on sn-devel-144

3 years agosource4/scripting: add an option to samba_dnsupdate to add ns records.
Richard Sharpe [Tue, 24 May 2016 00:37:13 +0000 (17:37 -0700)]
source4/scripting: add an option to samba_dnsupdate to add ns records.

Add a --add-ns option to samba_dnsupdate and use that, but only when --use-file has been specified, to add an NS record to the file produced.

This allows us to make progress in the self tests and is an interim fix.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Rowland Penny <repenny241155@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jun 21 00:51:02 CEST 2016 on sn-devel-144

3 years agoctdb-tests: Update local daemons tests to use CTDB_NOSETSCHED
Amitay Isaacs [Mon, 20 Jun 2016 04:24:07 +0000 (14:24 +1000)]
ctdb-tests: Update local daemons tests to use CTDB_NOSETSCHED

... instead of --nosetsched command-line option.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Jun 20 20:22:57 CEST 2016 on sn-devel-144

3 years agoctdb-scripts: Add new configuration variable CTDB_NOSETSCHED
Amitay Isaacs [Mon, 20 Jun 2016 04:21:18 +0000 (14:21 +1000)]
ctdb-scripts: Add new configuration variable CTDB_NOSETSCHED

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agoctdb-locking: Avoid real-time in lock helper if nosetsched option is set
Amitay Isaacs [Fri, 17 Jun 2016 08:35:18 +0000 (18:35 +1000)]
ctdb-locking: Avoid real-time in lock helper if nosetsched option is set

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agoctdb-locking: Conditionally set real-time priority in lock helper
Amitay Isaacs [Fri, 17 Jun 2016 08:33:27 +0000 (18:33 +1000)]
ctdb-locking: Conditionally set real-time priority in lock helper

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agoctdb-daemon: Explicitly assign boolean values
Amitay Isaacs [Fri, 17 Jun 2016 08:10:16 +0000 (18:10 +1000)]
ctdb-daemon: Explicitly assign boolean values

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agoctdb-daemon: Do explicit check for integer values
Amitay Isaacs [Fri, 17 Jun 2016 08:09:37 +0000 (18:09 +1000)]
ctdb-daemon: Do explicit check for integer values

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopidl/ws: fix missing $name when generating MAPI dissector
Aurelien Aptel [Wed, 18 May 2016 13:01:56 +0000 (15:01 +0200)]
pidl/ws: fix missing $name when generating MAPI dissector

Port Wireshark commit 0e80176

Author: Alexis La Goutte <alexis.lagoutte@gmail.com>
Date:   Fri Mar 4 19:28:26 2016 +0100

    PIDL (NDR): fix missing $name when regenerate MAPI dissector

    Issue coming from ge41f08858b

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jun 20 16:20:00 CEST 2016 on sn-devel-144

3 years agopidl/ws: fix failing tests
Aurelien Aptel [Wed, 18 May 2016 12:23:56 +0000 (14:23 +0200)]
pidl/ws: fix failing tests

This commit fixes 2 test failures in Pidl test suite.

- commit 02cd7808 changed the error the test was expecting
  => update expected output in the test
- commit c76b65e changed whitespaces in the output
  => revert to the old output in the generator

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/s4/python: typo in comment
Aurelien Aptel [Wed, 24 Feb 2016 16:05:25 +0000 (17:05 +0100)]
pidl/s4/python: typo in comment

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: directly use `di` param instead of casting `private_data` member.
Aurelien Aptel [Wed, 10 Feb 2016 14:05:45 +0000 (15:05 +0100)]
pidl/ws: directly use `di` param instead of casting `private_data` member.

As in Wireshark repo.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: Document CODE_START and HEADER_START
Aurelien Aptel [Wed, 10 Feb 2016 13:52:52 +0000 (14:52 +0100)]
pidl/ws: Document CODE_START and HEADER_START

Port Wireshark commit 833d315

Author: Guy Harris <guy@alum.mit.edu>
Date:   Mon Jan 13 21:18:29 2014 +0000

    Document {CODE,HEADER} {START,END}.

    Clean up indentation.

    svn path=/trunk/; revision=54721

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: whitespace cleanup
Aurelien Aptel [Tue, 9 Feb 2016 17:54:39 +0000 (18:54 +0100)]
pidl/ws: whitespace cleanup

Imported from the WS repo.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: Add HEADER START/HEADER END in ws dissector
Aurelien Aptel [Tue, 9 Feb 2016 17:52:30 +0000 (18:52 +0100)]
pidl/ws: Add HEADER START/HEADER END in ws dissector

Port Wireshark commit a297950

Author: Guy Harris <guy@alum.mit.edu>
Date:   Mon Jan 13 21:05:44 2014 +0000

    Add HEADER START and HEADER END, similar to CODE START and CODE END, to
    allow stuff to be put into the .h file; that way, if you put helper
    functions into the .c file, for use by dissectors other than the one
    being generated, you can put declarations for them into the .h file.

    Do some checks for mis-nesting of CODE and HEADER blocks.

    Clean up the "this is generated code" header.

    svn path=/trunk/; revision=54720

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: dereference pointers when passing name param.
Aurelien Aptel [Tue, 9 Feb 2016 16:36:19 +0000 (17:36 +0100)]
pidl/ws: dereference pointers when passing name param.

Port parts of Wireshark commit a58c986f to the samba repo.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: Remove pinfo->private_data from DCERPC dissectors.
Aurelien Aptel [Tue, 9 Feb 2016 16:30:09 +0000 (17:30 +0100)]
pidl/ws: Remove pinfo->private_data from DCERPC dissectors.

Sort of re-apply Wireshark commit 79cd356 which was never sync with
samba. It was reverted then reintroduced in the WS repo (yes this is
quite convulted).

Original commit message:

Author: Michael Mann <mmann78@netscape.net>
Date:   Wed Nov 6 12:36:09 2013 +0000

    Remove pinfo->private_data from DCERPC dissectors.  Bug 9387 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9387)

    This is the PIDL input file changes necessary to support removing pinfo->private_data from the DCERPC dissectors in favor of passing it through function parameters.  I didn't regenerate the dissector source, so this is just a "good faith" effort to mimic the manual changes.

    svn path=/trunk/; revision=53098

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: remove any starting _ in WS field names
Aurelien Aptel [Tue, 9 Feb 2016 16:12:41 +0000 (17:12 +0100)]
pidl/ws: remove any starting _ in WS field names

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: avoid trailing tabs
Aurelien Aptel [Tue, 9 Feb 2016 15:10:12 +0000 (16:10 +0100)]
pidl/ws: avoid trailing tabs

Port Wireshark commit 4f04a3c

Author: Stefan Metzmacher <metze@samba.org>
Date:   Thu Oct 29 08:32:52 2015 +0100

    tools/pidl: avoid trailing tabs

    Change-Id: I293dd6f2d7ff3b0e27bc3cc49e69977604f12260
Signed-off-by: Stefan Metzmacher <metze@samba.org>
    Reviewed-on: https://code.wireshark.org/review/11433
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl: use https urls and update dead msdn link
Aurelien Aptel [Tue, 9 Feb 2016 14:43:53 +0000 (15:43 +0100)]
pidl: use https urls and update dead msdn link

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: Eliminate e_uuid_t in favor of e_guid_t
Aurelien Aptel [Tue, 9 Feb 2016 14:32:51 +0000 (15:32 +0100)]
pidl/ws: Eliminate e_uuid_t in favor of e_guid_t

Port Wireshark commit 499d959

Author: Guy Harris <guy@alum.mit.edu>
Date:   Tue Mar 3 02:47:53 2015 -0800

    Eliminate e_uuid_t in favor of e_guid_t.

    That eliminates a redundant and confusing data type, and avoids issues
    with one piece of code using e_uuid_t but wanting to use routines
    expecting an e_guid_t.

    Change-Id: I95e172d46d342ab40f6254300ecbd2a0530cde60
    Reviewed-on: https://code.wireshark.org/review/7506
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: Remove #pragma warning (MSVC)
Aurelien Aptel [Fri, 5 Feb 2016 14:31:16 +0000 (15:31 +0100)]
pidl/ws: Remove #pragma warning (MSVC)

Port Wireshark commit ceda0f9

Author: Alexis La Goutte <alexis.lagoutte@gmail.com>
Date:   Sun Oct 5 19:34:46 2014 +0200

    Remove #pragma warning (MSVC) for PIDL generate dissector

    Change-Id: I1e4c7944a2cd877f5c707703dcff44fe9f955a2c
    Reviewed-on: https://code.wireshark.org/review/4479
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: fix Assigned value is garbage or undefined found by Clang Analyzer
Aurelien Aptel [Fri, 5 Feb 2016 14:29:28 +0000 (15:29 +0100)]
pidl/ws: fix Assigned value is garbage or undefined found by Clang Analyzer

Port Wireshark commit 683d657

Author: Alexis La Goutte <alexis.lagoutte@gmail.com>
Date:   Sun Oct 5 19:27:15 2014 +0200

    PIDL (DCERPC): fix Assigned value is garbage or undefined found by Clang Analyzer

    packet-dcerpc-dnsserver.c:1002:12: warning: Assigned value is garbage or undefined
    packet-dcerpc-frstrans.c:1137:12: warning: Assigned value is garbage or undefined
    packet-dcerpc-lsa.c:6345:12: warning: Assigned value is garbage or undefined
    packet-dcerpc-nspi.c:7805:12: warning: Assigned value is garbage or undefined
    packet-dcerpc-dfs.c:3245:11: warning: Function call argument is an uninitialized value
    packet-dcerpc-dfs.c:3245:9: warning: 'level' may be used uninitialized in this function [-Wmaybe-uninitialized]

    Change-Id: Ife6a2f565ae215535d0e3d72ef50800114240e3f
    Reviewed-on: https://code.wireshark.org/review/4478
Reviewed-by: Evan Huus <eapache@gmail.com>
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: fix indent (use 4 tabs) and remove trailing whitespace
Aurelien Aptel [Fri, 5 Feb 2016 14:25:57 +0000 (15:25 +0100)]
pidl/ws: fix indent (use 4 tabs) and remove trailing whitespace

Port Wireshark commit 4110bde

Author: Alexis La Goutte <alexis.lagoutte@gmail.com>
Date:   Fri Sep 26 19:51:34 2014 +0200

    PIDL: fix indent (use 4 tabs) and remove trailing whitespace

    Change-Id: I0ee63a040867b44ac9915704f5e581483ed6f7e2
    Reviewed-on: https://code.wireshark.org/review/4310
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Aurelien Aptel [Fri, 5 Feb 2016 13:43:04 +0000 (14:43 +0100)]
pidl/ws: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang

Port Wireshark commit f6b9e7a

Author: Alexis La Goutte <alexis.lagoutte@gmail.com>
Date:   Sun Sep 28 20:57:13 2014 +0200

    PIDL: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang

    Change-Id: Ibae478771b30d6e9ae07315985f1e71bc6b65423
    Reviewed-on: https://code.wireshark.org/review/4350
Reviewed-by: Michael Mann <mmann78@netscape.net>
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: enhance dissector
Aurelien Aptel [Fri, 5 Feb 2016 13:38:55 +0000 (14:38 +0100)]
pidl/ws: enhance dissector

Port Wireshark commit 28ec9c2

Author: Alexis La Goutte <alexis.lagoutte@gmail.com>
Date:   Fri Sep 26 23:29:43 2014 +0200

    PIDL (DCERPC winreg): enhance dissector

    * Fix PIDL generator for NOEMIT Element (fix -Wunused-function for DCERPC winreg dissector)
    * Fix indent (use tabs)
    * Remove DCERPC winreg dissector from DIRTY list

    Change-Id: I5d16cbfe8481a5e5f7e5df9b51735c93ae4375a7
    Reviewed-on: https://code.wireshark.org/review/4322
Reviewed-by: Michael Mann <mmann78@netscape.net>
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: fix -Wmissing-prototype
Aurelien Aptel [Fri, 5 Feb 2016 13:36:27 +0000 (14:36 +0100)]
pidl/ws: fix -Wmissing-prototype

Port Wireshark commit e759d82

Author: Alexis La Goutte <alexis.lagoutte@gmail.com>
Date:   Fri Sep 26 18:47:53 2014 +0200

    PIDL: fix -Wmissing-prototype

    Change-Id: I4cae47450e8026b10bd373828f235184560e0a99
    Reviewed-on: https://code.wireshark.org/review/4308
    Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agopidl/ws: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Aurelien Aptel [Fri, 5 Feb 2016 13:29:22 +0000 (14:29 +0100)]
pidl/ws: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang

Port Wireshark commit f0b5fb7

Author: Alexis La Goutte <alexis.lagoutte@gmail.com>
Date:   Fri Sep 26 21:31:32 2014 +0200

    PIDL: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang

    Change-Id: I7f6f974732b7905f4ea4686e1a79ca6fbef78fa8
    Reviewed-on: https://code.wireshark.org/review/4319
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agoselftest: make samba3.blackbox.smbclient_tar as flapping
Ralph Boehme [Sun, 19 Jun 2016 17:22:02 +0000 (19:22 +0200)]
selftest: make samba3.blackbox.smbclient_tar as flapping

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jun 20 12:07:18 CEST 2016 on sn-devel-144

3 years agolib/util: Optimise trim_string() to use a single memmove(3)
Martin Schwenke [Sat, 18 Jun 2016 20:47:09 +0000 (06:47 +1000)]
lib/util: Optimise trim_string() to use a single memmove(3)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Jun 20 04:47:26 CEST 2016 on sn-devel-144

3 years agotorture: Add tests for trim_string()
Martin Schwenke [Sun, 19 Jun 2016 03:40:18 +0000 (13:40 +1000)]
torture: Add tests for trim_string()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agoselftest: Kerberos auth with netbios alias SPNs
Ralph Boehme [Sat, 18 Jun 2016 17:30:46 +0000 (19:30 +0200)]
selftest: Kerberos auth with netbios alias SPNs

Since commit 0f6d51f34baa816b6ec422c8bc28687f0a3073de libnet_join
automatically adds netbios aliases as SPNs to the machine account.

This commit adds a simple test with smbclient -k against the aliases.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sun Jun 19 19:07:46 CEST 2016 on sn-devel-144

3 years agos3/net: print returned addresses in dns gethostbyname
Richard Sharpe [Sat, 18 Jun 2016 20:29:36 +0000 (13:29 -0700)]
s3/net: print returned addresses in dns gethostbyname

Make net ads dns gethostbyname actually print out the returned addresses
so we can use it in self tests.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sun Jun 19 10:34:37 CEST 2016 on sn-devel-144

3 years agos4-kdc: Move KDC packet handling functions to kdc-server.c
Andreas Schneider [Fri, 10 Jun 2016 09:29:20 +0000 (11:29 +0200)]
s4-kdc: Move KDC packet handling functions to kdc-server.c

Create an Kerberos implmentation independent KDC-SERVER subsystem so we
can use it to implement a kpasswd server with MIT Kerberos in future.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Jun 19 03:31:32 CEST 2016 on sn-devel-144

3 years agos4-kdc: Create a kdc-proxy.h header file
Andreas Schneider [Mon, 13 Jun 2016 09:20:44 +0000 (11:20 +0200)]
s4-kdc: Create a kdc-proxy.h header file

This makes the it Kerberos implmentation independent.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos4-kdc: Rename proxy-heimdal.c to kdc-proxy.c
Andreas Schneider [Mon, 13 Jun 2016 09:19:51 +0000 (11:19 +0200)]
s4-kdc: Rename proxy-heimdal.c to kdc-proxy.c

The plan is to have a KDC-SERVER subsystem later.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos4-kdc: Move KDC socket structs to krb5-server.h
Andreas Schneider [Fri, 10 Jun 2016 09:23:20 +0000 (11:23 +0200)]
s4-kdc: Move KDC socket structs to krb5-server.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos4-kdc: Move kdc_process_fn_t declaration to kdc-server.h
Andreas Schneider [Fri, 10 Jun 2016 12:06:10 +0000 (14:06 +0200)]
s4-kdc: Move kdc_process_fn_t declaration to kdc-server.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos4-kdc: Move definitions to kdc-server.h
Andreas Schneider [Fri, 10 Jun 2016 09:10:50 +0000 (11:10 +0200)]
s4-kdc: Move definitions to kdc-server.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos4-kdc: Use better and simpler names for the kdc_process_ret enum
Andreas Schneider [Fri, 10 Jun 2016 07:50:45 +0000 (09:50 +0200)]
s4-kdc: Use better and simpler names for the kdc_process_ret enum

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos4-kdc: Put the heimdal kdc config into a private data pointer
Andreas Schneider [Fri, 10 Jun 2016 07:42:33 +0000 (09:42 +0200)]
s4-kdc: Put the heimdal kdc config into a private data pointer

This allows us to make the struct general useable.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos4-kdc: Use smb_krb5_mk_error() in kpasswd implementation
Andreas Schneider [Tue, 14 Jun 2016 14:31:32 +0000 (16:31 +0200)]
s4-kdc: Use smb_krb5_mk_error() in kpasswd implementation

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos4-kdc: Use smb_krb5_mk_error() in kdc implemenation
Andreas Schneider [Tue, 14 Jun 2016 14:33:34 +0000 (16:33 +0200)]
s4-kdc: Use smb_krb5_mk_error() in kdc implemenation

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agokrb5_wrap: Add smb_krb5_mk_error()
Andreas Schneider [Mon, 13 Jun 2016 08:52:46 +0000 (10:52 +0200)]
krb5_wrap: Add smb_krb5_mk_error()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos4-kdc: Rename heimdal KDC files
Andreas Schneider [Fri, 10 Jun 2016 07:12:39 +0000 (09:12 +0200)]
s4-kdc: Rename heimdal KDC files

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoctdb-tests: Improve ctdb protocol tests
Amitay Isaacs [Tue, 3 May 2016 04:12:42 +0000 (14:12 +1000)]
ctdb-tests: Improve ctdb protocol tests

Test with 0-sized arrays in various data types.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Jun 18 23:31:50 CEST 2016 on sn-devel-144

3 years agoctdb-protocol: Add checks to validate data on wire before unmarshaling
Amitay Isaacs [Tue, 3 May 2016 02:53:24 +0000 (12:53 +1000)]
ctdb-protocol: Add checks to validate data on wire before unmarshaling

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agoctdb-protocol: Add checks to validate data on wire before unmarshaling
Amitay Isaacs [Tue, 3 May 2016 03:20:53 +0000 (13:20 +1000)]
ctdb-protocol: Add checks to validate data on wire before unmarshaling

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agoctdb-protocol: Fix marshaling of uint arrays
Amitay Isaacs [Tue, 3 May 2016 06:46:29 +0000 (16:46 +1000)]
ctdb-protocol: Fix marshaling of uint arrays

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos4: torture: Added raw readX test to ensure 'reserved' fields are zero.
Jeremy Allison [Fri, 10 Jun 2016 16:32:32 +0000 (09:32 -0700)]
s4: torture: Added raw readX test to ensure 'reserved' fields are zero.

Passes against Win2k12+, and smbd with the previous patch.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Sat Jun 18 19:32:22 CEST 2016 on sn-devel-144

3 years agos3: smbd: In reply_read_and_X() SMB1 server is overwriting part of the 'reserved...
Jeremy Allison [Mon, 13 Jun 2016 16:30:25 +0000 (09:30 -0700)]
s3: smbd: In reply_read_and_X() SMB1 server is overwriting part of the 'reserved' zero fields with reply data length.

This occurred due to old code that used to do:

SSVAL(smb_buf(req->outbuf),-2,nread);

to set the reply length. This code was not needed,
as srv_set_message() was already correctly setting
the bcc length and was probably left from much
earlier legacy code.

However, in commit ddaa65ef6e049a185281c4d5deca4045e3b085e2
this was converted to do:

SSVAL(req->outbuf,smb_vwv11,smb_maxcnt);

This code actually overwrites the last 'reserved'
field in the SMB_COM_READ_ANDX packet reply, but we
never noticed as no client (or server code) looks at or
checks vwv11 in a SMB_COM_READ_ANDX reply.

[MS-SMB] shows for SMB_COM_READ_ANDX reply:

SMB_Parameters
{
        UCHAR WordCount;
        Words
        {
                UCHAR AndXCommand;
                UCHAR AndXReserved;
                USHORT AndXOffset;
                USHORT Available;
                USHORT DataCompactionMode;
                USHORT Reserved1;
                USHORT DataLength;
                USHORT DataOffset;
                USHORT DataLengthHigh;
                USHORT Reserved2[4];
        }
}
SMB_Data
{
        USHORT ByteCount;
        Bytes
        {
                UCHAR Pad[] (optional);
                UCHAR Data[variable];
        }

and indeed checking wireshark from Win2012R2
we find that smbd is writing the returned
read length into smb_vwv11 and Windows leaves
it as zeros (reserved).

Also fix the same problem in the named pipes code.

Torture test to ensure Reserved2[4] replies
are zero to follow.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
3 years agos3: smbd: Use common function setup_readX_header() in aio read code.
Jeremy Allison [Mon, 13 Jun 2016 16:25:02 +0000 (09:25 -0700)]
s3: smbd: Use common function setup_readX_header() in aio read code.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
3 years agos3: smbd: Make setup_readX_header() externally accessible
Jeremy Allison [Mon, 13 Jun 2016 16:22:56 +0000 (09:22 -0700)]
s3: smbd: Make setup_readX_header() externally accessible

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
3 years agos3: smbd: Remove unused 'req' argument from setup_readX_header()
Jeremy Allison [Mon, 13 Jun 2016 16:20:43 +0000 (09:20 -0700)]
s3: smbd: Remove unused 'req' argument from setup_readX_header()

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>