palcantara/samba-autobuild/.git
2 years agotevent:tests: Test queue entry tags tevent-0.12.0
Pavel Filipenský [Wed, 16 Mar 2022 08:11:25 +0000 (09:11 +0100)]
tevent:tests: Test queue entry tags

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Apr 11 17:51:08 UTC 2022 on sn-devel-184

2 years agotevent: Add tevent queue tracing support
Pavel Filipenský [Mon, 14 Mar 2022 10:22:15 +0000 (11:22 +0100)]
tevent: Add tevent queue tracing support

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agotevent: Use internally an empty trigger function for blocker requests
Pavel Filipenský [Wed, 23 Mar 2022 13:50:57 +0000 (14:50 +0100)]
tevent: Use internally an empty trigger function for blocker requests

This avoids special magic, but keeps the same external behavior.

It makes the following changes easier to understand.

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agotevent: Move the code below the trigger check
Pavel Filipenský [Wed, 30 Mar 2022 13:59:51 +0000 (15:59 +0200)]
tevent: Move the code below the trigger check

This makes the next commit smaller.

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agotevent: Fix trailing whitespaces
Pavel Filipenský [Mon, 14 Mar 2022 10:16:58 +0000 (11:16 +0100)]
tevent: Fix trailing whitespaces

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoexamples: Update winbindd.stp and generate script
Samuel Cabrero [Thu, 31 Mar 2022 10:34:29 +0000 (12:34 +0200)]
examples: Update winbindd.stp and generate script

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr  8 21:06:01 UTC 2022 on sn-devel-184

2 years agos3:winbind: Convert PamAuth from struct based to NDR based
Samuel Cabrero [Mon, 14 Jun 2021 17:13:48 +0000 (19:13 +0200)]
s3:winbind: Convert PamAuth from struct based to NDR based

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Set local and remote addresses in the crafted dcesrv_conn
Samuel Cabrero [Thu, 17 Feb 2022 11:29:12 +0000 (12:29 +0100)]
s3:winbind: Set local and remote addresses in the crafted dcesrv_conn

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Make extra_data_to_sid_array() public
Samuel Cabrero [Mon, 14 Jun 2021 16:05:34 +0000 (18:05 +0200)]
s3:winbind: Make extra_data_to_sid_array() public

Later winbindd_dual_pam_auth() will be converted to a local RPC call
handler and the parent will call this function to fill the 'r' struct.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Refactor log_authentication(), do not take winbindd_cli_state struct...
Samuel Cabrero [Wed, 30 Mar 2022 18:55:12 +0000 (20:55 +0200)]
s3:winbind: Refactor log_authentication(), do not take winbindd_cli_state struct parameter

Later winbindd_dual_pam_auth() will be converted to a local RPC call
handler and it will not receive a winbindd_cli_state parameter. Avoid
passing this struct around.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Refactor fake_password_policy(), take netr_Validation as argument
Samuel Cabrero [Mon, 14 Jun 2021 16:08:21 +0000 (18:08 +0200)]
s3:winbind: Refactor fake_password_policy(), take netr_Validation as argument

Later winbindd_dual_pam_auth() will be converted to a local RPC call
handler and it will return a netr_Validation from the child. This
function will be moved to the parent to fill the winbindd_response
struct.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Refactor winbindd_dual_pam_auth_cached(), return netr_Validation
Samuel Cabrero [Thu, 10 Jun 2021 14:50:06 +0000 (16:50 +0200)]
s3:winbind: Refactor winbindd_dual_pam_auth_cached(), return netr_Validation

Map netr_SamInfo3 to netr_Validation in this function instead of doing
it in the caller.

Later winbindd_dual_pam_auth() will be converted to a local RPC
handler and it will return the netr_Validation in the 'r' struct.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Refactor winbindd_dual_pam_auth_cached(), avoid winbindd_cli_state parameter
Samuel Cabrero [Thu, 10 Jun 2021 14:45:10 +0000 (16:45 +0200)]
s3:winbind: Refactor winbindd_dual_pam_auth_cached(), avoid winbindd_cli_state parameter

Later winbindd_dual_pam_auth() will be converted to a local RPC
handler and it will not receive a winbindd_cli_state struct as parameter.
Avoid passing around this struct.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Refactor winbindd_dual_pam_auth_cached(), return krb5ccname as out parameter
Samuel Cabrero [Thu, 10 Jun 2021 14:15:13 +0000 (16:15 +0200)]
s3:winbind: Refactor winbindd_dual_pam_auth_cached(), return krb5ccname as out parameter

Later winbindd_dual_pam_auth() will be converted to a local RPC
handler and it will not receive a winbindd_cli_state struct as parameter.
Avoid passing around this struct.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Refactor winbindd_dual_pam_auth_cached(), delay out variable assignment
Samuel Cabrero [Wed, 30 Mar 2022 16:12:46 +0000 (18:12 +0200)]
s3:winbind: Refactor winbindd_dual_pam_auth_cached(), delay out variable assignment

Delay the assignment of the out varible and assign it only if
returning NT_STATUS_OK, the caller does not use the returned
netr_SamInfo3 if the function does not return NT_STATUS_OK.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Refactor winbindd_dual_pam_auth_cached(), use temporary memory context
Samuel Cabrero [Thu, 10 Jun 2021 14:34:56 +0000 (16:34 +0200)]
s3:winbind: Refactor winbindd_dual_pam_auth_cached(), use temporary memory context

This function allocates a lot of intermedite variables, use a temporary
memory context.

The out variable info3 is assigned using talloc_steal() because the
local my_info3 is used below.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Refactor winbindd_dual_pam_auth_kerberos(), return netr_Validation
Samuel Cabrero [Mon, 14 Jun 2021 16:39:02 +0000 (18:39 +0200)]
s3:winbind: Refactor winbindd_dual_pam_auth_kerberos(), return netr_Validation

Map netr_SamInfo6 to netr_Validation in winbindd_dual_pam_auth_kerberos()
instead of doing it in the caller.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Refactor winbindd_dual_pam_auth_kerberos(), do not take winbindd_cli_stat...
Samuel Cabrero [Thu, 10 Jun 2021 12:03:43 +0000 (14:03 +0200)]
s3:winbind: Refactor winbindd_dual_pam_auth_kerberos(), do not take winbindd_cli_state struct parameter

Refactor winbindd_dual_pam_auth_kerberos() to do not take a
winbindd_cli_state struct as parameter but its members. The kerberos
ccache name is returned as an out parameter and the caller is
responsible for copying it in the winbindd_response struct.

Later winbindd_dual_pam_auth() will be converted to a local RPC call
handler and it will not receive a winbindd_cli_state as argument so
reduce passing this struct around.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Refactor append_afs_token(), do not take winbindd_response struct as...
Samuel Cabrero [Thu, 10 Jun 2021 11:23:23 +0000 (13:23 +0200)]
s3:winbind: Refactor append_afs_token(), do not take winbindd_response struct as parameter

Refactor the append_afs_token() function to do not take a
winbindd_response as a parameter but its members directly. The AFS token
is returned as an out parameter in a DATA_BLOB, and the caller is
responsible for setting it the extra_data winbindd_response field and
extending the winbindd_response length.

Later winbindd_dual_pam_auth() will be converted to a local RPC
call handler and the netr_Validation will be returned in the 'r' struct
from the child to the parent. The parent will then fill the
winbindd_response struct.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Refactor append_unix_username(), do not take winbindd_response struct...
Samuel Cabrero [Thu, 10 Jun 2021 11:18:54 +0000 (13:18 +0200)]
s3:winbind: Refactor append_unix_username(), do not take winbindd_response struct as parameter

Refactor the append_unix_username() function to do not take a
winbindd_response struct as parameter but its members. The
unix username is returned as an out parameter and the caller is
responsible for setting it in the winbindd_response struct.

Later winbindd_dual_pam_auth() will be converted to a local RPC
call handler and the netr_Validation will be returned in the 'r' struct
from the child to the parent. The parent will then fill the
winbindd_response struct.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoselftest: Add a test for PamLogOff
Samuel Cabrero [Fri, 18 Jun 2021 07:22:39 +0000 (09:22 +0200)]
selftest: Add a test for PamLogOff

This test also verifies the KRB5CCNAME environment variable is set after
a successful PAM authentication with Kerberos.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoselftest: Extend test_wbc_logon_user to test WBFLAG_PAM_UNIX_NAME flag
Samuel Cabrero [Wed, 30 Mar 2022 09:46:08 +0000 (11:46 +0200)]
selftest: Extend test_wbc_logon_user to test WBFLAG_PAM_UNIX_NAME flag

Use the same function append_unix_username() uses to build the expected
value as it depends on the server role. This requires linking
winbindd-lib.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos4:rpc_server: Fix duplicated function name between s3 and s4
Samuel Cabrero [Thu, 31 Mar 2022 10:32:08 +0000 (12:32 +0200)]
s4:rpc_server: Fix duplicated function name between s3 and s4

It can lead to link errors:

/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: source3/rpc_server/rpc_server.c.24.o: in function `dcesrv_transport_terminate_connection':
/home/scabrero/workspace/samba/samba/bin/default/../../source3/rpc_server/rpc_server.c:242: multiple definition of `dcesrv_transport_terminate_connection'; source4/rpc_server/dcerpc_server.c.5.o:/home/scabrero/workspace/samba/samba/bin/default/../../source4/rpc_server/dcerpc_server.c:710: first defined here

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos4:rpc_server: Fix duplicated function name between s3 and s4
Samuel Cabrero [Thu, 31 Mar 2022 10:29:14 +0000 (12:29 +0200)]
s4:rpc_server: Fix duplicated function name between s3 and s4

It can lead to link errors:

/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: source3/rpc_server/rpc_server.c.24.o: in function `dcesrv_assoc_group_find':
/home/scabrero/workspace/samba/samba/bin/default/../../source3/rpc_server/rpc_server.c:229: multiple definition of `dcesrv_assoc_group_find'; source4/rpc_server/dcerpc_server.c.5.o:/home/scabrero/workspace/samba/samba/bin/default/../../source4/rpc_server/dcerpc_server.c:121: first defined here

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Refactor check_info3_in_group() to take a wbint_SidArray struct
Samuel Cabrero [Thu, 10 Jun 2021 10:02:08 +0000 (12:02 +0200)]
s3:winbind: Refactor check_info3_in_group() to take a wbint_SidArray struct

Refactor the check_info3_in_group() function to take a wbint_SidArray
struct. The sid strings stored in extra_data are parsed into a
wbint_SidArray in a separated function.

Later, winbindd_dual_pam_auth() will be converted to a local RPC
call handler and the wbint_SidArray containing the required membership
will be part of the 'r' struct.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Move sighup handling related functions to winbindd-lib subsystem
Samuel Cabrero [Wed, 2 Mar 2022 17:44:07 +0000 (18:44 +0100)]
s3:winbind: Move sighup handling related functions to winbindd-lib subsystem

The source3/winbindd/winbindd.c file does not belong to 'winbindd-lib'
subsystem. Funtions called from winbindd-lib must be part of it.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Move sigterm handling functions to winbindd-lib subsystem
Samuel Cabrero [Wed, 2 Mar 2022 17:30:19 +0000 (18:30 +0100)]
s3:winbind: Move sigterm handling functions to winbindd-lib subsystem

The source3/winbindd/winbindd.c file does not belong to 'winbindd-lib'
subsystem. Funtions called from winbindd-lib must be part of it.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Rename terminate() function to winbindd_terminate()
Samuel Cabrero [Wed, 2 Mar 2022 17:21:09 +0000 (18:21 +0100)]
s3:winbind: Rename terminate() function to winbindd_terminate()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Move servide reload related functions to winbindd-lib subsystem
Samuel Cabrero [Wed, 2 Mar 2022 17:16:51 +0000 (18:16 +0100)]
s3:winbind: Move servide reload related functions to winbindd-lib subsystem

The source3/winbindd/winbindd.c file does not belong to 'winbindd-lib'
subsystem. Funtions called from winbindd-lib must be part of it.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Move function to flush cache to winbindd-lib subsystem
Samuel Cabrero [Wed, 2 Mar 2022 17:13:15 +0000 (18:13 +0100)]
s3:winbind: Move function to flush cache to winbindd-lib subsystem

The source3/winbindd/winbindd.c file does not belong to 'winbindd-lib'
subsystem. Funtions called from winbindd-lib must be part of it.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Move the function to get the privileged pipe dir to winbindd-lib subsystem
Samuel Cabrero [Wed, 2 Mar 2022 17:03:34 +0000 (18:03 +0100)]
s3:winbind: Move the function to get the privileged pipe dir to winbindd-lib subsystem

The source3/winbindd/winbindd.c file does not belong to 'winbindd-lib'
subsystem. Funtions called from winbindd-lib must be part of it.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Move imessaging context init function to winbindd-lib subsystem
Samuel Cabrero [Wed, 2 Mar 2022 17:00:56 +0000 (18:00 +0100)]
s3:winbind: Move imessaging context init function to winbindd-lib subsystem

The source3/winbindd/winbindd.c file does not belong to 'winbindd-lib'
subsystem. Funtions called from winbindd-lib must be part of it.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:winbind: Move functions to enable or disable cache to winbindd-lib subsystem
Samuel Cabrero [Wed, 2 Mar 2022 16:54:54 +0000 (17:54 +0100)]
s3:winbind: Move functions to enable or disable cache to winbindd-lib subsystem

The source3/winbindd/winbindd.c file does not belong to 'winbindd-lib'
subsystem. Funtions called from winbindd-lib must be part of it.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoWHATSNEW.txt: Add explaination of --without-smb1-server and --with-smb1-server config...
Jeremy Allison [Tue, 5 Apr 2022 17:32:20 +0000 (10:32 -0700)]
WHATSNEW.txt: Add explaination of --without-smb1-server and --with-smb1-server configure options.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr  7 18:33:31 UTC 2022 on sn-devel-184

2 years agoci: Create samba-fileserver-without-smb1 environment
David Mulder [Thu, 3 Mar 2022 21:07:50 +0000 (14:07 -0700)]
ci: Create samba-fileserver-without-smb1 environment

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoconfigure: Fail smbd w/o smb1 if selftest when configured with ad_dc
David Mulder [Wed, 6 Apr 2022 18:55:01 +0000 (12:55 -0600)]
configure: Fail smbd w/o smb1 if selftest when configured with ad_dc

When we build with samba selftest and ad_dc, we must
include smb1 in smbd.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoconfigure: Add option for disabling the smb1 server
David Mulder [Mon, 7 Mar 2022 17:10:14 +0000 (10:10 -0700)]
configure: Add option for disabling the smb1 server

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3: smbd: Rename init_smb_request() -> init_smb1_request().
Jeremy Allison [Tue, 5 Apr 2022 02:55:39 +0000 (19:55 -0700)]
s3: smbd: Rename init_smb_request() -> init_smb1_request().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
2 years agos3: smbd: Rename reply_outbuf() -> reply_smb1_outbuf().
Jeremy Allison [Tue, 5 Apr 2022 02:53:20 +0000 (19:53 -0700)]
s3: smbd: Rename reply_outbuf() -> reply_smb1_outbuf().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
2 years agos3: smbd: Rename create_outbuf() -> create_smb1_outbuf()
Jeremy Allison [Tue, 5 Apr 2022 01:45:44 +0000 (18:45 -0700)]
s3: smbd: Rename create_outbuf() -> create_smb1_outbuf()

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
2 years agos3: smbd: Rename construct_reply_common_req() -> construct_smb1_reply_common_req()
Jeremy Allison [Tue, 5 Apr 2022 01:43:54 +0000 (18:43 -0700)]
s3: smbd: Rename construct_reply_common_req() -> construct_smb1_reply_common_req()

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
2 years agos3: smbd: Rename construct_reply_common() -> construct_smb1_reply_common().
Jeremy Allison [Tue, 5 Apr 2022 01:42:02 +0000 (18:42 -0700)]
s3: smbd: Rename construct_reply_common() -> construct_smb1_reply_common().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
2 years agos3: smbd: Rename srv_set_message() -> srv_smb1_set_message().
Jeremy Allison [Tue, 5 Apr 2022 01:40:11 +0000 (18:40 -0700)]
s3: smbd: Rename srv_set_message() -> srv_smb1_set_message().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
2 years agos3: smbd: Rename valid_smb_header() -> valid_smb1_header()
Jeremy Allison [Tue, 5 Apr 2022 01:35:16 +0000 (18:35 -0700)]
s3: smbd: Rename valid_smb_header() -> valid_smb1_header()

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
2 years agosmbd: Remove srv_send_smb
David Mulder [Thu, 31 Mar 2022 19:09:57 +0000 (13:09 -0600)]
smbd: Remove srv_send_smb

Signed-off-by: David Mulder <dmulder@suse.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Remove uses of srv_send_smb
David Mulder [Thu, 31 Mar 2022 19:09:13 +0000 (13:09 -0600)]
smbd: Remove uses of srv_send_smb

Replace them with direct calls to smb1_srv_send
and smb2_srv_send.

Signed-off-by: David Mulder <dmulder@suse.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move reply_pipe_write to smb1_pipes.c
David Mulder [Thu, 31 Mar 2022 17:37:25 +0000 (11:37 -0600)]
smbd: Move reply_pipe_write to smb1_pipes.c

Signed-off-by: David Mulder <dmulder@suse.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Process error reply if SMB1 negprot parsing fails
David Mulder [Wed, 30 Mar 2022 08:57:21 +0000 (02:57 -0600)]
smbd: Process error reply if SMB1 negprot parsing fails

Signed-off-by: David Mulder <dmulder@suse.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Enable multi-protocol negotiate w/out SMB1
David Mulder [Wed, 23 Mar 2022 12:43:40 +0000 (06:43 -0600)]
smbd: Enable multi-protocol negotiate w/out SMB1

This enables the multi-protocol negotiate when
the SMB1 build is disabled. It requires enabling
parts of the SMB1 negotiation.

Signed-off-by: David Mulder <dmulder@suse.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move init_smb_request to smb2_process.c
David Mulder [Fri, 25 Mar 2022 20:08:18 +0000 (14:08 -0600)]
smbd: Move init_smb_request to smb2_process.c

init_smb_request is needed for a multi-protocol
negotiation.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move valid_smb_header to smb2_process.c
David Mulder [Fri, 25 Mar 2022 19:59:14 +0000 (13:59 -0600)]
smbd: Move valid_smb_header to smb2_process.c

valid_smb_header is needed for a multi-protocol
negotiation.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Disable use of smb_fn_name when SMB1 is disabled
David Mulder [Mon, 21 Mar 2022 20:23:15 +0000 (14:23 -0600)]
smbd: Disable use of smb_fn_name when SMB1 is disabled

perfcount_test.c was using the smb_fn_name
function, which doesn't exist when SMB1 is
disabled.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Remove duplicate read_nttrans_ea_list function prototype
David Mulder [Mon, 21 Mar 2022 20:18:58 +0000 (14:18 -0600)]
smbd: Remove duplicate read_nttrans_ea_list function prototype

Because this stray prototype was mixed in with
the smb1 code, it caused the smb2-only build to
fail. Instead of duplicating the function
prototype, lets just include the correct header.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Disable SMB_SET_POSIX_LOCK when SMB1 is disabled
David Mulder [Mon, 21 Mar 2022 20:11:04 +0000 (14:11 -0600)]
smbd: Disable SMB_SET_POSIX_LOCK when SMB1 is disabled

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Disable SMB_QUERY_CIFS_UNIX_INFO when SMB1 is disable
David Mulder [Mon, 21 Mar 2022 20:10:24 +0000 (14:10 -0600)]
smbd: Disable SMB_QUERY_CIFS_UNIX_INFO when SMB1 is disable

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Disable use of smb_fn_name without SMB1 in error.c
David Mulder [Mon, 21 Mar 2022 19:50:08 +0000 (13:50 -0600)]
smbd: Disable use of smb_fn_name without SMB1 in error.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agotorture: Disable vfs chain test dependant on SMB1
David Mulder [Thu, 10 Mar 2022 21:54:35 +0000 (14:54 -0700)]
torture: Disable vfs chain test dependant on SMB1

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move trans2.c -> smb2_trans2.c
David Mulder [Mon, 21 Mar 2022 19:26:09 +0000 (13:26 -0600)]
smbd: Move trans2.c -> smb2_trans2.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3: smbd: Move reply_findnclose() from trans2.c to smb1_reply.c
Jeremy Allison [Tue, 5 Apr 2022 02:50:58 +0000 (19:50 -0700)]
s3: smbd: Move reply_findnclose() from trans2.c to smb1_reply.c

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
2 years agos3: smbd: Move reply_findclose() from trans2.c to smb1_reply.c
Jeremy Allison [Tue, 5 Apr 2022 02:48:25 +0000 (19:48 -0700)]
s3: smbd: Move reply_findclose() from trans2.c to smb1_reply.c

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
2 years agosmbd: Move reply_transs2 to smb1_trans2.c
David Mulder [Mon, 21 Mar 2022 19:15:19 +0000 (13:15 -0600)]
smbd: Move reply_transs2 to smb1_trans2.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move reply_trans2 to smb1_trans2.c
David Mulder [Mon, 21 Mar 2022 18:29:26 +0000 (12:29 -0600)]
smbd: Move reply_trans2 to smb1_trans2.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move smb_set_posix_lock to smb1_trans2.c
David Mulder [Mon, 21 Mar 2022 17:59:15 +0000 (11:59 -0600)]
smbd: Move smb_set_posix_lock to smb1_trans2.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move send_trans2_replies to smb1_trans2.c
David Mulder [Mon, 21 Mar 2022 17:51:41 +0000 (11:51 -0600)]
smbd: Move send_trans2_replies to smb1_trans2.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move smb1_utils.h include to smbd.h
David Mulder [Mon, 21 Mar 2022 15:56:04 +0000 (09:56 -0600)]
smbd: Move smb1_utils.h include to smbd.h

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move process.c -> smb1_process.c
David Mulder [Mon, 21 Mar 2022 14:30:48 +0000 (08:30 -0600)]
smbd: Move process.c -> smb1_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move smbd_process to smb2_process.c
David Mulder [Mon, 21 Mar 2022 14:05:15 +0000 (08:05 -0600)]
smbd: Move smbd_process to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Disable smb1 in smbd_process
David Mulder [Fri, 18 Mar 2022 21:44:10 +0000 (15:44 -0600)]
smbd: Disable smb1 in smbd_process

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move smbd_add_connection to smb2_process.c
David Mulder [Fri, 18 Mar 2022 21:37:17 +0000 (15:37 -0600)]
smbd: Move smbd_add_connection to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Disable smb1 in smbd_smb2_server_connection_read_handler
David Mulder [Fri, 18 Mar 2022 21:29:56 +0000 (15:29 -0600)]
smbd: Disable smb1 in smbd_smb2_server_connection_read_handler

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Disable smb1 in smbd_server_connection_handler
David Mulder [Fri, 18 Mar 2022 21:26:27 +0000 (15:26 -0600)]
smbd: Disable smb1 in smbd_server_connection_handler

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Disable smb1 in smbd_add_connection
David Mulder [Fri, 18 Mar 2022 21:17:39 +0000 (15:17 -0600)]
smbd: Disable smb1 in smbd_add_connection

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move smbXsrv_connection_dbg to smb2_process.c
David Mulder [Fri, 18 Mar 2022 21:13:25 +0000 (15:13 -0600)]
smbd: Move smbXsrv_connection_dbg to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move smbXsrv_connection_init_tables to smb2_process.c
David Mulder [Fri, 18 Mar 2022 21:10:01 +0000 (15:10 -0600)]
smbd: Move smbXsrv_connection_init_tables to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Disable smb1 in smbXsrv_connection_init_tables
David Mulder [Fri, 18 Mar 2022 21:05:27 +0000 (15:05 -0600)]
smbd: Disable smb1 in smbXsrv_connection_init_tables

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move process_smb to smb2_process.c
David Mulder [Fri, 18 Mar 2022 20:53:19 +0000 (14:53 -0600)]
smbd: Move process_smb to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move reply_outbuf and construct_reply_common_req to smb2_process.c
David Mulder [Fri, 18 Mar 2022 20:45:09 +0000 (14:45 -0600)]
smbd: Move reply_outbuf and construct_reply_common_req to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move push_deferred_open_message_smb to smb2_process.c
David Mulder [Fri, 18 Mar 2022 20:28:08 +0000 (14:28 -0600)]
smbd: Move push_deferred_open_message_smb to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Separate smb1 code from push_deferred_open_message_smb
David Mulder [Fri, 18 Mar 2022 20:22:27 +0000 (14:22 -0600)]
smbd: Separate smb1 code from push_deferred_open_message_smb

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move get_deferred_open_message_state to smb2_process.c
David Mulder [Fri, 18 Mar 2022 20:15:30 +0000 (14:15 -0600)]
smbd: Move get_deferred_open_message_state to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move open_was_deferred to smb2_process.c
David Mulder [Fri, 18 Mar 2022 20:08:12 +0000 (14:08 -0600)]
smbd: Move open_was_deferred to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move schedule_deferred_open_message_smb to smb2_process.c
David Mulder [Fri, 18 Mar 2022 19:35:41 +0000 (13:35 -0600)]
smbd: Move schedule_deferred_open_message_smb to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move remove_deferred_open_message_smb to smb2_process.c
David Mulder [Fri, 18 Mar 2022 18:28:19 +0000 (12:28 -0600)]
smbd: Move remove_deferred_open_message_smb to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move receive_smb_talloc/smb2_receive_talloc to smb2_process.c
David Mulder [Fri, 18 Mar 2022 15:41:02 +0000 (09:41 -0600)]
smbd: Move receive_smb_talloc/smb2_receive_talloc to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Split receive_smb_talloc into smb1_receive_talloc/smb2_receive_talloc
David Mulder [Fri, 18 Mar 2022 15:22:21 +0000 (09:22 -0600)]
smbd: Split receive_smb_talloc into smb1_receive_talloc/smb2_receive_talloc

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move read_packet_remainder to smb2_process.c
David Mulder [Thu, 17 Mar 2022 21:29:18 +0000 (15:29 -0600)]
smbd: Move read_packet_remainder to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move srv_set_message to smb2_process.c
David Mulder [Thu, 17 Mar 2022 21:23:33 +0000 (15:23 -0600)]
smbd: Move srv_set_message to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move srv_send_smb/smb2_srv_send to smb2_process.c
David Mulder [Fri, 18 Mar 2022 14:22:31 +0000 (08:22 -0600)]
smbd: Move srv_send_smb/smb2_srv_send to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Split srv_send_smb into smb1_srv_send/smb2_srv_send
David Mulder [Fri, 18 Mar 2022 14:13:43 +0000 (08:13 -0600)]
smbd: Split srv_send_smb into smb1_srv_send/smb2_srv_send

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Split process_smb() into process_smb1() and process_smb2()
David Mulder [Thu, 10 Mar 2022 20:09:06 +0000 (13:09 -0700)]
smbd: Split process_smb() into process_smb1() and process_smb2()

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move signing.c -> smb1_signing.c
David Mulder [Thu, 17 Mar 2022 20:54:01 +0000 (14:54 -0600)]
smbd: Move signing.c -> smb1_signing.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Disable call to smb1_srv_init_signing without smb1
David Mulder [Thu, 17 Mar 2022 20:29:41 +0000 (14:29 -0600)]
smbd: Disable call to smb1_srv_init_signing without smb1

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move srv_init_signing to smb2_signing.c
David Mulder [Thu, 17 Mar 2022 20:28:10 +0000 (14:28 -0600)]
smbd: Move srv_init_signing to smb2_signing.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move smb2_srv_init_signing to smb2_signing.c
David Mulder [Thu, 17 Mar 2022 19:55:25 +0000 (13:55 -0600)]
smbd: Move smb2_srv_init_signing to smb2_signing.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move service.c -> smb2_service.c
David Mulder [Thu, 17 Mar 2022 19:35:44 +0000 (13:35 -0600)]
smbd: Move service.c -> smb2_service.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move make_connection to smb1_service.c
David Mulder [Thu, 17 Mar 2022 19:32:30 +0000 (13:32 -0600)]
smbd: Move make_connection to smb1_service.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Disable call to smb1_srv_is_signing_active without smb1
David Mulder [Thu, 17 Mar 2022 19:21:32 +0000 (13:21 -0600)]
smbd: Disable call to smb1_srv_is_signing_active without smb1

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move reply.c -> smb1_reply.c
David Mulder [Thu, 17 Mar 2022 18:59:22 +0000 (12:59 -0600)]
smbd: Move reply.c -> smb1_reply.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move smbd_do_unlocking to smb2_reply.c
David Mulder [Thu, 17 Mar 2022 18:29:42 +0000 (12:29 -0600)]
smbd: Move smbd_do_unlocking to smb2_reply.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Move get_lock_offset to smb2_reply.c
David Mulder [Thu, 17 Mar 2022 18:20:30 +0000 (12:20 -0600)]
smbd: Move get_lock_offset to smb2_reply.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>