sfrench/samba-autobuild/.git
9 years agoutil: Fix indentation
Martin Schwenke [Wed, 6 Aug 2014 01:57:06 +0000 (11:57 +1000)]
util: Fix indentation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 years agonsswitch: Skip groups we were not able to map.
Andreas Schneider [Fri, 19 Sep 2014 11:33:10 +0000 (13:33 +0200)]
nsswitch: Skip groups we were not able to map.

If we have configured the idmap_ad backend it is possible that the user
is in a group without a gid set. This will result in (uid_t)-1 as the
gid. We return this invalid gid to NSS which is wrong.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Sep 19 17:57:14 CEST 2014 on sn-devel-104

9 years agos3:torture: use cli_state_client_guid in run_smb2_multi_channel()
Stefan Metzmacher [Thu, 19 Jun 2014 23:03:38 +0000 (01:03 +0200)]
s3:torture: use cli_state_client_guid in run_smb2_multi_channel()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Sep 19 11:40:15 CEST 2014 on sn-devel-104

9 years agos3:libsmb: add 'cli_state_client_guid'
Stefan Metzmacher [Thu, 19 Jun 2014 23:03:08 +0000 (01:03 +0200)]
s3:libsmb: add 'cli_state_client_guid'

This can be used by tests to use the same client guid for multiple connections.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smb2_sesssetup: we don't need to do a 2nd smb2srv_session_lookup()
Stefan Metzmacher [Sun, 14 Sep 2014 22:10:11 +0000 (00:10 +0200)]
s3:smb2_sesssetup: we don't need to do a 2nd smb2srv_session_lookup()

For the continuation of a SMB2 SessionSetup we already have the
smb2req->session (with NT_STATUS_MORE_PROCESSING_REQUIRED).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smb2_server: add smbd_smb2_signing_key() helper function
Stefan Metzmacher [Thu, 12 Jun 2014 13:31:25 +0000 (15:31 +0200)]
s3:smb2_server: add smbd_smb2_signing_key() helper function

This will find the correct signing key for the connection.

If there's already a channel session key, we need to use that
otherwise we need to use the global session key.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbXsrv_session: add smbXsrv_session_find_channel()
Stefan Metzmacher [Thu, 12 Jun 2014 11:04:40 +0000 (13:04 +0200)]
s3:smbXsrv_session: add smbXsrv_session_find_channel()

This function can check if a smbXsrv_connection is already bound to
a smbXsrv_session.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbXsrv_session: remember the smbXsrv_connection on channel attached to a session
Stefan Metzmacher [Thu, 12 Jun 2014 07:51:18 +0000 (09:51 +0200)]
s3:smbXsrv_session: remember the smbXsrv_connection on channel attached to a session

A session will be usable from multiple connections in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: split out a smbd_add_connection() helper function.
Stefan Metzmacher [Thu, 19 Jun 2014 22:31:31 +0000 (00:31 +0200)]
s3:smbd: split out a smbd_add_connection() helper function.

This attaches a smbXsrv_connection to a smbXsrv_client structure.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: remove now unused smbd_server_connection->conn
Stefan Metzmacher [Thu, 12 Jun 2014 06:43:26 +0000 (08:43 +0200)]
s3:smbd: remove now unused smbd_server_connection->conn

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smb2_lock: iterate over all sconn->client->connections
Stefan Metzmacher [Tue, 16 Sep 2014 07:03:39 +0000 (09:03 +0200)]
s3:smb2_lock: iterate over all sconn->client->connections

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smb2_lock: always use tevent_req_defer_callback() if we go async
Stefan Metzmacher [Tue, 16 Sep 2014 06:05:31 +0000 (08:05 +0200)]
s3:smb2_lock: always use tevent_req_defer_callback() if we go async

process_blocking_lock_queue_smb2() can call reprocess_blocked_smb2_lock()
multiple times, which results in multiple tevent_req_done() calls.

As we could disconnect the connection from there,
process_blocking_lock_queue_smb2() could crash as the local state might be
destroyed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smb2_glue: remove chained fsps from all connections in remove_smb2_chained_fsp()
Stefan Metzmacher [Tue, 16 Sep 2014 05:50:41 +0000 (07:50 +0200)]
s3:smb2_glue: remove chained fsps from all connections in remove_smb2_chained_fsp()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smb2_break: use fsp->conn->sconn->client->connections to send SMB2 oplock breaks
Stefan Metzmacher [Tue, 16 Sep 2014 07:23:54 +0000 (09:23 +0200)]
s3:smb2_break: use fsp->conn->sconn->client->connections to send SMB2 oplock breaks

This means we use the first connection for now.

TODO: we may need to use the connection on which the SMB2 create was done
and fallback to other connections.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smb2_break: pass smbXsrv_connection to smbd_smb2_send_oplock_break()
Stefan Metzmacher [Tue, 16 Sep 2014 04:52:26 +0000 (06:52 +0200)]
s3:smb2_break: pass smbXsrv_connection to smbd_smb2_send_oplock_break()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smb2_create: pass smbXsrv_connection to *deferred*_smb2
Stefan Metzmacher [Tue, 16 Sep 2014 05:49:44 +0000 (07:49 +0200)]
s3:smb2_create: pass smbXsrv_connection to *deferred*_smb2

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: pass smbXsrv_connection to schedule_deferred_open_message_smb()
Stefan Metzmacher [Tue, 16 Sep 2014 05:38:44 +0000 (07:38 +0200)]
s3:smbd: pass smbXsrv_connection to schedule_deferred_open_message_smb()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: pass smbXsrv_connection to remove_deferred_open_message_smb()
Stefan Metzmacher [Tue, 16 Sep 2014 05:32:14 +0000 (07:32 +0200)]
s3:smbd: pass smbXsrv_connection to remove_deferred_open_message_smb()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: pass smbXsrv_connection to open_was_deferred()
Stefan Metzmacher [Tue, 16 Sep 2014 04:55:39 +0000 (06:55 +0200)]
s3:smbd: pass smbXsrv_connection to open_was_deferred()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: move smbXsrv_{session,tcon,open} tables to smbXsrv_client
Stefan Metzmacher [Thu, 12 Jun 2014 18:22:54 +0000 (20:22 +0200)]
s3:smbd: move smbXsrv_{session,tcon,open} tables to smbXsrv_client

These should be per client (based on the SMB >= 2.1 client_guid),
this is a preparation for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: use tevent_loop_wait() in the parent smbd process.
Michael Adam [Tue, 26 Feb 2013 15:39:46 +0000 (16:39 +0100)]
s3:smbd: use tevent_loop_wait() in the parent smbd process.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:smbd: use tevent_loop_wait() in the child process event loop
Michael Adam [Tue, 26 Feb 2013 15:18:09 +0000 (16:18 +0100)]
s3:smbd: use tevent_loop_wait() in the child process event loop

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

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:smbXsrv_session: change smbXsrv_session->connection to smbXsrv_session->client
Stefan Metzmacher [Thu, 12 Jun 2014 07:30:24 +0000 (09:30 +0200)]
s3:smbXsrv_session: change smbXsrv_session->connection to smbXsrv_session->client

A session will be usable from multiple connections in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: use fsp->conn->sconn->client->connections to send SMB1 oplock breaks
Stefan Metzmacher [Tue, 16 Sep 2014 07:23:54 +0000 (09:23 +0200)]
s3:smbd: use fsp->conn->sconn->client->connections to send SMB1 oplock breaks

This means we use the first and only connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: use sconn->client->connections in keepalive_fn()
Stefan Metzmacher [Mon, 15 Sep 2014 02:07:43 +0000 (04:07 +0200)]
s3:smbd: use sconn->client->connections in keepalive_fn()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: use sconn->client->connections in reload_services()
Stefan Metzmacher [Tue, 10 Jun 2014 13:47:26 +0000 (15:47 +0200)]
s3:smbd: use sconn->client->connections in reload_services()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: remove now unused smbXsrv_connection->sconn
Stefan Metzmacher [Thu, 12 Jun 2014 06:57:22 +0000 (08:57 +0200)]
s3:smbd: remove now unused smbXsrv_connection->sconn

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbXsrv_open: use xconn->client->sconn in smb1srv_open_table_init()
Stefan Metzmacher [Thu, 12 Jun 2014 06:57:22 +0000 (08:57 +0200)]
s3:smbXsrv_open: use xconn->client->sconn in smb1srv_open_table_init()

conn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbXsrv_session: use xconn->client->sconn in smbXsrv_session_logoff()
Stefan Metzmacher [Thu, 12 Jun 2014 06:57:22 +0000 (08:57 +0200)]
s3:smbXsrv_session: use xconn->client->sconn in smbXsrv_session_logoff()

conn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smb2_server: use xconn->client->sconn in smbd_smb2_request_next_incoming()
Stefan Metzmacher [Wed, 11 Jun 2014 08:59:00 +0000 (10:59 +0200)]
s3:smb2_server: use xconn->client->sconn in smbd_smb2_request_next_incoming()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smb2_server: use xconn->client->sconn in smbd_smb2_request_create()
Stefan Metzmacher [Wed, 11 Jun 2014 08:51:04 +0000 (10:51 +0200)]
s3:smb2_server: use xconn->client->sconn in smbd_smb2_request_create()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smb2_server: use xconn->client->sconn in smbd_smb2_first_negprot()
Stefan Metzmacher [Wed, 11 Jun 2014 08:42:01 +0000 (10:42 +0200)]
s3:smb2_server: use xconn->client->sconn in smbd_smb2_first_negprot()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smb2_server: use xconn->client->sconn in smbd_smb2_io_handler()
Stefan Metzmacher [Tue, 10 Jun 2014 18:20:58 +0000 (20:20 +0200)]
s3:smb2_server: use xconn->client->sconn in smbd_smb2_io_handler()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: use xconn->client->sconn in make_connection_snum()
Stefan Metzmacher [Mon, 15 Sep 2014 23:03:31 +0000 (01:03 +0200)]
s3:smbd: use xconn->client->sconn in make_connection_snum()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: use xconn->client->sconn in smb1_parse_chain()
Stefan Metzmacher [Wed, 11 Jun 2014 10:54:47 +0000 (12:54 +0200)]
s3:smbd: use xconn->client->sconn in smb1_parse_chain()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: use xconn->client->sconn in construct_reply()
Stefan Metzmacher [Wed, 11 Jun 2014 10:54:47 +0000 (12:54 +0200)]
s3:smbd: use xconn->client->sconn in construct_reply()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: use xconn->client->sconn in reply_special()
Stefan Metzmacher [Wed, 11 Jun 2014 10:54:47 +0000 (12:54 +0200)]
s3:smbd: use xconn->client->sconn in reply_special()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: use xconn->client->sconn in process_smb()
Stefan Metzmacher [Wed, 11 Jun 2014 08:40:42 +0000 (10:40 +0200)]
s3:smbd: use xconn->client->sconn in process_smb()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: introduce 'struct smbXsrv_client' in order to prepare multi-channel support
Stefan Metzmacher [Tue, 20 May 2014 17:47:13 +0000 (19:47 +0200)]
s3:smbd: introduce 'struct smbXsrv_client' in order to prepare multi-channel support

This structure is supposed to hold the global state shared between
multiple connections from the same client.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: pass smbXsrv_connection to make_connection_snum()
Stefan Metzmacher [Mon, 15 Sep 2014 01:47:41 +0000 (03:47 +0200)]
s3:smbd: pass smbXsrv_connection to make_connection_snum()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: pass smb_request to make_connection_smb1()
Stefan Metzmacher [Mon, 15 Sep 2014 01:47:41 +0000 (03:47 +0200)]
s3:smbd: pass smb_request to make_connection_smb1()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: pass smbd_smb2_request to make_connection_smb2()
Stefan Metzmacher [Mon, 15 Sep 2014 01:47:41 +0000 (03:47 +0200)]
s3:smbd: pass smbd_smb2_request to make_connection_smb2()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: pass smb_request to make_connection()
Stefan Metzmacher [Mon, 15 Sep 2014 01:47:41 +0000 (03:47 +0200)]
s3:smbd: pass smb_request to make_connection()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: pass smbXsrv_connection to construct_reply*()
Stefan Metzmacher [Thu, 12 Jun 2014 06:43:26 +0000 (08:43 +0200)]
s3:smbd: pass smbXsrv_connection to construct_reply*()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: pass smbXsrv_connection to smb1_parse_chain()
Stefan Metzmacher [Thu, 12 Jun 2014 06:43:26 +0000 (08:43 +0200)]
s3:smbd: pass smbXsrv_connection to smb1_parse_chain()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: support xconn=NULL in init_smb_request()
Michael Adam [Thu, 18 Sep 2014 19:46:22 +0000 (21:46 +0200)]
s3:smbd: support xconn=NULL in init_smb_request()

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:smbd: only pass smbXsrv_connection to fork_echo_handler()
Stefan Metzmacher [Thu, 12 Jun 2014 06:43:26 +0000 (08:43 +0200)]
s3:smbd: only pass smbXsrv_connection to fork_echo_handler()

We don't need smbd_server_connection there.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: use req->sconn in reply.c where possible
Stefan Metzmacher [Wed, 11 Jun 2014 13:12:32 +0000 (15:12 +0200)]
s3:smbd: use req->sconn in reply.c where possible

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: use req->sconn in sesssetup.c
Stefan Metzmacher [Wed, 11 Jun 2014 13:11:05 +0000 (15:11 +0200)]
s3:smbd: use req->sconn in sesssetup.c

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: use req->sconn in reply_ntcancel()
Stefan Metzmacher [Wed, 11 Jun 2014 12:26:57 +0000 (14:26 +0200)]
s3:smbd: use req->sconn in reply_ntcancel()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: use req->sconn in reply_negprot()
Stefan Metzmacher [Wed, 11 Jun 2014 10:42:56 +0000 (12:42 +0200)]
s3:smbd: use req->sconn in reply_negprot()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: pass smbXsrv_connection to srv_send_smb()
Stefan Metzmacher [Wed, 11 Jun 2014 10:55:24 +0000 (12:55 +0200)]
s3:smbd: pass smbXsrv_connection to srv_send_smb()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: pass smbXsrv_connection to receive_smb*()
Stefan Metzmacher [Thu, 12 Jun 2014 06:43:26 +0000 (08:43 +0200)]
s3:smbd: pass smbXsrv_connection to receive_smb*()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbd: use smbXsrv_connection_dbg() in receive_smb_talloc()
Michael Adam [Thu, 18 Sep 2014 19:25:44 +0000 (21:25 +0200)]
s3:smbd: use smbXsrv_connection_dbg() in receive_smb_talloc()

instead of manually assembling the address string

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:smbd: use smbXsrv_connection_dbg() inreceive_smb_raw_talloc_partial_read()
Michael Adam [Thu, 18 Sep 2014 19:23:31 +0000 (21:23 +0200)]
s3:smbd: use smbXsrv_connection_dbg() inreceive_smb_raw_talloc_partial_read()

instead of manually assembling the address string

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:smb2_sesssetup: use smb2req->sconn in smbd_smb2_reauth_generic_return()
Stefan Metzmacher [Wed, 6 Aug 2014 15:05:26 +0000 (17:05 +0200)]
s3:smb2_sesssetup: use smb2req->sconn in smbd_smb2_reauth_generic_return()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smb2_server: use the global signing key to check if signing is required
Stefan Metzmacher [Thu, 12 Jun 2014 13:10:11 +0000 (15:10 +0200)]
s3:smb2_server: use the global signing key to check if signing is required

If we have a channel session key, we also always have a global session key.

For multi-channel it's possible that the channel session key is not in place
yet, in that case the global session key needs to be used.

In both cases (reauth or session bind) we session setup requests need to be
signed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos4:torture/smb2/lock: Add Lock Replay detection test case.
Anubhav Rakshit [Fri, 5 Sep 2014 10:46:57 +0000 (16:16 +0530)]
s4:torture/smb2/lock: Add Lock Replay detection test case.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos4:torture: Add Replay tests to examine server behaviour when Multiple Channels are...
Anubhav Rakshit [Thu, 7 Aug 2014 07:22:50 +0000 (12:52 +0530)]
s4:torture: Add Replay tests to examine server behaviour when Multiple Channels are utilized.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:selftest: run the smb2.replay test against the //$SERVER_IP/durable share
Stefan Metzmacher [Thu, 28 Aug 2014 11:26:44 +0000 (13:26 +0200)]
s3:selftest: run the smb2.replay test against the //$SERVER_IP/durable share

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agolibcli/smb: Add routines to enable/disable SMB2_HDR_FLAG_REPLAY_OPERATION flag.
Anubhav Rakshit [Thu, 10 Jul 2014 11:16:04 +0000 (16:46 +0530)]
libcli/smb: Add routines to enable/disable SMB2_HDR_FLAG_REPLAY_OPERATION flag.

Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agolibcli/smb: Add routine to reset the Channel Sequence number.
Anubhav Rakshit [Thu, 10 Jul 2014 09:00:10 +0000 (14:30 +0530)]
libcli/smb: Add routine to reset the Channel Sequence number.

Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agolibcli/smb: correctly report disconnect errors after getting STATUS_PENDING
Stefan Metzmacher [Thu, 28 Aug 2014 08:20:36 +0000 (10:20 +0200)]
libcli/smb: correctly report disconnect errors after getting STATUS_PENDING

smb2cli_req_recv() should not report STATUS_PENDING if the
request isn't pending anymore (e.g. the connection was disconnected)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos4:libcli/composite: correctly finish composite smb and smb2 requests
Stefan Metzmacher [Thu, 28 Aug 2014 09:05:23 +0000 (11:05 +0200)]
s4:libcli/composite: correctly finish composite smb and smb2 requests

Without this we would hang forever if the connection was already disconnected,
instead of directly propagating NT_STATUS_CONNECTION_DISCONNECTED;

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoctdb-build: Add missing configure checks for backtrace
Amitay Isaacs [Thu, 18 Sep 2014 00:21:25 +0000 (10:21 +1000)]
ctdb-build: Add missing configure checks for backtrace

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 Sep 19 06:06:31 CEST 2014 on sn-devel-104

9 years agolib: util: Check *every* asn1 return call and early return.
Jeremy Allison [Thu, 18 Sep 2014 20:58:45 +0000 (13:58 -0700)]
lib: util: Check *every* asn1 return call and early return.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep 19 01:29:00 CEST 2014 on sn-devel-104

9 years agolib: Polish echo_server
Volker Lendecke [Sun, 14 Sep 2014 18:45:31 +0000 (20:45 +0200)]
lib: Polish echo_server

Samba has a lot of struct assignments now, in a lot of cases it simplifies the
code. Use it in the sample code.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep 18 23:02:38 CEST 2014 on sn-devel-104

9 years agolib: Add EMSGSIZE to map_nt_error_from_unix
Volker Lendecke [Sat, 13 Sep 2014 18:44:13 +0000 (20:44 +0200)]
lib: Add EMSGSIZE to map_nt_error_from_unix

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb_conn: Fix a small memory leak when releasing an IP
Volker Lendecke [Sat, 13 Sep 2014 18:06:45 +0000 (20:06 +0200)]
ctdb_conn: Fix a small memory leak when releasing an IP

We're exiting anyway, but when in the future we have multichannel this
might actually be a small leak.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agomessaging4: Fix an error path memleak
Volker Lendecke [Sun, 14 Sep 2014 12:33:53 +0000 (14:33 +0200)]
messaging4: Fix an error path memleak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agolib: util_tdb does not need samba-util
Volker Lendecke [Sun, 14 Sep 2014 09:22:36 +0000 (11:22 +0200)]
lib: util_tdb does not need samba-util

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agotdb_wrap: Only pull in samba-debug
Volker Lendecke [Sun, 14 Sep 2014 07:35:24 +0000 (09:35 +0200)]
tdb_wrap: Only pull in samba-debug

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agolib: Move tdb lock timeout fns to source3
Volker Lendecke [Sun, 14 Sep 2014 09:15:34 +0000 (11:15 +0200)]
lib: Move tdb lock timeout fns to source3

This is not the nicest code and needs to be replaced. Remove it from
common.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agolib: Fix samba-util dep in "errors" module
Volker Lendecke [Wed, 17 Sep 2014 13:09:52 +0000 (15:09 +0200)]
lib: Fix samba-util dep in "errors" module

This piece of code pulls in talloc_stackframe and smb_panic into what
should be a very simple mapping library. I'm trying to reduce our
dependencies right now a bit, and I think the use cases that this fixes
(unknown NTSTATUS together with double nt_errstr() calls in the same
DEBUG) are rare enough that this is not justified.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoRemove a few #ifdef EWOULDBLOCk
Volker Lendecke [Tue, 16 Sep 2014 22:25:38 +0000 (00:25 +0200)]
Remove a few #ifdef EWOULDBLOCk

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agolib: Reduce deps for "smb_transport"
Volker Lendecke [Tue, 16 Sep 2014 21:11:27 +0000 (23:11 +0200)]
lib: Reduce deps for "smb_transport"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agolib: Make set_blocking() available independently
Volker Lendecke [Tue, 16 Sep 2014 20:39:01 +0000 (22:39 +0200)]
lib: Make set_blocking() available independently

async_connect_send() needs this, and I don't want to pull in samba-util
just for this

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Make samba-debug a private library
Volker Lendecke [Thu, 18 Sep 2014 12:50:50 +0000 (14:50 +0200)]
lib: Make samba-debug a private library

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3: vfs module: Adding new vfs module for Symantec VxFS.
Abhidnya Joshi [Mon, 1 Sep 2014 08:40:10 +0000 (14:10 +0530)]
s3: vfs module: Adding new vfs module for Symantec VxFS.

This mainly handles ACL related functions.

Modified to add requirement for -DCFLAGS=-DXATTR_USER_NTACL="user.NTACL"
and to hide access to XATTR_USER_NTACL by jra.

Signed-off-by: Abhidnya Joshi <abhidnya_joshi@symantec.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 18 02:30:06 CEST 2014 on sn-devel-104

9 years agonmbd: Send waiting status to systemd.
Andreas Schneider [Tue, 16 Sep 2014 16:03:51 +0000 (18:03 +0200)]
nmbd: Send waiting status to systemd.

This tells the Administrator what's going on and we should log that IPv6
is not supported.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Sep 17 13:16:43 CEST 2014 on sn-devel-104

9 years agolib: Add daemon_status() to util library.
Andreas Schneider [Tue, 16 Sep 2014 16:02:30 +0000 (18:02 +0200)]
lib: Add daemon_status() to util library.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
9 years agoctdb-scripts: Do not export variables if they are not set
Amitay Isaacs [Tue, 16 Sep 2014 02:33:26 +0000 (12:33 +1000)]
ctdb-scripts: Do not export variables if they are not set

Variables that are not set but exported, may return an empty string
for getenv().  Tested on freebsd.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Sep 17 09:55:47 CEST 2014 on sn-devel-104

9 years agoctdb-scripts: Fix a typo
Amitay Isaacs [Tue, 16 Sep 2014 02:00:10 +0000 (12:00 +1000)]
ctdb-scripts: Fix a typo

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-build: Check for libpcap
Amitay Isaacs [Mon, 15 Sep 2014 06:10:16 +0000 (16:10 +1000)]
ctdb-build: Check for libpcap

AIX and FreeBSD do not support raw sockets.  So use libpcap interface
to watch for specific TCP messages.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-build: Check for ETIME in errno.h
Amitay Isaacs [Mon, 15 Sep 2014 05:52:38 +0000 (15:52 +1000)]
ctdb-build: Check for ETIME in errno.h

ETIME is not defined on freebsd.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-build: Add some missing configure checks
Martin Schwenke [Mon, 15 Sep 2014 01:01:21 +0000 (11:01 +1000)]
ctdb-build: Add some missing configure checks

Fail configure if thread_setsched() is unavailable on AIX or if
sched_setscheduler() is unavailable on other platforms.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-build: Improve platform check
Amitay Isaacs [Mon, 15 Sep 2014 05:55:27 +0000 (15:55 +1000)]
ctdb-build: Improve platform check

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-util: Log an error if there is no way to set scheduler
Martin Schwenke [Mon, 15 Sep 2014 01:48:33 +0000 (11:48 +1000)]
ctdb-util: Log an error if there is no way to set scheduler

Although configure should catch this, logging a run-time error is
better than being mystified when ctdbd silently exits.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agolib: Make nt_err_code_struct private
Volker Lendecke [Tue, 16 Sep 2014 21:38:24 +0000 (23:38 +0200)]
lib: Make nt_err_code_struct private

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep 17 02:56:54 CEST 2014 on sn-devel-104

9 years agoreplace: Make EWOULDBLOCK always available
Volker Lendecke [Tue, 16 Sep 2014 17:44:57 +0000 (19:44 +0200)]
replace: Make EWOULDBLOCK always available

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Avoid a talloc in write_data_iov
Volker Lendecke [Tue, 16 Sep 2014 17:19:06 +0000 (19:19 +0200)]
lib: Avoid a talloc in write_data_iov

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Remove unused file_lines_slashcont
Volker Lendecke [Sun, 14 Sep 2014 16:49:46 +0000 (18:49 +0200)]
lib: Remove unused file_lines_slashcont

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Move "large_file_support()" to the source4 smb server
Volker Lendecke [Sun, 14 Sep 2014 16:44:36 +0000 (18:44 +0200)]
lib: Move "large_file_support()" to the source4 smb server

That's the only place where it's used, make it static there.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agotdb: change version to 1.3.1 tdb-1.3.1
Michael Adam [Wed, 11 Jun 2014 11:23:33 +0000 (13:23 +0200)]
tdb: change version to 1.3.1

* internal code cleanup
* improved free record detection with a highly contended freelist
  on tdb's with dead record support (TDB_VOLATILE).
* implicit defragmentation of the free list.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Sep 16 12:13:31 CEST 2014 on sn-devel-104

9 years agotdb:tools: fix a compiler warning
Stefan Metzmacher [Thu, 3 Jul 2014 11:34:09 +0000 (13:34 +0200)]
tdb:tools: fix a compiler warning

   ../../tdb/tools/tdbtool.c: In function ‘do_command’:
   ../../tdb/tools/tdbtool.c:717: error: declaration of ‘count’ shadows a global declaration
   ../../tdb/tools/tdbtool.c:597: error: shadowed declaration is here

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoAdd test suite for iconv conversion fail of bad names over SMB1/SMB3.
Jeremy Allison [Wed, 27 Aug 2014 20:15:29 +0000 (13:15 -0700)]
Add test suite for iconv conversion fail of bad names over SMB1/SMB3.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Sep 16 04:21:49 CEST 2014 on sn-devel-104

9 years agos3: smbd: Fix a couple of tricky slow-path cases - don't return a mangled name for...
Jeremy Allison [Tue, 26 Aug 2014 23:39:56 +0000 (16:39 -0700)]
s3: smbd: Fix a couple of tricky slow-path cases - don't return a mangled name for a name that cannot be converted.

For a name that contains an illegal Windows character, the
directory listing code returns the mangled 8.3 name as the
primary name for the file.

If the original (non-mangled) filename cannot be converted
to UCS2 on the wire via iconv due to conversion error, we
should skip that name when returning a directory listing,
as we can't map back from a returned 8.3 name to a usable
non-mangled filename if the client sends it back to us.

As this is only done in a very slow path (name must be mangled)
or in the old DOS protocol listing code I don't feel too bad
about using a talloc/free pair here.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agos3: smbd: Change get_lanman2_dir_entry() to return the full NTSTATUS.
Jeremy Allison [Tue, 26 Aug 2014 22:05:24 +0000 (15:05 -0700)]
s3: smbd: Change get_lanman2_dir_entry() to return the full NTSTATUS.

Handle the errors correctly at the level above inside the SMB1 server.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agos3: smbd: Remove unneeded 'out_of_space' parameter from smbd_dirptr_lanman2_entry().
Jeremy Allison [Tue, 26 Aug 2014 21:54:56 +0000 (14:54 -0700)]
s3: smbd: Remove unneeded 'out_of_space' parameter from smbd_dirptr_lanman2_entry().

This can now be handled by checking for the STATUS_MORE_ENTRIES error return.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agos3: smbd: SMB2 - change smbd_dirptr_lanman2_entry() to return an NTSTATUS.
Jeremy Allison [Tue, 26 Aug 2014 21:49:37 +0000 (14:49 -0700)]
s3: smbd: SMB2 - change smbd_dirptr_lanman2_entry() to return an NTSTATUS.

Handle the errors correctly at the top level inside the SMB2 server.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>