]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 years agotests/s3: Test reserved chars in posix filename
David Mulder [Thu, 7 Jul 2022 18:57:01 +0000 (12:57 -0600)] 
tests/s3: Test reserved chars in posix filename

Disabled because we don't handle posix paths
correctly yet.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agosmbd: Implement SMB2_FILE_POSIX_INFORMATION in smbd_marshall_dir_entry
David Mulder [Fri, 17 Jun 2022 21:06:29 +0000 (15:06 -0600)] 
smbd: Implement SMB2_FILE_POSIX_INFORMATION in smbd_marshall_dir_entry

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agotests/s3: Test SMB2_FIND_POSIX_INFORMATION dir query
David Mulder [Wed, 15 Jun 2022 21:39:00 +0000 (15:39 -0600)] 
tests/s3: Test SMB2_FIND_POSIX_INFORMATION dir query

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolibsmb: Allow listing with posix context
David Mulder [Tue, 20 Sep 2022 16:28:20 +0000 (10:28 -0600)] 
libsmb: Allow listing with posix context

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolibsmb: Make info_level configurable in dir listing
David Mulder [Wed, 15 Jun 2022 19:20:30 +0000 (13:20 -0600)] 
libsmb: Make info_level configurable in dir listing

This was hard coded to SMB2_FIND_ID_BOTH_DIRECTORY_INFO

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agosmbd: Plumb SMB2_FIND_POSIX_INFORMATION through the directory reading code.
Jeremy Allison [Mon, 18 Dec 2017 21:27:06 +0000 (13:27 -0800)] 
smbd: Plumb SMB2_FIND_POSIX_INFORMATION through the directory reading code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Add SMB2_FILE_POSIX_INFORMATION getinfo info level (100 on the wire).
Jeremy Allison [Thu, 14 Dec 2017 23:18:21 +0000 (15:18 -0800)] 
s3: smbd: Add SMB2_FILE_POSIX_INFORMATION getinfo info level (100 on the wire).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agosmbd: reject FILE_ATTRIBUTE_TEMPORARY on directories
Ralph Boehme [Tue, 22 Nov 2022 06:31:52 +0000 (07:31 +0100)] 
smbd: reject FILE_ATTRIBUTE_TEMPORARY on directories

Cf MS-FSA 2.1.5.14.2

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Nov 28 10:14:12 UTC 2022 on sn-devel-184

3 years agotorture: add a test trying to set FILE_ATTRIBUTE_TEMPORARY on a directory
Ralph Boehme [Tue, 22 Nov 2022 09:45:35 +0000 (10:45 +0100)] 
torture: add a test trying to set FILE_ATTRIBUTE_TEMPORARY on a directory

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agovfs: fix the build of nfs4acl_xattr_ without rpc/xdr.h support
Stefan Metzmacher [Wed, 27 Mar 2019 03:34:12 +0000 (04:34 +0100)] 
vfs: fix the build of nfs4acl_xattr_ without rpc/xdr.h support

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Nov 25 06:07:32 UTC 2022 on sn-devel-184

3 years agonet: use correct printf format, fi3_id is an uint32_t
Ralph Boehme [Tue, 10 Jan 2017 11:22:28 +0000 (12:22 +0100)] 
net: use correct printf format, fi3_id is an uint32_t

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Nov 24 16:39:12 UTC 2022 on sn-devel-184

3 years agogitlab-ci: do some basic testing on ubuntu1804-32bit
Stefan Metzmacher [Tue, 22 Nov 2022 09:41:39 +0000 (10:41 +0100)] 
gitlab-ci: do some basic testing on ubuntu1804-32bit

For now we allow build warnings and only do some basic testing.
We also ignore timestamp related problems, as well as some charset
failures.

Over time we should try to address the situation by not allowing warnings
and verify if expected failures are harmless or not.

But it's already much better then having no 32bit testing at all!

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Nov 24 12:05:26 UTC 2022 on sn-devel-184

3 years agoselftest: add --default-ldb-backend option
Stefan Metzmacher [Tue, 22 Nov 2022 09:31:19 +0000 (10:31 +0100)] 
selftest: add --default-ldb-backend option

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoselftest: samba-ktest-mit also needs $ENV{KRB5RCACHETYPE} = "none"
Stefan Metzmacher [Fri, 4 Nov 2022 10:23:07 +0000 (10:23 +0000)] 
selftest: samba-ktest-mit also needs $ENV{KRB5RCACHETYPE} = "none"

We need to pass --mitkrb5 to selftest.pl in all cases we use
system mit kerberos not only when we also test the kdc.

We can't use a replay cache in selftest verifies the stat.st_uid
against getuid().

BTW: while debugging this on ubuntu 22.04 I exported
KRB5_TRACE="/dev/stderr", which means we get tracing into
the servers log file and into selftest_prefix/subunit for the client...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoCVE-2022-42898: HEIMDAL: lib/krb5: fix _krb5_get_int64 on systems where 'unsigned...
Stefan Metzmacher [Wed, 16 Nov 2022 11:08:45 +0000 (12:08 +0100)] 
CVE-2022-42898: HEIMDAL: lib/krb5: fix _krb5_get_int64 on systems where 'unsigned long' is just 32-bit

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agothird_party: Update socket_wrapper to version 1.3.5
Stefan Metzmacher [Wed, 23 Nov 2022 11:14:12 +0000 (12:14 +0100)] 
third_party: Update socket_wrapper to version 1.3.5

This injects O_LARGEFILE as needed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib/replace: let rep_openat2() inject O_LARGEFILE as needed
Stefan Metzmacher [Wed, 23 Nov 2022 10:38:20 +0000 (11:38 +0100)] 
lib/replace: let rep_openat2() inject O_LARGEFILE as needed

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:locking: relax __SHARE_MODE_LOCK_SPACE check for 32bit platforms
Stefan Metzmacher [Tue, 22 Nov 2022 09:47:33 +0000 (10:47 +0100)] 
s3:locking: relax __SHARE_MODE_LOCK_SPACE check for 32bit platforms

sizeof(struct share_mode_lock) is only 28 bytes instead of 32 bytes
on 32bit systems...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos4:kdc: make sure reset_bad_password_netlogon() stops subreq before return
Stefan Metzmacher [Mon, 7 Nov 2022 16:40:07 +0000 (17:40 +0100)] 
s4:kdc: make sure reset_bad_password_netlogon() stops subreq before return

We pass the stack variable 'req' to dcerpc_winbind_SendToSam_r_send(),
so we need to make sure the runtime of the subreq in not longer
than the stack variable.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:messaging: add irpc_bh_do_ndr_print() in order to debug irpc calls
Stefan Metzmacher [Mon, 7 Nov 2022 16:15:32 +0000 (17:15 +0100)] 
s4:messaging: add irpc_bh_do_ndr_print() in order to debug irpc calls

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoCVE-2021-20251: s4:auth: fix use after free in authsam_logon_success_accounting()
Stefan Metzmacher [Mon, 7 Nov 2022 16:21:44 +0000 (17:21 +0100)] 
CVE-2021-20251: s4:auth: fix use after free in authsam_logon_success_accounting()

This fixes a use after free problem introduced by
commit 7b8e32efc336fb728e0c7e3dd6fbe2ed54122124,
which has msg = current; which means the lifetime
of the 'msg' memory is no longer in the scope of th
caller.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agobootstrap: Remove duplicate line from CentOS 8 powertools install
Joseph Sutton [Mon, 10 Oct 2022 00:54:08 +0000 (13:54 +1300)] 
bootstrap: Remove duplicate line from CentOS 8 powertools install

This was missed in 136ec5bc01e2648bae34a1158f923fbf5a86d561 when
we moved to CentOS 8 stream.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agobootstrap: Spelling fix in bootstrap from Michael Tokarev
Andrew Bartlett [Wed, 26 Oct 2022 22:39:02 +0000 (11:39 +1300)] 
bootstrap: Spelling fix in bootstrap from Michael Tokarev

This could not previously be included as all changes require a full image rebuild
as they change the SHA1 hash.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agotests: Replace OpenSSL MD4 invocation with a python3 call
Andrew Bartlett [Sun, 30 Oct 2022 23:01:12 +0000 (12:01 +1300)] 
tests: Replace OpenSSL MD4 invocation with a python3 call

This will allow the test to pass on Ubuntu 22.04 which has MD4 disabled
in OpenSSL by default.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agotests: Start testing smb2 symlink error returns
Volker Lendecke [Thu, 27 Oct 2022 10:59:53 +0000 (12:59 +0200)] 
tests: Start testing smb2 symlink error returns

This still all fails, but if you run them against Windows they work.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Nov 22 19:25:34 UTC 2022 on sn-devel-184

3 years agotests: Add nosymlinks_smb1allow share
Volker Lendecke [Thu, 27 Oct 2022 10:48:59 +0000 (12:48 +0200)] 
tests: Add nosymlinks_smb1allow share

The next commits will create symlinks via posix extensions to test the
smb2 symlink error return. Creating posix symlinks is not allowed with
follow symlinks = no, but it's currently our only way to create
symlinks over SMB. This could go away once we can create symlinks via
reparse points.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotests: Start testing reparsepoints
Volker Lendecke [Thu, 10 Nov 2022 17:31:11 +0000 (18:31 +0100)] 
tests: Start testing reparsepoints

This still all fails, but if you run them against Windows they work.

How to run:

PYTHONPATH=bin/python \
LOCAL_PATH=/tmp \
SMB1_SHARE=share \
SMB2_SHARE=share \
SHARENAME=share \
SERVER_IP=<server-ip> \
DOMAIN=<your-domain> \
USERNAME=Administrator \
PASSWORD=<your-password> \
SMB_CONF_PATH=/usr/local/samba/etc/smb.conf \
SERVERCONFFILE="$SMB_CONF_PATH" \
python3 -m samba.subunit.run samba.tests.reparsepoints

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add protocol()
Volker Lendecke [Thu, 3 Nov 2022 15:42:12 +0000 (16:42 +0100)] 
pylibsmb: Add protocol()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add CreateDisposition values
Volker Lendecke [Thu, 3 Nov 2022 15:39:44 +0000 (16:39 +0100)] 
pylibsmb: Add CreateDisposition values

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add FSCTL codes
Volker Lendecke [Thu, 3 Nov 2022 15:18:37 +0000 (16:18 +0100)] 
pylibsmb: Add FSCTL codes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibcli: Add python wappers to reparse_symlink.c
Volker Lendecke [Thu, 3 Nov 2022 11:26:34 +0000 (12:26 +0100)] 
libcli: Add python wappers to reparse_symlink.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Factor out reparse_buffer_marshall from symlink_reparse_buffer_marshall()
Volker Lendecke [Thu, 10 Nov 2022 12:46:25 +0000 (13:46 +0100)] 
libsmb: Factor out reparse_buffer_marshall from symlink_reparse_buffer_marshall()

Make it easier to play with reparse points

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add fsctl()
Volker Lendecke [Tue, 1 Nov 2022 15:14:06 +0000 (16:14 +0100)] 
pylibsmb: Add fsctl()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add create options
Volker Lendecke [Tue, 20 Sep 2022 15:58:04 +0000 (17:58 +0200)] 
pylibsmb: Add create options

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add smb1_symlink()
Volker Lendecke [Tue, 18 Oct 2022 14:55:53 +0000 (16:55 +0200)] 
pylibsmb: Add smb1_symlink()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add smb1_readlink()
Volker Lendecke [Tue, 18 Oct 2022 14:41:30 +0000 (16:41 +0200)] 
pylibsmb: Add smb1_readlink()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add smb1_posix() to request smb1 posix extensions
Volker Lendecke [Sun, 16 Oct 2022 17:41:58 +0000 (19:41 +0200)] 
pylibsmb: Add smb1_posix() to request smb1 posix extensions

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Pass symlink error to create_ex exception
Volker Lendecke [Tue, 20 Sep 2022 15:28:27 +0000 (17:28 +0200)] 
pylibsmb: Pass symlink error to create_ex exception

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Pass symlink error up through cli_smb2_create_fnum_recv()
Volker Lendecke [Tue, 20 Sep 2022 12:31:31 +0000 (14:31 +0200)] 
libsmb: Pass symlink error up through cli_smb2_create_fnum_recv()

Not passing through the sync wrapper yet. Not needed right now, and
it's simple to add if required.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Return symlink error struct from smb2cli_create_recv()
Volker Lendecke [Mon, 25 Oct 2021 13:23:43 +0000 (15:23 +0200)] 
libsmb: Return symlink error struct from smb2cli_create_recv()

Looks larger than it is, this just adds a parameter and while there
adapts long lines to README.Coding

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Parse the smb2 symlink error response in smb2cli_create()
Volker Lendecke [Wed, 26 Oct 2022 11:58:56 +0000 (13:58 +0200)] 
libsmb: Parse the smb2 symlink error response in smb2cli_create()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Keep name_utf16 around in smb2cli_create()
Volker Lendecke [Thu, 20 Oct 2022 08:10:43 +0000 (10:10 +0200)] 
libsmb: Keep name_utf16 around in smb2cli_create()

This is needed to pass up the "unparsed" part of the smb2 symlink
error response in unix charset form.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Pass unparsed_path_length to symlink_reparse_buffer_marshall()
Volker Lendecke [Fri, 14 Oct 2022 15:12:26 +0000 (17:12 +0200)] 
smbd: Pass unparsed_path_length to symlink_reparse_buffer_marshall()

[MS-FSCC] 2.1.2.4 Symbolic Link Reparse Data Buffer lists this field
as reserved, but [MS-SMB2] 2.2.2.2.1 Symbolic Link Error Response is
the exact same format with the reserved field as UnparsedPathLength.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Pass error_context_count through smbd_smb2_request_error_ex()
Volker Lendecke [Fri, 14 Oct 2022 14:23:30 +0000 (16:23 +0200)] 
smbd: Pass error_context_count through smbd_smb2_request_error_ex()

See [MS-SMB2] 2.2.2: This field MUST be set to 0 for SMB dialects
other than 3.1.1. For the SMB dialect 3.1.1, if this field is nonzero,
the ErrorData field MUST be formatted as a variable-length array of
SMB2 ERROR Context structures containing ErrorContextCount entries.

Not used right now yet, but once we start to return STOPPED_ON_SYMLINK properly
this is required.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Factor out safe_symlink_target_path()
Volker Lendecke [Tue, 25 Oct 2022 08:26:26 +0000 (10:26 +0200)] 
smbd: Factor out safe_symlink_target_path()

Small refactoring to make filename_convert_dirfsp() itself a bit
shorter using a subroutine.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotests: Fix an incorrect comment
Volker Lendecke [Wed, 9 Nov 2022 11:35:59 +0000 (12:35 +0100)] 
tests: Fix an incorrect comment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Add "DOMAIN" to authentication creds
Volker Lendecke [Wed, 9 Nov 2022 10:25:51 +0000 (11:25 +0100)] 
libsmb: Add "DOMAIN" to authentication creds

If you want to create symlinks on Windows using reparse points, you
need to authenticate as local administrator, just "administrator" is
not enough. So this is required to run some tests against Windows.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Fix cli_fsctl()
Volker Lendecke [Wed, 9 Nov 2022 11:56:11 +0000 (12:56 +0100)] 
libsmb: Fix cli_fsctl()

Untested code is broken code. Found while testing symlinks over SMB1.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Fix cli_smb2_fsctl_recv()
Volker Lendecke [Tue, 1 Nov 2022 15:12:33 +0000 (16:12 +0100)] 
libsmb: Fix cli_smb2_fsctl_recv()

Untested code is broken code... data_blob_talloc() returns a NULL blob
for NULL/0 input.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Fix removing a rogue reparse point
Volker Lendecke [Thu, 10 Nov 2022 16:40:22 +0000 (17:40 +0100)] 
libsmb: Fix removing a rogue reparse point

If you set a reparse point for which Windows server does not have a
handler, it returns NT_STATUS_IO_REPARSE_TAG_NOT_HANDLED when you
later open it without FILE_OPEN_REPARSE_POINT.

See the discussion thread starting with
https://lists.samba.org/archive/cifs-protocol/2022-November/003888.html

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add template code
Volker Lendecke [Thu, 3 Nov 2022 11:37:58 +0000 (12:37 +0100)] 
pylibsmb: Add template code

I've looked this up in my samples too often :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Whitespace fixes
Volker Lendecke [Wed, 9 Nov 2022 09:15:31 +0000 (10:15 +0100)] 
lib: Whitespace fixes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoidl: Fix whitespace
Volker Lendecke [Wed, 2 Nov 2022 12:24:22 +0000 (13:24 +0100)] 
idl: Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibcli: Make "attr_strs" static
Volker Lendecke [Thu, 10 Nov 2022 10:22:13 +0000 (11:22 +0100)] 
libcli: Make "attr_strs" static

This saves 70 bytes of .text, we don't need this on the stack.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Make lib/util/iov_buf.h self-contained
Volker Lendecke [Thu, 10 Nov 2022 12:42:01 +0000 (13:42 +0100)] 
lib: Make lib/util/iov_buf.h self-contained

We need "struct iovec", which comes in via sys/uio.h, incuded by
system/filesys.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopam_winbind: Fix a memleak
Volker Lendecke [Fri, 4 Nov 2022 10:23:52 +0000 (11:23 +0100)] 
pam_winbind: Fix a memleak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: Test PAM Access with DENY_ALL
David Mulder [Fri, 18 Nov 2022 18:42:15 +0000 (11:42 -0700)] 
gp: Test PAM Access with DENY_ALL

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Nov 21 22:05:01 UTC 2022 on sn-devel-184

3 years agogp: PAM Access should implicitly deny ALL w/ allow
David Mulder [Thu, 17 Nov 2022 23:33:24 +0000 (16:33 -0700)] 
gp: PAM Access should implicitly deny ALL w/ allow

If an allow entry is specified, the PAM Access
CSE should implicitly deny ALL (everyone other
than the explicit allow entries).

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: samba-tool manage gpo access add don't fail w/out upn
David Mulder [Thu, 17 Nov 2022 19:37:20 +0000 (12:37 -0700)] 
gp: samba-tool manage gpo access add don't fail w/out upn

The search response for the user could possibly
not include a upn (this happens with Administrator
for example).

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: Make samba-tool gpo manage sudoers remove backward compatible
David Mulder [Wed, 16 Nov 2022 22:04:16 +0000 (15:04 -0700)] 
gp: Make samba-tool gpo manage sudoers remove backward compatible

Ensure `samba-tool gpo manage sudoers remove` is
backward compatible with the GPME sudo rules.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: Test that samba-tool gpo manage removes gpme sudoers
David Mulder [Wed, 16 Nov 2022 22:03:18 +0000 (15:03 -0700)] 
gp: Test that samba-tool gpo manage removes gpme sudoers

The file format for storing the sudo rules
changed in samba-tool, but these can still be
added via the GPME. We should still include them
here.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: Make samba-tool gpo manage sudoers list backward compatible
David Mulder [Wed, 16 Nov 2022 17:46:11 +0000 (10:46 -0700)] 
gp: Make samba-tool gpo manage sudoers list backward compatible

Ensure `samba-tool gpo manage sudoers list` is
backward compatible with the GPME sudo rules.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: Test that samba-tool gpo manage lists gpme sudoers
David Mulder [Wed, 16 Nov 2022 17:44:22 +0000 (10:44 -0700)] 
gp: Test that samba-tool gpo manage lists gpme sudoers

The file format for storing the sudo rules
changed in samba-tool, but these can still be
added via the GPME. We should still include them
here.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3:rpc_server: Fix include directive substitution when enumerating shares
Andreas Schneider [Wed, 16 Nov 2022 10:24:12 +0000 (11:24 +0100)] 
s3:rpc_server: Fix include directive substitution when enumerating shares

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Nov 18 19:17:31 UTC 2022 on sn-devel-184

3 years agos3:tests: Add substitution test for listing shares
Andreas Schneider [Wed, 16 Nov 2022 10:23:44 +0000 (11:23 +0100)] 
s3:tests: Add substitution test for listing shares

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3:tests: Add substitution test for include directive
Andreas Schneider [Tue, 15 Nov 2022 15:35:15 +0000 (16:35 +0100)] 
s3:tests: Add substitution test for include directive

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Cause SMB2_OP_FLUSH to go synchronous in a compound anywhere but the last...
Jeremy Allison [Thu, 20 Oct 2022 22:19:05 +0000 (15:19 -0700)] 
s3: smbd: Cause SMB2_OP_FLUSH to go synchronous in a compound anywhere but the last operation in the list.

Async read and write go synchronous in the same case,
so do the same here.

Remove knownfail.

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

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): Thu Nov 17 05:55:42 UTC 2022 on sn-devel-184

3 years agos3: smbd: Add utility function smbd_smb2_is_last_in_compound().
Jeremy Allison [Thu, 20 Oct 2022 22:08:14 +0000 (15:08 -0700)] 
s3: smbd: Add utility function smbd_smb2_is_last_in_compound().

Not yet used. Returns true if we're processing the last SMB2 request in a
compound.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos4: torture: Add an async SMB2_OP_FLUSH + SMB2_OP_FLUSH test to smb2.compound_async.
Jeremy Allison [Thu, 20 Oct 2022 21:22:25 +0000 (14:22 -0700)] 
s4: torture: Add an async SMB2_OP_FLUSH + SMB2_OP_FLUSH test to smb2.compound_async.

Shows we fail sending an SMB2_OP_FLUSH + SMB2_OP_FLUSH
compound if we immediately close the file afterward.

Internally the flushes go async and we free the req, then
we process the close. When the flushes complete they try to access
already freed data.

Extra test which will allow me to test when the final
component (flush) of the compound goes async and returns
NT_STATUS_PENDING.

Add knownfail.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos4: torture: Add an async SMB2_OP_FLUSH + SMB2_OP_CLOSE test to smb2.compound_async.
Jeremy Allison [Tue, 18 Oct 2022 23:22:33 +0000 (16:22 -0700)] 
s4: torture: Add an async SMB2_OP_FLUSH + SMB2_OP_CLOSE test to smb2.compound_async.

Shows we fail sending an SMB2_OP_FLUSH + SMB2_OP_CLOSE
compound. Internally the flush goes async and
we free the req, then we process the close.
When the flush completes it tries to access
already freed data.

Found using the Apple MacOSX client at SNIA SDC 2022.

Add knownfail.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agonsswitch: Fix uninitialized memory when allocating pwdlastset_prelim
Noel Power [Wed, 16 Nov 2022 15:37:52 +0000 (15:37 +0000)] 
nsswitch: Fix uninitialized memory when allocating pwdlastset_prelim

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15224
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 16 19:29:21 UTC 2022 on sn-devel-184

3 years agogitlab-ci: Update Fedora to version 37
Andreas Schneider [Wed, 16 Nov 2022 08:37:16 +0000 (09:37 +0100)] 
gitlab-ci: Update Fedora to version 37

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Nov 16 16:29:30 UTC 2022 on sn-devel-184

3 years agonsswitch: Fix pam_set_data()/pam_get_data() to use pointers to a time_t, not try...
Jeremy Allison [Wed, 9 Nov 2022 00:16:07 +0000 (16:16 -0800)] 
nsswitch: Fix pam_set_data()/pam_get_data() to use pointers to a time_t, not try and embedd it directly.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Wed Nov 16 15:09:45 UTC 2022 on sn-devel-184

3 years agos4:lib:tls: Don't negotiate session resumption with session tickets
Noel Power [Fri, 4 Nov 2022 16:56:49 +0000 (16:56 +0000)] 
s4:lib:tls: Don't negotiate session resumption with session tickets

tls_tstream can't properly handle 'New Session Ticket' messages
sent 'after' the client sends the 'Finished' message.

This is needed because some servers (at least elasticsearch) wait till
they get 'Finished' messgage from the client before sending the
"New Ticket" message.

Without this patch what typcially happens is when the application code
sends data it then tries to read the response, but, instead of the
response to the request it actually recieves the "New Session Ticket"
instead. The "New Session Ticket" message gets processed by the upper layer
logic e.g.
   tstream_tls_readv_send
       ->tstream_tls_readv_crypt_next
           ->tstream_tls_retry_read
               ->gnutls_record_recv

instead of the core gnutls routines.

This results in the response processing failing due to the
currently 'unexpected' New Ticket message.

In order to avoid this scenario we can ensure the client doesn't
negotiate resumption with session tickets.

Signed-off-by: Noel Power <noel.power@suse.com>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Nov 16 09:58:45 UTC 2022 on sn-devel-184

3 years agos3: smbd: In synthetic_pathref() change DBG_ERR -> DBG_NOTICE to avoid spamming the...
Jeremy Allison [Tue, 15 Nov 2022 21:29:46 +0000 (13:29 -0800)] 
s3: smbd: In synthetic_pathref() change DBG_ERR -> DBG_NOTICE to avoid spamming the logs.

Can easily be seen by doing make test TESTS=fruit
and looking in st/nt4_dc/smbd_test.log.

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

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 Nov 16 06:00:56 UTC 2022 on sn-devel-184

3 years agoCVE-2022-42898 third_party/heimdal: PAC parse integer overflows
Joseph Sutton [Fri, 14 Oct 2022 03:45:37 +0000 (16:45 +1300)] 
CVE-2022-42898 third_party/heimdal: PAC parse integer overflows

Catch overflows that result from adding PAC_INFO_BUFFER_SIZE.

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

Heavily edited by committer Nico Williams <nico@twosigma.com>, original by
Joseph Sutton <josephsutton@catalyst.net.nz>.

Signed-off-by: Nico Williams <nico@twosigma.com>
[jsutton@samba.org Zero-initialised header_size in krb5_pac_parse() to
 avoid a maybe-uninitialized error; added a missing check for ret == 0]

Autobuild-User(master): Jule Anger <janger@samba.org>
Autobuild-Date(master): Tue Nov 15 17:02:52 UTC 2022 on sn-devel-184

3 years agogp: Fix startup scripts add not always set runonce
David Mulder [Mon, 14 Nov 2022 17:50:28 +0000 (10:50 -0700)] 
gp: Fix startup scripts add not always set runonce

The runonce is always being set because neither
True nor False is ever None.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Nov 15 02:09:45 UTC 2022 on sn-devel-184

3 years agogp: Fix startup scripts list not fail with empty args
David Mulder [Mon, 14 Nov 2022 16:49:18 +0000 (09:49 -0700)] 
gp: Fix startup scripts list not fail with empty args

This fixes the startup scripts list command to
not fail when the parameters variable is empty.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: startup scripts list enclude newline in output
David Mulder [Mon, 14 Nov 2022 16:35:31 +0000 (09:35 -0700)] 
gp: startup scripts list enclude newline in output

The output for listing startup scripts wasn't
clear because there was no newline between
entries.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: startup scripts add clarify 'args' option
David Mulder [Mon, 14 Nov 2022 16:34:35 +0000 (09:34 -0700)] 
gp: startup scripts add clarify 'args' option

Make sure it is clear how to specify args for the
command, and that multiple args can be passed
wrapped in quotes.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: Fix startup scripts add args
David Mulder [Mon, 14 Nov 2022 16:31:41 +0000 (09:31 -0700)] 
gp: Fix startup scripts add args

The args for the command could not be parsed
because samba-tool detects the '-' and thinks its
part of the samba-tool command.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3: smbd: Always use metadata_fsp() when processing fsctls.
Jeremy Allison [Thu, 10 Nov 2022 22:43:15 +0000 (14:43 -0800)] 
s3: smbd: Always use metadata_fsp() when processing fsctls.

Currently all fsctls we implement need the base fsp, not
an alternate data stream fsp. We may revisit this later
if we implement fsctls that operate on an ADS.

Remove knownfail.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Walker <awalker@ixsystems.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Nov 14 18:13:31 UTC 2022 on sn-devel-184

3 years agos3: smbd: Add test to show smbd crashes when doing an FSCTL on a named stream handle.
Jeremy Allison [Thu, 10 Nov 2022 22:41:15 +0000 (14:41 -0800)] 
s3: smbd: Add test to show smbd crashes when doing an FSCTL on a named stream handle.

Add knownfail.

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

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: Test that Password and Kerberos policies fail on unknown key
David Mulder [Fri, 11 Nov 2022 17:04:44 +0000 (10:04 -0700)] 
gp: Test that Password and Kerberos policies fail on unknown key

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Nov 12 01:34:17 UTC 2022 on sn-devel-184

3 years agogp: Password and Kerberos policies fail on unknown key
David Mulder [Fri, 11 Nov 2022 16:41:52 +0000 (09:41 -0700)] 
gp: Password and Kerberos policies fail on unknown key

If unrecognized keys are set in the GptTmpl.inf,
the extensions would fail to apply.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotorture: Test the "server addresses" parameter
Volker Lendecke [Mon, 7 Nov 2022 19:34:57 +0000 (20:34 +0100)] 
torture: Test the "server addresses" parameter

Thanks to Metze for the hint that all file servers already listen on 2
addressess -- V4 and V6 :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Nov 10 08:23:14 UTC 2022 on sn-devel-184

3 years agotestprogs: Fix testit_expect_failure_grep()
Volker Lendecke [Wed, 9 Nov 2022 13:09:34 +0000 (14:09 +0100)] 
testprogs: Fix testit_expect_failure_grep()

Callers expect success (i.e. retval==0) if grep failed with non-zero
error status.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agotestprogs: Add testit_grep_count() helper
Volker Lendecke [Wed, 9 Nov 2022 13:04:23 +0000 (14:04 +0100)] 
testprogs: Add testit_grep_count() helper

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agosrvsvc: Only list shares in "server addresses"
Volker Lendecke [Fri, 21 Oct 2022 15:02:07 +0000 (17:02 +0200)] 
srvsvc: Only list shares in "server addresses"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agosmbd: Implement "server addresses" for tree connect
Volker Lendecke [Fri, 21 Oct 2022 14:58:36 +0000 (16:58 +0200)] 
smbd: Implement "server addresses" for tree connect

Only allow share connections if the server address matches

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agolib: Add lp_allow_local_address()
Volker Lendecke [Fri, 21 Oct 2022 14:45:35 +0000 (16:45 +0200)] 
lib: Add lp_allow_local_address()

Helper function for listing and accessing shares

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agosmbd: Add "server addresses" parameter
Volker Lendecke [Fri, 21 Oct 2022 15:01:21 +0000 (17:01 +0200)] 
smbd: Add "server addresses" parameter

This is a per-share parameter to limit share visibility and
accessibility to specific server IP addresses.

This can be used to limit the visibility and accessibility of shares
on different subnets offered by the server.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agosmbd: Some whitespace fixes
Volker Lendecke [Fri, 21 Oct 2022 07:17:42 +0000 (09:17 +0200)] 
smbd: Some whitespace fixes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agothird_party: Update nss_wrapper to version 1.1.13
Andreas Schneider [Tue, 8 Nov 2022 10:01:44 +0000 (11:01 +0100)] 
third_party: Update nss_wrapper to version 1.1.13

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Nov  9 23:15:07 UTC 2022 on sn-devel-184

3 years agos4: libcli: Ignore errors when getting A records after fetching AAAA records.
Jeremy Allison [Tue, 8 Nov 2022 18:13:18 +0000 (10:13 -0800)] 
s4: libcli: Ignore errors when getting A records after fetching AAAA records.

The target may only be available over IPv6.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov  9 20:34:07 UTC 2022 on sn-devel-184

3 years agolib/replace: fix memory leak in snprintf replacements
Stefan Metzmacher [Mon, 31 Oct 2022 12:16:25 +0000 (13:16 +0100)] 
lib/replace: fix memory leak in snprintf replacements

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Nov  9 11:18:02 UTC 2022 on sn-devel-184

3 years agogp: Ignore crontab -l error, since it means empty
David Mulder [Tue, 8 Nov 2022 18:03:36 +0000 (11:03 -0700)] 
gp: Ignore crontab -l error, since it means empty

We should not fail when crontab -l errors, this
just means the crontab is empty.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Nov  8 22:33:37 UTC 2022 on sn-devel-184

3 years agotests/krb5: Add tests of PAC group handling
Joseph Sutton [Thu, 3 Nov 2022 01:49:17 +0000 (14:49 +1300)] 
tests/krb5: Add tests of PAC group handling

In which we make AS and TGS requests and verify the SIDs we expect are
returned in the PAC.

Example command to test against Windows Server 2019 functional level
2016 with FAST enabled:

ADMIN_USERNAME=Administrator ADMIN_PASSWORD=locDCpass1 \
CLAIMS_SUPPORT=1 COMPOUND_ID_SUPPORT=1 DC_SERVER=ADDC.EXAMPLE.COM \
DOMAIN=EXAMPLE EXPECT_PAC=1 FAST_SUPPORT=1 KRB5_CONFIG=krb5.conf \
PYTHONPATH=bin/python REALM=EXAMPLE.COM SERVER=ADDC.EXAMPLE.COM \
SKIP_INVALID=1 SMB_CONF_PATH=smb.conf STRICT_CHECKING=1 \
TKT_SIG_SUPPORT=1 python3 python/samba/tests/krb5/group_tests.py

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Nov  8 03:37:37 UTC 2022 on sn-devel-184

3 years agotests/krb5: Allow checking domain SID in PAC
Joseph Sutton [Thu, 3 Nov 2022 01:55:36 +0000 (14:55 +1300)] 
tests/krb5: Allow checking domain SID in PAC

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Overhaul PAC logon info group checking
Joseph Sutton [Thu, 3 Nov 2022 01:54:23 +0000 (14:54 +1300)] 
tests/krb5: Overhaul PAC logon info group checking

We can now verify attributes of SIDs and the PAC locations in which SIDs
are placed. We also gain the ability to assert that no SIDs are present
in the PAC other than the ones we expect.

We lighten somewhat the requirement that no duplicates are present among
the SIDs, as such a situation may arise even with Windows, especially if
group types are changed. For example, if a Universal group containing a
user is changed to a Domain-Local group in between an AS-REQ and a
TGS-REQ, the group's SID will be added to the PAC once for each request.
We only verify that there are no exact duplicates (SID, attributes, and
PAC location all being identical).

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>