]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 years agonetcmd: domain: move functional_prep command to domain/functional_prep.py
Rob van der Linde [Thu, 30 Mar 2023 23:54:49 +0000 (12:54 +1300)] 
netcmd: domain: move functional_prep command to domain/functional_prep.py

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agonetcmd: domain: move demote command to domain/demote.py
Rob van der Linde [Thu, 30 Mar 2023 23:42:24 +0000 (12:42 +1300)] 
netcmd: domain: move demote command to domain/demote.py

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agonetcmd: domain: move dcpromo command to domain/dcpromo.py
Rob van der Linde [Thu, 30 Mar 2023 23:24:33 +0000 (12:24 +1300)] 
netcmd: domain: move dcpromo command to domain/dcpromo.py

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agonetcmd: domain: move classicupgrade command to domain/classicupgrade.py
Rob van der Linde [Thu, 30 Mar 2023 23:12:55 +0000 (12:12 +1300)] 
netcmd: domain: move classicupgrade command to domain/classicupgrade.py

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agonetcmd: domain: move domain_backup.py to domain/backup.py
Rob van der Linde [Thu, 30 Mar 2023 22:54:58 +0000 (11:54 +1300)] 
netcmd: domain: move domain_backup.py to domain/backup.py

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agonetcmd: domain: fix unused imports
Rob van der Linde [Thu, 30 Mar 2023 23:32:07 +0000 (12:32 +1300)] 
netcmd: domain: fix unused imports

Fix existing unused imports first, before splitting the file.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agonetcmd: domain: turn domain.py into a module
Rob van der Linde [Thu, 30 Mar 2023 22:50:13 +0000 (11:50 +1300)] 
netcmd: domain: turn domain.py into a module

The domain.py file has become quite large at over 5000 lines, splitting it now before adding more sub commands.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3: smbd: Fix dumb typos that meant smb1.SMB1-DFS-* tests were running against an...
Jeremy Allison [Thu, 30 Mar 2023 20:19:22 +0000 (13:19 -0700)] 
s3: smbd: Fix dumb typos that meant smb1.SMB1-DFS-* tests were running against an SMB2-only fileserver.

Remove knownfail on SMB1-DFS-SEARCH-PATHS, as we now
pass it with the new SMB1 remove DFS paths before pathname processing
changes.

Note, we still fail:

smb1.SMB1-DFS-PATHS.smbtorture\(fileserver_smb1\)
smb1.SMB1-DFS-OPERATIONS.smbtorture\(fileserver_smb1\)

even with the new SMB1 remove DFS paths before pathname
processing as those tests test *very* specific Windows behaviors. We now
pass many more of the individual internal tests, but
in order to pass them all completely I need to add
specific --with-sambaserver checks to avoid some
of the Windows DFS SMB1 insanity (error messages).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Mar 31 06:07:01 UTC 2023 on atb-devel-224

3 years agos3: smbd: Remove now unused dfs_filename_convert().
Jeremy Allison [Thu, 30 Mar 2023 20:01:08 +0000 (13:01 -0700)] 
s3: smbd: Remove now unused dfs_filename_convert().

And all the static functions it called.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agosmbd: RIP DFS pathname processing in filename_convert_dirfsp_nosymlink()
Ralph Boehme [Thu, 30 Mar 2023 14:22:31 +0000 (16:22 +0200)] 
smbd: RIP DFS pathname processing in filename_convert_dirfsp_nosymlink()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3: smbd: In smb_file_link_information() and smb_file_rename_information() the target...
Jeremy Allison [Thu, 30 Mar 2023 20:02:01 +0000 (13:02 -0700)] 
s3: smbd: In smb_file_link_information() and smb_file_rename_information() the target path is never DFS.

Ensure we strip from ucs_flags before calling filename_convert_dirfsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in call_trans2findfirst()
Ralph Boehme [Thu, 30 Mar 2023 14:44:07 +0000 (16:44 +0200)] 
smbd: use smb1_strip_dfs_path() in call_trans2findfirst()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_search()
Ralph Boehme [Thu, 30 Mar 2023 14:43:58 +0000 (16:43 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_search()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in call_trans2mkdir()
Ralph Boehme [Thu, 30 Mar 2023 14:10:31 +0000 (16:10 +0200)] 
smbd: use smb1_strip_dfs_path() in call_trans2mkdir()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in call_trans2setpathinfo()
Ralph Boehme [Thu, 30 Mar 2023 14:09:48 +0000 (16:09 +0200)] 
smbd: use smb1_strip_dfs_path() in call_trans2setpathinfo()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in smb_set_file_unix_hlink()
Ralph Boehme [Thu, 30 Mar 2023 14:08:53 +0000 (16:08 +0200)] 
smbd: use smb1_strip_dfs_path() in smb_set_file_unix_hlink()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in call_trans2qpathinfo()
Ralph Boehme [Thu, 30 Mar 2023 14:08:11 +0000 (16:08 +0200)] 
smbd: use smb1_strip_dfs_path() in call_trans2qpathinfo()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in call_trans2open()
Ralph Boehme [Thu, 30 Mar 2023 14:07:05 +0000 (16:07 +0200)] 
smbd: use smb1_strip_dfs_path() in call_trans2open()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_mv()
Ralph Boehme [Thu, 30 Mar 2023 14:06:44 +0000 (16:06 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_mv()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_mv()
Ralph Boehme [Thu, 30 Mar 2023 14:06:04 +0000 (16:06 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_mv()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_rmdir()
Ralph Boehme [Thu, 30 Mar 2023 14:05:04 +0000 (16:05 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_rmdir()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_mkdir()
Ralph Boehme [Thu, 30 Mar 2023 14:04:31 +0000 (16:04 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_mkdir()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_unlink()
Ralph Boehme [Thu, 30 Mar 2023 14:04:02 +0000 (16:04 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_unlink()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_ctemp()
Ralph Boehme [Thu, 30 Mar 2023 14:03:30 +0000 (16:03 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_ctemp()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_mknew()
Ralph Boehme [Thu, 30 Mar 2023 14:02:55 +0000 (16:02 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_mknew()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_open_and_X()
Ralph Boehme [Thu, 30 Mar 2023 14:02:32 +0000 (16:02 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_open_and_X()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_open()
Ralph Boehme [Thu, 30 Mar 2023 14:02:08 +0000 (16:02 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_open()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_setatr()
Ralph Boehme [Thu, 30 Mar 2023 14:01:42 +0000 (16:01 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_setatr()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_getatr
Ralph Boehme [Thu, 30 Mar 2023 14:01:17 +0000 (16:01 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_getatr

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_checkpath()
Ralph Boehme [Thu, 30 Mar 2023 13:45:55 +0000 (15:45 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_checkpath()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_ntrename()
Ralph Boehme [Thu, 30 Mar 2023 13:44:59 +0000 (15:44 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_ntrename()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_ntrename()
Ralph Boehme [Thu, 30 Mar 2023 13:43:24 +0000 (15:43 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_ntrename()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in call_nt_transact_create()
Ralph Boehme [Thu, 30 Mar 2023 13:42:24 +0000 (15:42 +0200)] 
smbd: use smb1_strip_dfs_path() in call_nt_transact_create()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: use smb1_strip_dfs_path() in reply_ntcreate_and_X()
Ralph Boehme [Thu, 30 Mar 2023 13:41:43 +0000 (15:41 +0200)] 
smbd: use smb1_strip_dfs_path() in reply_ntcreate_and_X()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3: smbd: Add utility function smb1_strip_dfs_path().
Ralph Boehme [Thu, 30 Mar 2023 13:55:53 +0000 (15:55 +0200)] 
s3: smbd: Add utility function smb1_strip_dfs_path().

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
3 years agos3: smbd: Remove unused and commented out check_path_syntax_smb2_msdfs().
Jeremy Allison [Mon, 27 Mar 2023 19:24:57 +0000 (12:24 -0700)] 
s3: smbd: Remove unused and commented out check_path_syntax_smb2_msdfs().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: smbd: Remove 'is_dfs' parameter to check_path_syntax_smb2().
Jeremy Allison [Mon, 27 Mar 2023 19:23:44 +0000 (12:23 -0700)] 
s3: smbd: Remove 'is_dfs' parameter to check_path_syntax_smb2().

check_path_syntax_smb2() is now a simple wrapper around check_path_syntax().
Leave it alone for now to keep things separate when we add SMB3+POSIX parsing.

check_path_syntax_smb2_msdfs() is now no longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: smbd: Add assertion to filename_convert_dirfsp_nosymlink() that shows SMB2 is...
Jeremy Allison [Mon, 27 Mar 2023 19:16:32 +0000 (12:16 -0700)] 
s3: smbd: Add assertion to filename_convert_dirfsp_nosymlink() that shows SMB2 is *never* dealing with a DFS path here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: smbd: Remove all DFS path prefixes before passing to check_path_syntax_smb2().
Jeremy Allison [Mon, 27 Mar 2023 19:01:56 +0000 (12:01 -0700)] 
s3: smbd: Remove all DFS path prefixes before passing to check_path_syntax_smb2().

In smb2, smb1req->flags2 now never uses FLAGS2_DFS_PATHNAMES,
ucf_flags never has UCF_DFS_PATHNAME, and all calls to check_path_syntax_smb2()
pass "false" in this is_dfs parameter.

Remove all knownfails for smb2.SMB2-DFS* tests.

Now I can clean up check_path_syntax_smb2() and add
an assertion into filename_convert_dirfsp_nosymlink() that
UCF_DFS_PATHNAME is *NEVER* set in the ucf_flags for an
SMB2 connection.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: smbd: Add utility function smb2_strip_dfs_path().
Jeremy Allison [Mon, 27 Mar 2023 17:06:03 +0000 (10:06 -0700)] 
s3: smbd: Add utility function smb2_strip_dfs_path().

Removes any DFS prefix from an SMB2 name. This will
enable me to clean up the mess around SMB2 DFS path
processing, remove some knownfails and eventually
make it much easier to add SMB3+POSIX path processing
now it can ignore DFS prefixes. Original idea from
Volker.

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: smbd: Change smb2_file_link_information() to use srvstr_pull_talloc()/check_path_...
Jeremy Allison [Mon, 27 Mar 2023 18:25:59 +0000 (11:25 -0700)] 
s3: smbd: Change smb2_file_link_information() to use srvstr_pull_talloc()/check_path_syntax_smb2().

It now looks like all other SMB2 path processing and
we can proceed to strip the DFS prefixes from SMB2 pathnames
before further processing.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: smbd: In smb2_file_link_information(), don't ever expect @GMT tokens in the pathname.
Jeremy Allison [Mon, 27 Mar 2023 18:14:59 +0000 (11:14 -0700)] 
s3: smbd: In smb2_file_link_information(), don't ever expect @GMT tokens in the pathname.

They're an SMB1 thing, not an SMB2 thing. It will always be (and always was) zero.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: smbd: Duplicate smb_file_link_information() hardlink handling as smb2_file_link_i...
Jeremy Allison [Mon, 27 Mar 2023 18:07:07 +0000 (11:07 -0700)] 
s3: smbd: Duplicate smb_file_link_information() hardlink handling as smb2_file_link_information().

We're going to change the SMB2 path handling for DFS and I
really don't want to try and mix these changes into the
existing smb_file_link_information() code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: smbd: Cleanup. smb2_file_rename_information() can never have a @GMT path in the...
Jeremy Allison [Mon, 27 Mar 2023 17:43:55 +0000 (10:43 -0700)] 
s3: smbd: Cleanup. smb2_file_rename_information() can never have a @GMT path in the destination.

That's an SMB1 thing. It will always be (and always was) zero.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: smbd: Cleanup - don't set the FLAGS2_DFS_PATHNAMES in flags2 in the glue struct...
Jeremy Allison [Mon, 27 Mar 2023 16:48:26 +0000 (09:48 -0700)] 
s3: smbd: Cleanup - don't set the FLAGS2_DFS_PATHNAMES in flags2 in the glue struct if it's not a DFS server or share.

Even if the client claims it's a DFS pathname. Matches what Windows does if it gets
a DFS pathname on a non-DFS share.

Remove samba3.smbtorture_s3.smb2.SMB2-NON-DFS-SHARE.smbtorture\(fileserver\)
test knownfail.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agoselftest: Add test parsing krb5 PAC claims via ndrdump
Andrew Bartlett [Wed, 29 Mar 2023 02:01:15 +0000 (15:01 +1300)] 
selftest: Add test parsing krb5 PAC claims via ndrdump

Including
* compressed claims
* plain (uncompressed) claims

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Mar 31 02:50:30 UTC 2023 on atb-devel-224

3 years agosefltest: Extend python NDR parsing tests to compressed and uncompressed claims
Andrew Bartlett [Wed, 29 Mar 2023 21:56:49 +0000 (10:56 +1300)] 
sefltest: Extend python NDR parsing tests to compressed and uncompressed claims

This confirms that the compression is transparent and that the
values from a PAC with claims provided by MS Windows are parsed
correctly.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agolibrpc/ndr: Use libndr compression for claims
Andrew Bartlett [Thu, 16 Mar 2023 06:06:04 +0000 (19:06 +1300)] 
librpc/ndr: Use libndr compression for claims

This ensures our python layer and C layer (in the KDC, when implementated)
use the same compression logic and so allows us to test the production
compression via the IDL-generated interfaces.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agolibrpc/ndr: Make ndr_push_compression_state_free() a talloc destructor
Andrew Bartlett [Tue, 28 Mar 2023 22:49:43 +0000 (11:49 +1300)] 
librpc/ndr: Make ndr_push_compression_state_free() a talloc destructor

This means that the generic_mszip_free() will still be called on failure.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agopidl: Automatically manage creating and freeing the compression state in generated...
Andrew Bartlett [Tue, 28 Mar 2023 22:43:10 +0000 (11:43 +1300)] 
pidl: Automatically manage creating and freeing the compression state in generated code

Manually written code will handle this differently, but for generated code
this will create and free the context.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agolibrpc/ndr: Implement lzxpress_huffman() compression in libndr for Kerberos Claims
Andrew Bartlett [Tue, 28 Mar 2023 05:26:13 +0000 (18:26 +1300)] 
librpc/ndr: Implement lzxpress_huffman() compression in libndr for Kerberos Claims

Rather than just pick the next value we re-arrange compression values
in libndr to be memnonic to values in MS Windows ntifs.h

This helps avoid confusing developers who compare these
algorithms with local the MS Windows interface.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agolibrpc/ndr: Add a "NONE" compression format to libndr
Andrew Bartlett [Thu, 16 Mar 2023 06:05:39 +0000 (19:05 +1300)] 
librpc/ndr: Add a "NONE" compression format to libndr

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agolibndr/ndr: Remove unused argument from ndr_push_compression_{start,end}()
Andrew Bartlett [Tue, 28 Mar 2023 05:31:45 +0000 (18:31 +1300)] 
libndr/ndr: Remove unused argument from ndr_push_compression_{start,end}()

Removing the unused arguments avoids thier value being calculated in the
PIDL generated code, which can be expensive.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agolibndr/ndr: Add NDR_COMPRESSION_INVALID
Andrew Bartlett [Tue, 28 Mar 2023 05:35:10 +0000 (18:35 +1300)] 
libndr/ndr: Add NDR_COMPRESSION_INVALID

This will help make a mapping from wire-specified compression
algorithms to our available choices safer by allowing an invalid
choice to map to NDR_COMPRESSION_INVALID

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agolibrpc/ndr: Unimplement DRSUAPI_COMPRESSION_TYPE_XPRESS and rename
Andrew Bartlett [Fri, 17 Mar 2023 00:10:09 +0000 (13:10 +1300)] 
librpc/ndr: Unimplement DRSUAPI_COMPRESSION_TYPE_XPRESS and rename

DRSUAPI_COMPRESSION_TYPE_XPRESS is not MS-XCA nor is it implemented by
lzexpress_compress(), so disconnect from that algorithm.

This avoids someone fixing lzxpress_compress() to work for DRSUAPI
and breaking claims support.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agolibrpc/ndr: Remove incorrect comment that ndr_compression.h is autogenerated
Andrew Bartlett [Fri, 24 Mar 2023 01:59:55 +0000 (14:59 +1300)] 
librpc/ndr: Remove incorrect comment that ndr_compression.h is autogenerated

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agolibrpc: Remove incorrect NDR_COMPRESSION dependency from NDR_KRB5CCACHE
Andrew Bartlett [Sun, 26 Mar 2023 22:26:31 +0000 (11:26 +1300)] 
librpc: Remove incorrect NDR_COMPRESSION dependency from NDR_KRB5CCACHE

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agondrdump: Allow a long string of hexidecimal digits as well as a hex dump for --hex...
Andrew Bartlett [Mon, 27 Mar 2023 22:38:15 +0000 (11:38 +1300)] 
ndrdump: Allow a long string of hexidecimal digits as well as a hex dump for --hex-input

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agolib/compression: Fix documentation of lzxpress_huffman_compress()
Andrew Bartlett [Tue, 28 Mar 2023 02:10:39 +0000 (15:10 +1300)] 
lib/compression: Fix documentation of lzxpress_huffman_compress()

The "inconvenience function" takes one type, and converts it to another
but the documentation was not updated.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agolib/compression: Add helper function lzxpress_huffman_max_compressed_size()
Andrew Bartlett [Tue, 28 Mar 2023 02:42:39 +0000 (15:42 +1300)] 
lib/compression: Add helper function lzxpress_huffman_max_compressed_size()

This allows the calculation of the worst case to be shared with callers.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agopidl: Allow variable expansion (eg of a value() attribute) in compression_alg argument
Andrew Bartlett [Fri, 24 Mar 2023 02:00:33 +0000 (15:00 +1300)] 
pidl: Allow variable expansion (eg of a value() attribute) in compression_alg argument

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoselftest: Add python test that verifies that we can parse a PAC
Andrew Bartlett [Mon, 27 Mar 2023 01:19:51 +0000 (14:19 +1300)] 
selftest: Add python test that verifies that we can parse a PAC

This give us a building block to test the PAC claims format

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agolibrpc/idl: Explain why PAC_TYPE_CLIENT_CLAIMS_INFO is not directly decoded
Andrew Bartlett [Mon, 27 Mar 2023 22:33:22 +0000 (11:33 +1300)] 
librpc/idl: Explain why PAC_TYPE_CLIENT_CLAIMS_INFO is not directly decoded

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agos4:kdc: Split verifying a PAC out of updating it
Joseph Sutton [Mon, 20 Mar 2023 01:51:53 +0000 (14:51 +1300)] 
s4:kdc: Split verifying a PAC out of updating it

This is to adapt to the changed Heimdal KDC plugin API.

When we add support for device claims, we want to be able to verify the
PAC of the armor ticket without modifying or updating it. Previously, we
couldn't do this as the two operations were tightly intertwined. Now the
parts that only perform verification are split out into a new function,
samba_kdc_verify_pac().

NOTE: This commit finally works again!

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agothird_party/heimdal_build: Remove MD2
Joseph Sutton [Mon, 9 Jan 2023 03:13:33 +0000 (16:13 +1300)] 
third_party/heimdal_build: Remove MD2

This is to adapt to Heimdal:

commit 3a5e91eca26284661fd2294dfc485305e5d5cc3d
Author: Nicolas Williams <nico@twosigma.com>
Date:   Tue Oct 25 22:20:45 2022 -0500

    hcrypto: Remove MD2 with prejudice

NOTE: THIS COMMIT WON'T COMPILE/WORK ON ITS OWN!

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agothird_party/heimdal: Import lorikeet-heimdal-202303200103 (commit 2ee541b5e963f7cffb1...
Joseph Sutton [Wed, 8 Mar 2023 20:00:02 +0000 (09:00 +1300)] 
third_party/heimdal: Import lorikeet-heimdal-202303200103 (commit 2ee541b5e963f7cffb1ec4acd1a8cc45426a9f28)

NOTE: THIS COMMIT WON'T COMPILE/WORK ON ITS OWN!

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopyldb: Fix a copy&paste error, CID 1524512 DEADCODE
Volker Lendecke [Sat, 25 Mar 2023 15:34:57 +0000 (16:34 +0100)] 
pyldb: Fix a copy&paste error, CID 1524512 DEADCODE

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Mar 30 08:08:32 UTC 2023 on atb-devel-224

3 years agolib:talloc: Move talloc_get_size() out of the talloc reference group
Andreas Schneider [Tue, 28 Mar 2023 08:17:29 +0000 (10:17 +0200)] 
lib:talloc: Move talloc_get_size() out of the talloc reference group

This is not specific to talloc references.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3: libcli: Refuse to connect to any server with zero values for max_trans_size,...
Jeremy Allison [Tue, 21 Mar 2023 17:34:46 +0000 (10:34 -0700)] 
s3: libcli: Refuse to connect to any server with zero values for max_trans_size, max_read_size, max_write_size.

There's nothing we can do to such a server (this
now matches the behavior for SMB1).

Remove knownfail.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Mar 29 18:58:33 UTC 2023 on atb-devel-224

3 years agotests: Add samba3.blackbox.zero_readsize test.
Jeremy Allison [Tue, 21 Mar 2023 17:31:36 +0000 (10:31 -0700)] 
tests: Add samba3.blackbox.zero_readsize test.

smbclient crashes when smbd has "smb2 max read = 0"
in the [global] section of smb.conf.

We should fail the protocol negotiation with
NT_STATUS_INVALID_NETWORK_RESPONSE in this case.

Adds knownfail.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agotest: Add a test for "deny ous"
Volker Lendecke [Tue, 7 Mar 2023 16:21:56 +0000 (17:21 +0100)] 
test: Add a test for "deny ous"

Not a comprehensive test for all possible combinations, but it shows
the basic functionality, and it found a bug in the initial
implementation :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agotests: Slightly simplify test_idmap_ad.sh
Volker Lendecke [Tue, 7 Mar 2023 12:54:47 +0000 (13:54 +0100)] 
tests: Slightly simplify test_idmap_ad.sh

ldbmodify can change multiple objects in one run

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agoidmap_ad: Add "deny ous" and "allow ous" options
Volker Lendecke [Fri, 18 Nov 2022 10:36:28 +0000 (11:36 +0100)] 
idmap_ad: Add "deny ous" and "allow ous" options

With these options, certain OUs can be denied or a list of OUs can be
explicitly permitted for idmapping.

Use case: Administration of OUs in AD has been delegated to people not
100% trusted by the unix server team, this can prevent arbitrary unix
IDs to be assigned by these delegated admins.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agoidmap: Initialize struct idmap_ad_context
Volker Lendecke [Tue, 7 Mar 2023 15:08:18 +0000 (16:08 +0100)] 
idmap: Initialize struct idmap_ad_context

We'll add another pointer next that should be initialized to NULL

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Add idmap_config_string_list()
Volker Lendecke [Thu, 17 Nov 2022 09:43:22 +0000 (10:43 +0100)] 
winbind: Add idmap_config_string_list()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Factor out idmap_config_name()
Volker Lendecke [Thu, 17 Nov 2022 09:40:36 +0000 (10:40 +0100)] 
winbind: Factor out idmap_config_name()

3 times is enough, next patch will add a 4th one.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agobuildtools: Remove compile_commands.json symlink
Andreas Schneider [Sat, 25 Mar 2023 16:10:19 +0000 (17:10 +0100)] 
buildtools: Remove compile_commands.json symlink

We are telling clangd with the .clangd project config file where to find it.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Mar 29 17:54:05 UTC 2023 on atb-devel-224

3 years agoAdd .clangd configuration file
Andreas Schneider [Sat, 25 Mar 2023 16:09:28 +0000 (17:09 +0100)] 
Add .clangd configuration file

This is supported since clang 11.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3:waf: Fix One Definition Rule (ODR) violation of libsecrets3
Andreas Schneider [Tue, 28 Mar 2023 12:46:14 +0000 (14:46 +0200)] 
s3:waf: Fix One Definition Rule (ODR) violation of libsecrets3

==7109==ERROR: AddressSanitizer: odr-violation (0x7f7d682b4f00):
  [1] size=88 'ndr_table_secrets' source3/librpc/gen_ndr/ndr_secrets.c:1002:34
  [2] size=88 'ndr_table_secrets' source3/librpc/gen_ndr/ndr_secrets.c:1002:34
These globals were registered at these points:
  [1]:
    #0 0x7f7d6843eda8  (/lib64/libasan.so.8+0x3eda8)
    #1 0x7f7d682970ed in _sub_I_00099_1 (bin/shared/private/libsecrets3-samba4.so+0x1a0ed)
    #2 0x7f7d68af72fd in call_init /usr/src/debug/glibc-2.37/elf/dl-init.c:70
    #3 0x7f7d68af72fd in call_init /usr/src/debug/glibc-2.37/elf/dl-init.c:26

  [2]:
    #0 0x7f7d6843eda8  (/lib64/libasan.so.8+0x3eda8)
    #1 0x7f7d65d423fb in _sub_I_00099_1 (bin/shared/private/libndr-samba4.so+0x3423fb)
    #2 0x7f7d68af72fd in call_init /usr/src/debug/glibc-2.37/elf/dl-init.c:70
    #3 0x7f7d68af72fd in call_init /usr/src/debug/glibc-2.37/elf/dl-init.c:26

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3:libsmb: Fix conflicting declaration/implementation
Andreas Schneider [Mon, 27 Mar 2023 07:59:50 +0000 (09:59 +0200)] 
s3:libsmb: Fix conflicting declaration/implementation

../../source3/libsmb/clientgen.c:61:19: error: conflicting types for
‘cli_state_create’ due to enum/integer mismatch; have
‘struct cli_state *(TALLOC_CTX *, int,  const char *, int
,  int)’ {aka ‘struct cli_state *(void *, int,  const char *, int,
int)’} [-Werror=enum-int-mismatch]
   61 | struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
      |                   ^~~~~~~~~~~~~~~~
In file included from ../../source3/libsmb/libsmb.h:28,
                 from ../../source3/libsmb/clientgen.c:22:
../../source3/libsmb/proto.h:180:19: note: previous declaration of
‘cli_state_create’ with type
‘struct cli_state *(TALLOC_CTX *, int,  const char *,
enum smb_signing_setting,  int)’ {aka ‘struct cli_state *(void *, int,
const char *, enum smb_signing_setting,  int)’}
  180 | struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
      |                   ^~~~~~~~~~~~~~~~

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Mar 28 10:27:19 UTC 2023 on atb-devel-224

3 years agos3:libsmb: Remove trailing whitespaces in clientgen.c
Andreas Schneider [Mon, 27 Mar 2023 07:59:22 +0000 (09:59 +0200)] 
s3:libsmb: Remove trailing whitespaces in clientgen.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoexamples: Improve comment in smb.conf.default
Andreas Schneider [Mon, 27 Mar 2023 09:33:53 +0000 (11:33 +0200)] 
examples: Improve comment in smb.conf.default

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Rowland Penny <rpenny@samba.org>
3 years agoexamples: Remove trailing whitespaces in smb.conf.default
Andreas Schneider [Mon, 27 Mar 2023 09:33:32 +0000 (11:33 +0200)] 
examples: Remove trailing whitespaces in smb.conf.default

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Rowland Penny <rpenny@samba.org>
3 years agoexamples: Fix code spelling
Andreas Schneider [Wed, 22 Mar 2023 09:05:24 +0000 (10:05 +0100)] 
examples: Fix code spelling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Rowland Penny <rpenny@samba.org>
3 years agoexamples: Remove trailing whitespaces in mklogon.conf
Andreas Schneider [Wed, 22 Mar 2023 09:07:06 +0000 (10:07 +0100)] 
examples: Remove trailing whitespaces in mklogon.conf

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Rowland Penny <rpenny@samba.org>
3 years agoexamples: Remove trailing whitespaces in ol-schema-migrate.pl
Andreas Schneider [Wed, 22 Mar 2023 08:55:10 +0000 (09:55 +0100)] 
examples: Remove trailing whitespaces in ol-schema-migrate.pl

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Rowland Penny <rpenny@samba.org>
3 years agobuildtools: Fix code spelling
Andreas Schneider [Tue, 14 Mar 2023 07:53:49 +0000 (08:53 +0100)] 
buildtools: Fix code spelling

Best reviewed with: `git show --word-diff`

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Rowland Penny <rpenny@samba.org>
3 years agoauth: Fix code spelling
Andreas Schneider [Tue, 14 Mar 2023 07:50:34 +0000 (08:50 +0100)] 
auth: Fix code spelling

Best reviewed with: `git show --word-diff`

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Rowland Penny <rpenny@samba.org>
3 years agos3:utils: Fix grammar in testparm
Andreas Schneider [Tue, 28 Feb 2023 19:41:59 +0000 (20:41 +0100)] 
s3:utils: Fix grammar in testparm

Best reviewed with: `git show --word-diff`

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Rowland Penny <rpenny@samba.org>
3 years agos3:winbind: Fix wrong string zero termination for empty groups
Pavel Filipenský [Sat, 25 Mar 2023 20:37:38 +0000 (21:37 +0100)] 
s3:winbind: Fix wrong string zero termination for empty groups

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Tue Mar 28 08:36:50 UTC 2023 on atb-devel-224

3 years agoctdb:utils: Fix code spelling
Andreas Schneider [Wed, 22 Mar 2023 08:45:26 +0000 (09:45 +0100)] 
ctdb:utils: Fix code spelling

Best reviewed with: `git show --word-diff`

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Mar 24 07:57:37 UTC 2023 on atb-devel-224

3 years agoctdb:utils: Remove trailing whitespaces in scsi_io.c
Andreas Schneider [Wed, 22 Mar 2023 08:45:04 +0000 (09:45 +0100)] 
ctdb:utils: Remove trailing whitespaces in scsi_io.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
3 years agoctdb:tool: Fix code spelling
Andreas Schneider [Wed, 22 Mar 2023 08:42:43 +0000 (09:42 +0100)] 
ctdb:tool: Fix code spelling

Best reviewed with: `git show --word-diff`

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
3 years agoctdb:tests: Fix code spelling
Andreas Schneider [Wed, 22 Mar 2023 08:42:10 +0000 (09:42 +0100)] 
ctdb:tests: Fix code spelling

Best reviewed with: `git show --word-diff`

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
3 years agoctdb:tcp: Fix code spelling
Andreas Schneider [Wed, 22 Mar 2023 08:40:05 +0000 (09:40 +0100)] 
ctdb:tcp: Fix code spelling

Best reviewed with: `git show --word-diff`

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
3 years agoctdb:server: Fix code spelling
Andreas Schneider [Wed, 22 Mar 2023 08:36:23 +0000 (09:36 +0100)] 
ctdb:server: Fix code spelling

Best reviewed with: `git show --word-diff`

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
3 years agoctdb:server: Remove trailing whitespaces in ctdb_server.c
Andreas Schneider [Wed, 22 Mar 2023 08:35:55 +0000 (09:35 +0100)] 
ctdb:server: Remove trailing whitespaces in ctdb_server.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
3 years agoctdb:server: Remove trailing whitespaces in ctdb_recover.c
Andreas Schneider [Wed, 22 Mar 2023 08:33:04 +0000 (09:33 +0100)] 
ctdb:server: Remove trailing whitespaces in ctdb_recover.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
3 years agoctdb:include: Fix code spelling
Andreas Schneider [Wed, 22 Mar 2023 08:29:34 +0000 (09:29 +0100)] 
ctdb:include: Fix code spelling

Best reviewed with: `git show --word-diff`

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
3 years agoctdb:include: Remove trailing whitespaces in ctdb_protocol.h
Andreas Schneider [Wed, 22 Mar 2023 08:30:31 +0000 (09:30 +0100)] 
ctdb:include: Remove trailing whitespaces in ctdb_protocol.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>