kamenim/samba-autobuild/.git
5 years agos3:smbd: use req->xconn in reply.c
Stefan Metzmacher [Wed, 11 Jun 2014 13:12:32 +0000 (15:12 +0200)]
s3:smbd: use req->xconn in reply.c

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to reply_readbraw_error()
Stefan Metzmacher [Wed, 11 Jun 2014 12:51:05 +0000 (14:51 +0200)]
s3:smbd: pass smbXsrv_connection to reply_readbraw_error()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to is_valid_writeX_buffer()
Stefan Metzmacher [Wed, 11 Jun 2014 12:35:55 +0000 (14:35 +0200)]
s3:smbd: pass smbXsrv_connection to is_valid_writeX_buffer()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: remove unused 'sconn' from valid_smb_header()
Stefan Metzmacher [Wed, 11 Jun 2014 12:29:52 +0000 (14:29 +0200)]
s3:smbd: remove unused 'sconn' from valid_smb_header()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: remove unused 'sconn' from is_encrypted_packet()
Stefan Metzmacher [Wed, 11 Jun 2014 12:28:13 +0000 (14:28 +0200)]
s3:smbd: remove unused 'sconn' from is_encrypted_packet()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use req->xconn in send_trans_reply()
Stefan Metzmacher [Wed, 11 Jun 2014 12:26:08 +0000 (14:26 +0200)]
s3:smbd: use req->xconn in send_trans_reply()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use req->xconn in files.c
Stefan Metzmacher [Wed, 11 Jun 2014 12:25:07 +0000 (14:25 +0200)]
s3:smbd: use req->xconn in files.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use req->xconn to send_trans2_replies()
Stefan Metzmacher [Wed, 11 Jun 2014 12:22:13 +0000 (14:22 +0200)]
s3:smbd: use req->xconn to send_trans2_replies()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: remove unused 'sconn' in call_trans2setfsinfo()
Stefan Metzmacher [Wed, 11 Jun 2014 11:57:30 +0000 (13:57 +0200)]
s3:smbd: remove unused 'sconn' in call_trans2setfsinfo()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use req->xconn in vfs_[p]write_data()
Stefan Metzmacher [Wed, 11 Jun 2014 11:54:43 +0000 (13:54 +0200)]
s3:smbd: use req->xconn in vfs_[p]write_data()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to smbd_do_qfsinfo()
Stefan Metzmacher [Wed, 11 Jun 2014 11:36:34 +0000 (13:36 +0200)]
s3:smbd: pass smbXsrv_connection to smbd_do_qfsinfo()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to reply_special()
Stefan Metzmacher [Wed, 11 Jun 2014 10:54:47 +0000 (12:54 +0200)]
s3:smbd: pass smbXsrv_connection to reply_special()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to get_challenge()
Stefan Metzmacher [Wed, 11 Jun 2014 10:42:56 +0000 (12:42 +0200)]
s3:smbd: pass smbXsrv_connection to get_challenge()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to negprot_spnego()
Stefan Metzmacher [Wed, 11 Jun 2014 10:41:26 +0000 (12:41 +0200)]
s3:smbd: pass smbXsrv_connection to negprot_spnego()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_negprot: remove NBT_HDR_SIZE from smbd_smb2_first_negprot()
Stefan Metzmacher [Tue, 24 Jun 2014 17:28:51 +0000 (19:28 +0200)]
s3:smb2_negprot: remove NBT_HDR_SIZE from smbd_smb2_first_negprot()

This will simplify future features like multi-channel and rdma.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: pass smbXsrv_connection to smbd_server_connection_terminate*()
Stefan Metzmacher [Wed, 11 Jun 2014 10:15:48 +0000 (12:15 +0200)]
s3:smb2_server: pass smbXsrv_connection to smbd_server_connection_terminate*()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_*: make use of smb2req->xconn where possible
Stefan Metzmacher [Thu, 12 Jun 2014 06:38:48 +0000 (08:38 +0200)]
s3:smb2_*: make use of smb2req->xconn where possible

We need to use the connection that is used by the current request.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: use req->xconn in is_smb2_recvfile_write()
Stefan Metzmacher [Wed, 11 Jun 2014 09:41:27 +0000 (11:41 +0200)]
s3:smb2_server: use req->xconn in is_smb2_recvfile_write()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: remove unused 'sconn' from smbd_smb2_send_break_state
Stefan Metzmacher [Wed, 11 Jun 2014 09:40:36 +0000 (11:40 +0200)]
s3:smb2_server: remove unused 'sconn' from smbd_smb2_send_break_state

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: use req->xconn in smbd_smb2_request_error_ex()
Stefan Metzmacher [Wed, 11 Jun 2014 09:40:04 +0000 (11:40 +0200)]
s3:smb2_server: use req->xconn in smbd_smb2_request_error_ex()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: use req->xconn in smbd_smb2_request_dispatch()
Stefan Metzmacher [Wed, 11 Jun 2014 09:31:37 +0000 (11:31 +0200)]
s3:smb2_server: use req->xconn in smbd_smb2_request_dispatch()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: use req->xconn in smbd_smb2_request_verify_creditcharge()
Stefan Metzmacher [Wed, 11 Jun 2014 09:31:04 +0000 (11:31 +0200)]
s3:smb2_server: use req->xconn in smbd_smb2_request_verify_creditcharge()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: use req->xconn in smbd_smb2_request_check_session()
Stefan Metzmacher [Wed, 11 Jun 2014 09:30:23 +0000 (11:30 +0200)]
s3:smb2_server: use req->xconn in smbd_smb2_request_check_session()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: use req->xconn in smbd_smb2_request_process_cancel()
Stefan Metzmacher [Wed, 11 Jun 2014 09:29:01 +0000 (11:29 +0200)]
s3:smb2_server: use req->xconn in smbd_smb2_request_process_cancel()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: remove unused 'sconn' from smbd_smb2_request_pending_state
Stefan Metzmacher [Wed, 11 Jun 2014 09:22:16 +0000 (11:22 +0200)]
s3:smb2_server: remove unused 'sconn' from smbd_smb2_request_pending_state

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: talloc smbd_smb2_request_pending_state on smbXsrv_connection
Stefan Metzmacher [Wed, 11 Jun 2014 09:22:16 +0000 (11:22 +0200)]
s3:smb2_server: talloc smbd_smb2_request_pending_state on smbXsrv_connection

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: use req->xconn in smbd_smb2_request_setup_out()
Stefan Metzmacher [Wed, 11 Jun 2014 09:19:24 +0000 (11:19 +0200)]
s3:smb2_server: use req->xconn in smbd_smb2_request_setup_out()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: pass smbXsrv_connection to smbd_smb2_request_next_incoming()
Stefan Metzmacher [Wed, 11 Jun 2014 08:59:00 +0000 (10:59 +0200)]
s3:smb2_server: pass smbXsrv_connection to smbd_smb2_request_next_incoming()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: pass smbXsrv_connection to smbd_smb2_request_create()
Stefan Metzmacher [Wed, 11 Jun 2014 08:51:04 +0000 (10:51 +0200)]
s3:smb2_server: pass smbXsrv_connection to smbd_smb2_request_create()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: pass smbXsrv_connection to smbd_initialize_smb2()
Stefan Metzmacher [Wed, 11 Jun 2014 08:45:56 +0000 (10:45 +0200)]
s3:smb2_server: pass smbXsrv_connection to smbd_initialize_smb2()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: pass smbXsrv_connection to smbd_smb2_first_negprot()
Stefan Metzmacher [Wed, 11 Jun 2014 08:42:01 +0000 (10:42 +0200)]
s3:smb2_server: pass smbXsrv_connection to smbd_smb2_first_negprot()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: pass smbXsrv_connection to smb2_set_operation_credit()
Stefan Metzmacher [Wed, 11 Jun 2014 08:08:26 +0000 (10:08 +0200)]
s3:smb2_server: pass smbXsrv_connection to smb2_set_operation_credit()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: pass smbXsrv_connection to smb2_validate_message_id()
Stefan Metzmacher [Wed, 11 Jun 2014 08:05:43 +0000 (10:05 +0200)]
s3:smb2_server: pass smbXsrv_connection to smb2_validate_message_id()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: pass smbXsrv_connection to smb2_validate_sequence_number()
Stefan Metzmacher [Wed, 11 Jun 2014 08:03:27 +0000 (10:03 +0200)]
s3:smb2_server: pass smbXsrv_connection to smb2_validate_sequence_number()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: pass smbXsrv_connection to smbd_smb2_flush_send_queue()
Stefan Metzmacher [Wed, 11 Jun 2014 08:00:09 +0000 (10:00 +0200)]
s3:smb2_server: pass smbXsrv_connection to smbd_smb2_flush_send_queue()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: rename 'conn' variables to 'xconn'
Stefan Metzmacher [Mon, 7 Jul 2014 10:25:48 +0000 (12:25 +0200)]
s3:smb2_server: rename 'conn' variables to 'xconn'

This makes the code more consistent with other functions
using 'struct smbXsrv_connection *xconn' as local variables.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: pass smbXsrv_connection to fd handlers
Stefan Metzmacher [Tue, 10 Jun 2014 18:20:58 +0000 (20:20 +0200)]
s3:smb2_server: pass smbXsrv_connection to fd handlers

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to fd handlers
Stefan Metzmacher [Tue, 10 Jun 2014 18:20:58 +0000 (20:20 +0200)]
s3:smbd: pass smbXsrv_connection to fd handlers

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to process_smb()
Stefan Metzmacher [Wed, 11 Jun 2014 08:40:42 +0000 (10:40 +0200)]
s3:smbd: pass smbXsrv_connection to process_smb()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: let construct_reply() also use smb_request_done()
Stefan Metzmacher [Wed, 11 Jun 2014 06:34:05 +0000 (08:34 +0200)]
s3:smbd: let construct_reply() also use smb_request_done()

This way it matches the code path in construct_reply_chain().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use smbXsrv_connection in switch_message()
Stefan Metzmacher [Wed, 11 Jun 2014 01:22:53 +0000 (03:22 +0200)]
s3:smbd: use smbXsrv_connection in switch_message()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to smbd_register_ips()
Stefan Metzmacher [Wed, 11 Jun 2014 01:06:00 +0000 (03:06 +0200)]
s3:smbd: pass smbXsrv_connection to smbd_register_ips()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: rename 'conn' to 'xconn' in exit_server_common()
Stefan Metzmacher [Tue, 10 Jun 2014 13:05:41 +0000 (15:05 +0200)]
s3:smbd: rename 'conn' to 'xconn' in exit_server_common()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: rename 'conn' to 'xconn' in smbd_process()
Stefan Metzmacher [Tue, 10 Jun 2014 13:05:41 +0000 (15:05 +0200)]
s3:smbd: rename 'conn' to 'xconn' in smbd_process()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: remember smbXsrv_connection for each smb_request
Stefan Metzmacher [Tue, 10 Jun 2014 11:34:55 +0000 (13:34 +0200)]
s3:smbd: remember smbXsrv_connection for each smb_request

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: remember smbXsrv_connection for each smbd_smb2_request
Stefan Metzmacher [Tue, 10 Jun 2014 11:34:55 +0000 (13:34 +0200)]
s3:smb2_server: remember smbXsrv_connection for each smbd_smb2_request

This prepares the structures for multi-channel support.
Each request needs to respond on the same connection,
where it arrived.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: talloc smbd_smb2_request as child of smbXsrv_connection
Stefan Metzmacher [Tue, 10 Jun 2014 11:34:55 +0000 (13:34 +0200)]
s3:smb2_server: talloc smbd_smb2_request as child of smbXsrv_connection

As the list of pending requests moved from sconn->smb2.requests to xconn->smb2.requests,
it is more logical to use smbXsrv_connection as talloc parent.

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: move sconn->smb2.requests to xconn->smb2.requests
Stefan Metzmacher [Tue, 10 Jun 2014 11:24:50 +0000 (13:24 +0200)]
s3:smb2_server: move sconn->smb2.requests to xconn->smb2.requests

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: move sconn->smb2.*credits* to xconn->smb2.credits.*
Stefan Metzmacher [Fri, 23 May 2014 10:10:23 +0000 (12:10 +0200)]
s3:smb2_server: move sconn->smb2.*credits* to xconn->smb2.credits.*

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_negprot: remove unused variable 'conn' we already have 'xconn'...
Stefan Metzmacher [Thu, 12 Jun 2014 06:36:08 +0000 (08:36 +0200)]
s3:smb2_negprot: remove unused variable 'conn' we already have 'xconn'...

We don't need two helper variables for the same thing.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: use xconn->smb2.server.max_* instead of sconn->smb2.max_*
Stefan Metzmacher [Fri, 23 May 2014 08:22:34 +0000 (10:22 +0200)]
s3:smb2_server: use xconn->smb2.server.max_* instead of sconn->smb2.max_*

We don't need this twice...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: move sconn->smb2.negprot_2ff to xconn->smb2.allow_2ff
Stefan Metzmacher [Fri, 23 May 2014 08:07:21 +0000 (10:07 +0200)]
s3:smb2_server: move sconn->smb2.negprot_2ff to xconn->smb2.allow_2ff

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: move sconn->smb2.send_queue* to xconn->smb2.send_queue*
Stefan Metzmacher [Fri, 23 May 2014 07:53:21 +0000 (09:53 +0200)]
s3:smb2_server: move sconn->smb2.send_queue* to xconn->smb2.send_queue*

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: move sconn->smb2.request_read_state to xconn->smb2.request_read_state
Stefan Metzmacher [Fri, 23 May 2014 07:41:57 +0000 (09:41 +0200)]
s3:smb2_server: move sconn->smb2.request_read_state to xconn->smb2.request_read_state

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: use xconn->transport.fde also for smb2
Stefan Metzmacher [Fri, 23 May 2014 07:36:24 +0000 (09:36 +0200)]
s3:smb2_server: use xconn->transport.fde also for smb2

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: move libasys state from smbXsrv_connection to smbd_server_connection
Stefan Metzmacher [Thu, 12 Jun 2014 06:32:47 +0000 (08:32 +0200)]
s3:smbd: move libasys state from smbXsrv_connection to smbd_server_connection

This doesn't belong to a connection, it's state used within the VFS stack.
And smbd_server_connection is the legacy structure we're using for
global VFS state.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: move xconn->msg_state to xconn->smb1.msg_state
Stefan Metzmacher [Wed, 11 Jun 2014 10:36:14 +0000 (12:36 +0200)]
s3:smbd: move xconn->msg_state to xconn->smb1.msg_state

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: move sconn->smb1.unix_info.* to xconn->smb1.unix_info.*
Stefan Metzmacher [Tue, 10 Jun 2014 10:57:38 +0000 (12:57 +0200)]
s3:smbd: move sconn->smb1.unix_info.* to xconn->smb1.unix_info.*

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: move sconn->smb1.echo_handler.* to xconn->smb1.echo_handler.*
Stefan Metzmacher [Fri, 23 May 2014 07:26:26 +0000 (09:26 +0200)]
s3:smbd: move sconn->smb1.echo_handler.* to xconn->smb1.echo_handler.*

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: move sconn->smb1.signing_state to xconn->smb1.signing_state
Stefan Metzmacher [Wed, 21 May 2014 12:44:01 +0000 (14:44 +0200)]
s3:smbd: move sconn->smb1.signing_state to xconn->smb1.signing_state

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: move sconn->smb1.sessions.* to xconn->smb1.sessions.*
Stefan Metzmacher [Wed, 21 May 2014 08:56:26 +0000 (10:56 +0200)]
s3:smbd: move sconn->smb1.sessions.* to xconn->smb1.sessions.*

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: move sconn->smb1.negprot.* to xconn->smb1.negprot.*
Stefan Metzmacher [Wed, 21 May 2014 08:27:50 +0000 (10:27 +0200)]
s3:smbd: move sconn->smb1.negprot.* to xconn->smb1.negprot.*

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: move sconn->status to xconn->transport.status
Stefan Metzmacher [Fri, 23 May 2014 07:07:47 +0000 (09:07 +0200)]
s3:smbd: move sconn->status to xconn->transport.status

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: move sconn->smb1.fde to xconn->transport.fde
Stefan Metzmacher [Fri, 23 May 2014 06:45:01 +0000 (08:45 +0200)]
s3:smbd: move sconn->smb1.fde to xconn->transport.fde

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: move sconn->sock to xconn->transport.sock
Stefan Metzmacher [Wed, 21 May 2014 21:23:34 +0000 (23:23 +0200)]
s3:smbd: move sconn->sock to xconn->transport.sock

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: move sconn->nbt.* to xconn->transport.nbt.*
Stefan Metzmacher [Tue, 20 May 2014 17:59:12 +0000 (19:59 +0200)]
s3:smbd: move sconn->nbt.* to xconn->transport.nbt.*

This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: avoid get_peer_addr() and use smbXsrv_connection_dbg()
Stefan Metzmacher [Fri, 23 May 2014 10:59:43 +0000 (12:59 +0200)]
s3:smbd: avoid get_peer_addr() and use smbXsrv_connection_dbg()

There's no need to do syscalls, if we already have the information
in userspace.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: add smbXsrv_connection_dbg()
Stefan Metzmacher [Mon, 21 Jul 2014 16:58:52 +0000 (18:58 +0200)]
s3:smbd: add smbXsrv_connection_dbg()

This is similar to fsp_fnum_dbg() and fsp_str_dbg().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolocking: posix_lock_list does not use "fsp"
Volker Lendecke [Sun, 3 Aug 2014 14:28:50 +0000 (16:28 +0200)]
locking: posix_lock_list does not use "fsp"

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 Aug  6 03:27:36 CEST 2014 on sn-devel-104

5 years agolocking: Avoid a pointless cast
Volker Lendecke [Sun, 3 Aug 2014 09:51:40 +0000 (11:51 +0200)]
locking: Avoid a pointless cast

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolib: strings: Simplify strcasecmp
Volker Lendecke [Tue, 5 Aug 2014 09:21:07 +0000 (09:21 +0000)]
lib: strings: Simplify strcasecmp

This makes us fallback to strcasecmp early if any INVALID_CODEPOINT
appears. Without this patch we just continue to compare if both strings
happen to have an INVALID_CODEPOINT in the same spot.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos4: tests: Added local.charset test for Bug 10716 - smbd constantly crashes when...
Jeremy Allison [Mon, 4 Aug 2014 20:36:42 +0000 (13:36 -0700)]
s4: tests: Added local.charset test for Bug 10716 - smbd constantly crashes when filename contains non-ascii character

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

Signed-off-by: Jeremy Allison <jra@samba.org>
5 years agolib: strings: Fix the behavior of strncasecmp_m_handle() in the face of bad conversions.
Jeremy Allison [Sat, 2 Aug 2014 04:38:59 +0000 (21:38 -0700)]
lib: strings: Fix the behavior of strncasecmp_m_handle() in the face of bad conversions.

When either string has a bad conversion, we fall back to
doing raw ascii byte comparisons using strcasecmp(). This
is wrong - we should fall back to strncasecmp.

The problem is we've already stepped past the character
that failed the conversion, so we're not re-testing those
characters for comparison. This can have the effect of
causing strncasecmp_m_handle() to report that two strings
are identical when they are not, if the failed conversion
takes place at the end of the string.

The correct behavior is to step back to the point of
the string(s) that failed the conversion, and continue
the test from there.

This is a litle trickier than the previous fix, as
it requires converting the incoming n variable from
remaining characters to compare to remaining bytes to
compare.

As bytes are always the smallest character size
(1 byte) then it's safe to convert the remaining
characters to check by decrementing the source string
by the last character length (in bytes) and incrementing
the remaining bytes to scan by the same value, then
calling strncasecmp() with the stepped back strings
remaining.

Signed-off-by: Jeremy Allison <jra@samba.org>
5 years agolib: strings: Fix the behavior of strcasecmp_m_handle() in the face of bad conversions.
Jeremy Allison [Sat, 2 Aug 2014 04:29:21 +0000 (21:29 -0700)]
lib: strings: Fix the behavior of strcasecmp_m_handle() in the face of bad conversions.

When either string has a bad conversion, we fall back to
doing raw ascii byte comparisons using strcasecmp().

The problem is we've already stepped past the character
that failed the conversion, so we're not re-testing those
characters for comparison. This can have the effect of
causing strcasecmp_m_handle() to report that two strings
are identical when they are not, if the failed conversion
takes place at the end of the string.

The correct behavior is to step back to the point of
the string(s) that failed the conversion, and continue
the test from there.

Found by <lev@zadarastorage.com> when investigating bug
10716 - smbd constantly crashes when filename contains non-ascii character.

Given the normal character set of utf-8, and an on
disk filename of ISO-8859-1 of file-é on disk hex
value: 66 69 6c 65 2d e9, an incoming open given the
correct utf8 name of file-é will collide when it
should not.

Fixes:

Bug 10716 - smbd constantly crashes when filename contains non-ascii character

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

Signed-off-by: Jeremy Allison <jra@samba.org>
5 years agoctdb-locking: Add per database queues for pending and active lock requests
Amitay Isaacs [Thu, 24 Jul 2014 05:56:41 +0000 (15:56 +1000)]
ctdb-locking: Add per database queues for pending and active lock requests

This avoids traversing a single pending queue which is quite expensive
when there are lots of pending lock requests.  This seems to happen
quite a lot on a loaded cluster for notify_index.tdb.

Adding per database queues avoids the need to traverse pending queue
for that database if there are already the maximum number of active
lock requests.

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): Mon Aug  4 20:23:45 CEST 2014 on sn-devel-104

5 years agoctdb-locking: Update a comment
Amitay Isaacs [Wed, 23 Jul 2014 02:52:03 +0000 (12:52 +1000)]
ctdb-locking: Update a comment

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoctdb-locking: Simplify check for locks on record or database
Amitay Isaacs [Tue, 15 Jul 2014 04:49:44 +0000 (14:49 +1000)]
ctdb-locking: Simplify check for locks on record or database

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoctdb-locking: Decrement pending statistics when lock is scheduled
Amitay Isaacs [Tue, 15 Jul 2014 04:38:52 +0000 (14:38 +1000)]
ctdb-locking: Decrement pending statistics when lock is scheduled

and not when the lock is obtained.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoctdb-locking: Update ctdb statistics for all lock types
Amitay Isaacs [Tue, 15 Jul 2014 04:38:12 +0000 (14:38 +1000)]
ctdb-locking: Update ctdb statistics for all lock types

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoctdb-locking: Add DB lock requests to head of the pending queue
Amitay Isaacs [Tue, 15 Jul 2014 04:13:25 +0000 (14:13 +1000)]
ctdb-locking: Add DB lock requests to head of the pending queue

This allows to schedule DB locks quickly without having to scan through
the pending lock requests.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoctdb-locking: Remove unused variable lock_num_pending
Amitay Isaacs [Tue, 15 Jul 2014 02:59:57 +0000 (12:59 +1000)]
ctdb-locking: Remove unused variable lock_num_pending

The number of pending locks displayed in ctdb statistics are stored in
ctdb_statistics structure and not ctdb_context.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoctdb-locking: Increase number of lock processes per database to 200
Amitay Isaacs [Tue, 15 Jul 2014 06:41:31 +0000 (16:41 +1000)]
ctdb-locking: Increase number of lock processes per database to 200

This was the original limit in the older versions of CTDB.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoctdb-locking: Add new tunable LockProcessesPerDB
Amitay Isaacs [Tue, 15 Jul 2014 02:13:53 +0000 (12:13 +1000)]
ctdb-locking: Add new tunable LockProcessesPerDB

This allows to change the maximum number of lock processes that can
be active.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoctdb-locking: Allocate lock request soon after allocating lock context
Amitay Isaacs [Fri, 30 May 2014 05:49:46 +0000 (15:49 +1000)]
ctdb-locking: Allocate lock request soon after allocating lock context

This avoids extra work in case lock request allocation fails.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoctdb-locking: Remove unused function find_lock_context()
Amitay Isaacs [Tue, 15 Jul 2014 04:44:55 +0000 (14:44 +1000)]
ctdb-locking: Remove unused function find_lock_context()

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoctdb-locking: Schedule the next possible lock based on per-db limit
Amitay Isaacs [Thu, 29 May 2014 07:27:32 +0000 (17:27 +1000)]
ctdb-locking: Schedule the next possible lock based on per-db limit

This prevents searching through active lock requests for every pending
lock request to check if the pending lock request can be scheduled or not.
The locks are scheduled in strict first-in-first-out order.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoctdb-locking: Remove multiple lock requests per lock context (part 2)
Amitay Isaacs [Fri, 30 May 2014 05:36:03 +0000 (15:36 +1000)]
ctdb-locking: Remove multiple lock requests per lock context (part 2)

Store only a single request instead of storing a queue in lock context.
Lock request structure does not need to be a linked list any more.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoctdb-locking: Remove multiple lock requests per lock context (part 1)
Amitay Isaacs [Fri, 30 May 2014 05:36:28 +0000 (15:36 +1000)]
ctdb-locking: Remove multiple lock requests per lock context (part 1)

This was a bad idea and caused out of order scheduling of lock requests.

The logic to append lock requests to existing lock context is already
commented.  Remove the commented code and there is no need to check if
lock_ctx is NULL, since we are always creating a new one.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoctdb-locking: Remove unused structure members
Amitay Isaacs [Fri, 30 May 2014 03:57:44 +0000 (13:57 +1000)]
ctdb-locking: Remove unused structure members

block_child was used to keep track of a process which was created to debug
why a lock process has blocked.  That logic was replaced to execute an
external debug script.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoctdb-locking: Fix the lock_type_str corresponding to LOCK_ALLDB
Amitay Isaacs [Fri, 30 May 2014 03:48:45 +0000 (13:48 +1000)]
ctdb-locking: Fix the lock_type_str corresponding to LOCK_ALLDB

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoselftest: Improve check to detect if nmbd is working.
Andreas Schneider [Fri, 25 Jul 2014 14:45:29 +0000 (16:45 +0200)]
selftest: Improve check to detect if nmbd is working.

With this change you mostly have to wait only for one second till the
tests get executed instead of ten seconds.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Aug  4 17:58:58 CEST 2014 on sn-devel-104

5 years agoselftest: Use the actual name of the nmblookup binary.
Andreas Schneider [Fri, 25 Jul 2014 14:35:25 +0000 (16:35 +0200)]
selftest: Use the actual name of the nmblookup binary.

nmblookup3 is just a binary mapping. We shouldn't use the mapping
anymore.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolib: Remove unused nstrcpy
Volker Lendecke [Mon, 4 Aug 2014 05:29:14 +0000 (07:29 +0200)]
lib: Remove unused nstrcpy

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Aug  4 09:58:16 CEST 2014 on sn-devel-104

5 years agolib: Make DEBUG a subsystem of its own
Volker Lendecke [Wed, 30 Jul 2014 14:12:54 +0000 (14:12 +0000)]
lib: Make DEBUG a subsystem of its own

In the future this might become a library, but even with the SUBSYSTEM
it should be clear what debug.c depends upon.

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): Sat Aug  2 00:36:50 CEST 2014 on sn-devel-104

5 years agolib: Make close_low_fd() independently linkable
Volker Lendecke [Thu, 31 Jul 2014 09:40:04 +0000 (09:40 +0000)]
lib: Make close_low_fd() independently linkable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodebug: Use close_low_fd in reopen_logs_internal
Volker Lendecke [Tue, 29 Jul 2014 18:43:05 +0000 (20:43 +0200)]
debug: Use close_low_fd in reopen_logs_internal

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolib: Use close_low_fd in close_low_fds
Volker Lendecke [Tue, 29 Jul 2014 18:42:18 +0000 (20:42 +0200)]
lib: Use close_low_fd in close_low_fds

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>