]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
2 years agotests/krb5: Keep track of the type of each created account
Joseph Sutton [Tue, 13 Jun 2023 23:13:00 +0000 (11:13 +1200)] 
tests/krb5: Keep track of the type of each created account

This allows us to determine which parts of an authentication policy
apply to a particular account, which will be necessary to test audit
logging.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc/idl: Add authentication policy event IDs
Joseph Sutton [Tue, 13 Jun 2023 23:28:40 +0000 (11:28 +1200)] 
librpc/idl: Add authentication policy event IDs

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Consolidate assignments to r->error_code and final_ret
Joseph Sutton [Tue, 13 Jun 2023 23:37:03 +0000 (11:37 +1200)] 
s4:kdc: Consolidate assignments to r->error_code and final_ret

This makes it clearer that we are assigning a value to both together.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Don’t log authentication failures as successes
Joseph Sutton [Tue, 13 Jun 2023 23:58:13 +0000 (11:58 +1200)] 
s4:kdc: Don’t log authentication failures as successes

If a client was authorized, we would ignore the Kerberos error code and
just log the return value of authsam_logon_success_accounting().

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotests/auth_log: Properly expect authentication failures
Joseph Sutton [Wed, 14 Jun 2023 03:28:39 +0000 (15:28 +1200)] 
tests/auth_log: Properly expect authentication failures

These authentications are actually failing (due to RESPONSE_TOO_BIG
errors), but our authentication logging infrastructure hides this.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotests/auth_log: Make samba.tests.auth_log test executable
Joseph Sutton [Wed, 14 Jun 2023 01:47:20 +0000 (13:47 +1200)] 
tests/auth_log: Make samba.tests.auth_log test executable

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4/scripting/bin: Add NT_STATUS_OK to list of definitions
Joseph Sutton [Fri, 26 May 2023 03:14:22 +0000 (15:14 +1200)] 
s4/scripting/bin: Add NT_STATUS_OK to list of definitions

Add NT_STATUS_OK to our pre-generated list of status codes. Ensure it
goes first in the list to ensure that code that previously found this
error code in ‘special_errs’ maintains the same behaviour by falling
back to ‘nt_errs’.

This makes NT_STATUS_OK available to Python code using the ‘ntstatus’
module.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoselftest: Remove duplicate knownfails
Joseph Sutton [Wed, 14 Jun 2023 01:40:50 +0000 (13:40 +1200)] 
selftest: Remove duplicate knownfails

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoselftest: Fix typo
Joseph Sutton [Thu, 8 Jun 2023 04:17:30 +0000 (16:17 +1200)] 
selftest: Fix typo

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoparam: Remove reference to unrecognized parameter ‘directory name cache size’
Joseph Sutton [Wed, 14 Jun 2023 03:06:08 +0000 (15:06 +1200)] 
param: Remove reference to unrecognized parameter ‘directory name cache size’

This parameter was removed in commit
c37d6be2db8ee30d632275e7b1c156a8b5d791a7.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agosamba-tool ou: Remove unused variables
Joseph Sutton [Thu, 8 Jun 2023 01:46:05 +0000 (13:46 +1200)] 
samba-tool ou: Remove unused variables

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agosamba-tool ou: Remove unused import
Joseph Sutton [Thu, 8 Jun 2023 01:45:17 +0000 (13:45 +1200)] 
samba-tool ou: Remove unused import

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agosamba-tool: Fix typo
Joseph Sutton [Thu, 8 Jun 2023 01:44:59 +0000 (13:44 +1200)] 
samba-tool: Fix typo

Found by Rob van der Linde <rob@catalyst.net.nz>.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopyldb: Check for allocation failure in py_ldb_dn_get_parent()
Joseph Sutton [Wed, 14 Jun 2023 22:07:56 +0000 (10:07 +1200)] 
pyldb: Check for allocation failure in py_ldb_dn_get_parent()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopyldb: Raise an exception if ldb_dn_get_parent() fails
Joseph Sutton [Tue, 6 Jun 2023 01:56:32 +0000 (13:56 +1200)] 
pyldb: Raise an exception if ldb_dn_get_parent() fails

Such a failure could be caused by situations other than memory errors,
but a simple indication of failure is all that ldb_dn_get_parent() gives
us to work with.

We keep the old behaviour of returning None if the DN has no components,
which an existing test (ldb.python.api.DnTests.test_parent_nonexistent)
expects.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoselftest: Assert trust realm is not None
Joseph Sutton [Thu, 25 May 2023 22:10:02 +0000 (10:10 +1200)] 
selftest: Assert trust realm is not None

This is consistent with the other tests in this file.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotests/auth_log: Factor out isRemote()
Joseph Sutton [Tue, 23 May 2023 22:31:53 +0000 (10:31 +1200)] 
tests/auth_log: Factor out isRemote()

This makes waitForMessages() easier to read.

View with ‘git show -b’.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:safe_tarfile: Improve safe extract()
Andreas Schneider [Tue, 6 Jun 2023 13:38:12 +0000 (15:38 +0200)] 
python:safe_tarfile: Improve safe extract()

This also checks for symlinks and hardlinks.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agopython:safe_tarfile: Implement safer extractall()
Andreas Schneider [Tue, 6 Jun 2023 13:30:20 +0000 (15:30 +0200)] 
python:safe_tarfile: Implement safer extractall()

This also checks for symlinks and hardlinks.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agopython:safe_tarfile: Set extraction_filter for pythons providing it
Andreas Schneider [Tue, 6 Jun 2023 13:29:06 +0000 (15:29 +0200)] 
python:safe_tarfile: Set extraction_filter for pythons providing it

It should be available for Python >= 3.11.4 but also has been
backported.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agopython:tests: Adopt safe_tarfile for extraction_filter raises
Andreas Schneider [Tue, 6 Jun 2023 14:06:57 +0000 (16:06 +0200)] 
python:tests: Adopt safe_tarfile for extraction_filter raises

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agos4-server: Call dsdb_check_and_update_fl() during startup transaction.
Andrew Bartlett [Wed, 31 May 2023 02:38:02 +0000 (14:38 +1200)] 
s4-server: Call dsdb_check_and_update_fl() during startup transaction.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoselftest: Add unit tests of the DC startup FL check/update code
Andrew Bartlett [Thu, 8 Jun 2023 21:17:39 +0000 (09:17 +1200)] 
selftest: Add unit tests of the DC startup FL check/update code

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agopython/tests: Make helpful, stateless methods @classmethod and @staticmethod
Andrew Bartlett [Wed, 14 Jun 2023 22:49:32 +0000 (10:49 +1200)] 
python/tests: Make helpful, stateless methods @classmethod and @staticmethod

This allows them to be used in setUpClass in tests.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agodsdb: Add routine to check the DB vs lp functional levels
Andrew Bartlett [Wed, 31 May 2023 02:33:08 +0000 (14:33 +1200)] 
dsdb: Add routine to check the DB vs lp functional levels

This will be called at server startup (as well as from Python tests)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agodsdb: Indicate in rootdse.c why samdb_ntds_settings_dn() is not used
Andrew Bartlett [Wed, 31 May 2023 02:29:57 +0000 (14:29 +1200)] 
dsdb: Indicate in rootdse.c why samdb_ntds_settings_dn() is not used

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoselftest: Split up tests in dsdb.py to avoid creating a user when not required
Andrew Bartlett [Thu, 1 Jun 2023 04:04:57 +0000 (16:04 +1200)] 
selftest: Split up tests in dsdb.py to avoid creating a user when not required

Creating a user is CPU intensive, particularly when a password is set
so avoid doing so if not required.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoselftest: Specify that DCs prepared with prepare_dc_testenv() to be 2016 capable
Andrew Bartlett [Tue, 13 Jun 2023 01:33:10 +0000 (13:33 +1200)] 
selftest: Specify that DCs prepared with prepare_dc_testenv() to be 2016 capable

This allows the backup/restore process to pass once the DC startup
code confirms what DC level the domain functional level in the DB
is expecting.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agodocs-xml: remove completely outdated Samba-Developers-Guide
Björn Jacke [Wed, 7 Jun 2023 00:49:49 +0000 (02:49 +0200)] 
docs-xml: remove completely outdated Samba-Developers-Guide

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jun 14 12:21:50 UTC 2023 on atb-devel-224

2 years agovfs: Remove vfs telldir/seekdir functions
Volker Lendecke [Fri, 9 Jun 2023 15:33:02 +0000 (17:33 +0200)] 
vfs: Remove vfs telldir/seekdir functions

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 14 00:26:55 UTC 2023 on atb-devel-224

2 years agosmbd: Remove the offset argument from ReadDirName()
Volker Lendecke [Sat, 10 Jun 2023 13:29:35 +0000 (15:29 +0200)] 
smbd: Remove the offset argument from ReadDirName()

Nobody does anything with this anymore, we just call ReadDirName() in
sequence or do a RewindDir(). So we don't have to look at offsets as
given by the file system anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Remove unused dptr_SearchDir() and the dir cache
Volker Lendecke [Fri, 9 Jun 2023 14:52:48 +0000 (16:52 +0200)] 
smbd: Remove unused dptr_SearchDir() and the dir cache

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Do the "skip to resume name" in call_trans2findnext()
Volker Lendecke [Fri, 9 Jun 2023 14:47:19 +0000 (16:47 +0200)] 
smbd: Do the "skip to resume name" in call_trans2findnext()

This is SMB1-only logic that can be removed from dir.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Make dptr_ReadDirName() public
Volker Lendecke [Fri, 9 Jun 2023 14:38:32 +0000 (16:38 +0200)] 
smbd: Make dptr_ReadDirName() public

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Add dptr_struct->last_name_sent
Volker Lendecke [Fri, 9 Jun 2023 13:22:31 +0000 (15:22 +0200)] 
smbd: Add dptr_struct->last_name_sent

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Remove unused _prev_offset arg from smbd_dirptr_get_entry()
Volker Lendecke [Fri, 9 Jun 2023 13:05:07 +0000 (15:05 +0200)] 
smbd: Remove unused _prev_offset arg from smbd_dirptr_get_entry()

Neither of the two callers looked at the result.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Remove unused dptr_SeekDir()
Volker Lendecke [Fri, 9 Jun 2023 12:53:52 +0000 (14:53 +0200)] 
smbd: Remove unused dptr_SeekDir()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Avoid dptr_SeekDir() when overflowing the dir buffer
Volker Lendecke [Fri, 9 Jun 2023 12:52:11 +0000 (14:52 +0200)] 
smbd: Avoid dptr_SeekDir() when overflowing the dir buffer

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Add smbd_dirptr_push_overflow()
Volker Lendecke [Sat, 27 May 2023 11:20:56 +0000 (13:20 +0200)] 
smbd: Add smbd_dirptr_push_overflow()

This saves the result of smbd_dirptr_get_entry() for later retrieval
in case we could not marshall it to the output buffer. Return this
entry when calling smbd_dirptr_get_entry() again.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Simplify dptr_ReadDirName()
Volker Lendecke [Tue, 13 Jun 2023 13:42:19 +0000 (15:42 +0200)] 
smbd: Simplify dptr_ReadDirName()

While trying to understand the ReadDirName() at the end of
dptr_ReadDirName() in a code path that was supposed to be just a
"stat"-style readdir with a non-wcard mask I came to the conclusion
that this was there to find dptr->wcard with a mangled
name. get_real_filename_at() already takes care of name mangling, so I
think I could eliminate a source of confusion by using it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Avoid a few else branches in smb2_query_directory_next_entry()
Volker Lendecke [Sat, 27 May 2023 11:07:08 +0000 (13:07 +0200)] 
smbd: Avoid a few else branches in smb2_query_directory_next_entry()

There's early returns or gotos anyway

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Make get_dir_entry() static in SMB1-only code
Volker Lendecke [Tue, 23 May 2023 07:48:24 +0000 (09:48 +0200)] 
smbd: Make get_dir_entry() static in SMB1-only code

We need to pass "conn" explicitly because dptr_struct is private to
dir.c.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Slightly simplify smbd_dirptr_lanman2_entry()'s overflow logic
Volker Lendecke [Fri, 9 Jun 2023 12:44:58 +0000 (14:44 +0200)] 
smbd: Slightly simplify smbd_dirptr_lanman2_entry()'s overflow logic

No caller does anything with the smb_fname upon overflow, so we might
as well do an early return.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Eliminiate some dead code
Volker Lendecke [Tue, 13 Jun 2023 13:33:03 +0000 (15:33 +0200)] 
smbd: Eliminiate some dead code

If I'm not completely blind then there's no way how *pst can be a
valid stat. We did a SET_STAT_INVALID at the beginning of the
function, and there's no code path up to this if-statement that can
make *pst valid again.

Review with "git show -U40".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Use dptr_RewindDir() instead of dptr_SeekDir(.., 0)
Volker Lendecke [Tue, 13 Jun 2023 14:25:55 +0000 (16:25 +0200)] 
smbd: Use dptr_RewindDir() instead of dptr_SeekDir(.., 0)

This is a more focused call.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Apply some README.Coding to call_trans2findfirst/next()
Volker Lendecke [Fri, 9 Jun 2023 07:38:31 +0000 (09:38 +0200)] 
smbd: Apply some README.Coding to call_trans2findfirst/next()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Introduce "dir_hnd" helper variable in smbd_dirptr_get_entry()
Volker Lendecke [Fri, 9 Jun 2023 07:59:36 +0000 (09:59 +0200)] 
smbd: Introduce "dir_hnd" helper variable in smbd_dirptr_get_entry()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Remove unused "poffset" parameter from SearchDir()
Volker Lendecke [Fri, 9 Jun 2023 07:33:42 +0000 (09:33 +0200)] 
smbd: Remove unused "poffset" parameter from SearchDir()

The only caller threw the result away.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Remove unused "poffset" parameter from dptr_SearchDir()
Volker Lendecke [Fri, 9 Jun 2023 07:33:42 +0000 (09:33 +0200)] 
smbd: Remove unused "poffset" parameter from dptr_SearchDir()

The only caller threw the result away.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Remove unused "pst" parameter from dptr_SearchDir()
Volker Lendecke [Fri, 9 Jun 2023 07:33:42 +0000 (09:33 +0200)] 
smbd: Remove unused "pst" parameter from dptr_SearchDir()

The only caller threw the result away.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Modernize a few overlog DEBUG statements
Volker Lendecke [Fri, 9 Jun 2023 10:21:14 +0000 (12:21 +0200)] 
smbd: Modernize a few overlog DEBUG statements

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoconf: Fix wrong language in "dos charset" smb.conf.5 entry
Volker Lendecke [Tue, 13 Jun 2023 08:04:56 +0000 (10:04 +0200)] 
conf: Fix wrong language in "dos charset" smb.conf.5 entry

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agotestparm: Fix a typo
Volker Lendecke [Tue, 13 Jun 2023 08:03:24 +0000 (10:03 +0200)] 
testparm: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Use ISDOT() in exact_match()
Volker Lendecke [Sat, 27 May 2023 09:28:14 +0000 (11:28 +0200)] 
smbd: Use ISDOT() in exact_match()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs: Remove two "== true"
Volker Lendecke [Fri, 26 May 2023 10:39:15 +0000 (12:39 +0200)] 
vfs: Remove two "== true"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs: Modernize a few DEBUG statements
Volker Lendecke [Fri, 26 May 2023 10:38:25 +0000 (12:38 +0200)] 
vfs: Modernize a few DEBUG statements

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs: Fix a typo
Volker Lendecke [Fri, 26 May 2023 10:35:48 +0000 (12:35 +0200)] 
vfs: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolib: Fix whitespace
Volker Lendecke [Mon, 15 May 2023 15:09:41 +0000 (17:09 +0200)] 
lib: Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agothird_party: Update nss_wrapper to version 1.1.15
Pavel Filipenský [Tue, 24 Jan 2023 10:20:49 +0000 (11:20 +0100)] 
third_party: Update nss_wrapper to version 1.1.15

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jun 13 13:09:41 UTC 2023 on atb-devel-224

2 years agotestprogs: Add test_alias_membership
Pavel Filipenský [Wed, 12 Apr 2023 07:29:18 +0000 (09:29 +0200)] 
testprogs: Add test_alias_membership

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos4:torture: Limit run of test_membership_user() only to ad_member_idmap_rid
Pavel Filipenský [Thu, 6 Apr 2023 14:59:24 +0000 (16:59 +0200)] 
s4:torture: Limit run of test_membership_user() only to ad_member_idmap_rid

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:selftest: Pass environ to local.nss
Pavel Filipenský [Tue, 11 Apr 2023 10:09:10 +0000 (12:09 +0200)] 
s3:selftest: Pass environ to local.nss

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:selftest: Add environ parameter to plansmbtorture4testsuite
Pavel Filipenský [Tue, 11 Apr 2023 10:08:14 +0000 (12:08 +0200)] 
s3:selftest: Add environ parameter to plansmbtorture4testsuite

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agotests: Fix idmap.rid.getgrnam for ad_member_idmap_rid with 'winbind expand groups...
Pavel Filipenský [Sun, 23 Apr 2023 22:11:34 +0000 (00:11 +0200)] 
tests: Fix idmap.rid.getgrnam for ad_member_idmap_rid with 'winbind expand groups = 10'

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoselftest: set 'winbind expand groups = 10' for ad_member_idmap_rid
Pavel Filipenský [Mon, 27 Feb 2023 16:03:31 +0000 (17:03 +0100)] 
selftest: set 'winbind expand groups = 10' for ad_member_idmap_rid

This is for alias members tests.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos4:torture: Skip test_membership_user for users that get incorrectly assigned group sid
Pavel Filipenský [Mon, 27 Mar 2023 18:00:05 +0000 (20:00 +0200)] 
s4:torture: Skip test_membership_user for users that get incorrectly assigned group sid

This commit should be removed once wb_queryuser() is fixed.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:winbind: Fix the default group for the 'Guest' user
Pavel Filipenský [Fri, 24 Mar 2023 14:03:21 +0000 (15:03 +0100)] 
s3:winbind: Fix the default group for the 'Guest' user

If samlogon cache has no entry for the 'Guest' user, the group sid
should default to 'Guests' group.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:winbind: Include local groups in _wbint_QueryGroupList
Pavel Filipenský [Mon, 27 Feb 2023 16:03:32 +0000 (17:03 +0100)] 
s3:winbind: Include local groups in _wbint_QueryGroupList

This is needed for GETGRENT to show also e.g. BUILTIN/users.
Otherwise the test_membership_user (local.nss.membership) would fail.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:winbind: Remove SID_NAME_ALIAS code from rpc_lookup_groupmem()
Pavel Filipenský [Thu, 30 Mar 2023 13:32:55 +0000 (15:32 +0200)] 
s3:winbind: Remove SID_NAME_ALIAS code from rpc_lookup_groupmem()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:winbind: s/wb_group_members_send/wb_alias_members_send/ for SID_NAME_ALIAS in...
Pavel Filipenský [Tue, 21 Mar 2023 07:33:37 +0000 (08:33 +0100)] 
s3:winbind: s/wb_group_members_send/wb_alias_members_send/ for SID_NAME_ALIAS in wb_getgrsid_sid2gid_done()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agolib:dbwrap: Add dbwrap_merge_dbs()
Pavel Filipenský [Tue, 28 Mar 2023 09:15:15 +0000 (11:15 +0200)] 
lib:dbwrap: Add dbwrap_merge_dbs()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agolib:dbwrap: Fix trailing whitespace in lib/dbwrap/dbwrap.h
Pavel Filipenský [Tue, 28 Mar 2023 09:15:50 +0000 (11:15 +0200)] 
lib:dbwrap: Fix trailing whitespace in lib/dbwrap/dbwrap.h

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:winbind: Convert wb_group_members_send() to resolve array of groups
Pavel Filipenský [Thu, 9 Mar 2023 15:00:20 +0000 (16:00 +0100)] 
s3:winbind: Convert wb_group_members_send() to resolve array of groups

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:winbind: Add wb_alias_members_{send/recv}
Pavel Filipenský [Wed, 29 Mar 2023 12:57:50 +0000 (14:57 +0200)] 
s3:winbind: Add wb_alias_members_{send/recv}

wb_alias_members.c is very similar to wb_lookupusergroups.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:winbind: Add wbint_LookupAliasMembers to winbind interface
Pavel Filipenský [Wed, 29 Mar 2023 12:53:14 +0000 (14:53 +0200)] 
s3:winbind: Add wbint_LookupAliasMembers to winbind interface

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:winbind: Add lookup_aliasmem to winbindd_methods and implement it in all backends
Pavel Filipenský [Wed, 8 Mar 2023 07:40:58 +0000 (08:40 +0100)] 
s3:winbind: Add lookup_aliasmem to winbindd_methods and implement it in all backends

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:winbind: Fix trailing whitespace in winbindd_cache.c
Pavel Filipenský [Wed, 8 Mar 2023 12:04:40 +0000 (13:04 +0100)] 
s3:winbind: Fix trailing whitespace in winbindd_cache.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:winbind: Fix trailing whitespace in winbindd_reconnect.c
Pavel Filipenský [Wed, 29 Mar 2023 11:28:35 +0000 (13:28 +0200)] 
s3:winbind: Fix trailing whitespace in winbindd_reconnect.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:winbind: Fix trailing whitespace in winbindd_msrpc.c
Pavel Filipenský [Wed, 29 Mar 2023 11:25:15 +0000 (13:25 +0200)] 
s3:winbind: Fix trailing whitespace in winbindd_msrpc.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agogp: Fix user apply failure when droping privs
David Mulder [Wed, 7 Jun 2023 14:29:31 +0000 (08:29 -0600)] 
gp: Fix user apply failure when droping privs

When dropping privileges, gpupdate errored:
gpclass.py:1167: KeyError: "getpwnam(): name not found: <HOSTNAME>
apply_gp was incorrectly passing the hostname
instead of the username.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Jun 10 10:46:28 UTC 2023 on atb-devel-224

2 years agobootstrap: make sure we have gnutls-cli from gnutls-bin/gnutls-utils
Stefan Metzmacher [Fri, 9 Jun 2023 12:07:06 +0000 (14:07 +0200)] 
bootstrap: make sure we have gnutls-cli from gnutls-bin/gnutls-utils

We'll use it in some upcoming tests...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agobootstrap: force use of LANGUAGE=en_US
Stefan Metzmacher [Fri, 9 Jun 2023 12:02:48 +0000 (14:02 +0200)] 
bootstrap: force use of LANGUAGE=en_US

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoselftest: run tests with LANGUAGE=en_US
Stefan Metzmacher [Fri, 9 Jun 2023 11:51:56 +0000 (13:51 +0200)] 
selftest: run tests with LANGUAGE=en_US

This is important in order to run /usr/bin/kpasswd from MIT...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agothird_party/heimdal: Import lorikeet-heimdal-202306091507 (commit 7d8afc9d7e3d309ddcc...
Stefan Metzmacher [Fri, 9 Jun 2023 13:14:50 +0000 (15:14 +0200)] 
third_party/heimdal: Import lorikeet-heimdal-202306091507 (commit 7d8afc9d7e3d309ddccc2aea6405a8ca6280f6de)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agosmbd: Remove unused dptr_fill() and dptr_fetch_fsp()
Volker Lendecke [Thu, 8 Jun 2023 10:49:08 +0000 (12:49 +0200)] 
smbd: Remove unused dptr_fill() and dptr_fetch_fsp()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun  8 18:34:44 UTC 2023 on atb-devel-224

2 years agosmbd: Make reply_search() easier to understand
Volker Lendecke [Thu, 8 Jun 2023 10:37:43 +0000 (12:37 +0200)] 
smbd: Make reply_search() easier to understand

reply_search() is the only place in the code where we have to deal
with [MS-CIFS] 2.2.4.59.1 ResumeKey structures. This concentrates the
formatting of this to pure SMB1 code in reply_search(), moving away
knowledge about the format from smbd/dir.c's dptr_fill() and
dptr_fetch_fsp().

With this code we just count up the FileIndex from behaviour note
110. If the client is sane and sends us the last FileIndex we returned
to it in a subsequent search, we can completely avoid any
telldir/seekdir. If it skips back, with the new code we rewind and
re-readdir the directory. This will be slower for a very special
corner case, but it's a lot simpler to understand (at least to
me). Also, it avoids calling telldir/seekdir for every entry.

Tested both cases (sane and insane clients) manually with a modified
cli_list_old_done(). Not doing automated tests. If this breaks real
users, we'll fix it and write tests then.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Do an early talloc_free() in reply_search()
Volker Lendecke [Thu, 8 Jun 2023 10:20:31 +0000 (12:20 +0200)] 
smbd: Do an early talloc_free() in reply_search()

Don't wait for the main loop to free file names no longer used.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Do an early talloc_free() in fsp_attach_smb_fname()
Volker Lendecke [Thu, 8 Jun 2023 10:19:00 +0000 (12:19 +0200)] 
smbd: Do an early talloc_free() in fsp_attach_smb_fname()

name_str can pile up when reading directories, we don't talloc_free()
our stackframe before we have filled the whole readdir response packet.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Add dptr_RewindDir()
Volker Lendecke [Thu, 8 Jun 2023 09:59:35 +0000 (11:59 +0200)] 
smbd: Add dptr_RewindDir()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Add dptr_FileNumber()
Volker Lendecke [Wed, 7 Jun 2023 15:10:51 +0000 (17:10 +0200)] 
smbd: Add dptr_FileNumber()

Return how many name entries have been returned from this dptr.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Simplify make_dir_struct()
Volker Lendecke [Wed, 7 Jun 2023 13:16:44 +0000 (15:16 +0200)] 
smbd: Simplify make_dir_struct()

We don't need the talloc_strdup and thus we can return void.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Make SeekDir()/TellDir() static to dir.c
Volker Lendecke [Mon, 29 May 2023 10:47:34 +0000 (12:47 +0200)] 
smbd: Make SeekDir()/TellDir() static to dir.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Fix a typo
Volker Lendecke [Wed, 7 Jun 2023 15:18:28 +0000 (17:18 +0200)] 
smbd: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbclient: Fix fd leak with "showacls;ls"
Volker Lendecke [Thu, 8 Jun 2023 08:14:18 +0000 (10:14 +0200)] 
smbclient: Fix fd leak with "showacls;ls"

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

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): Thu Jun  8 16:55:14 UTC 2023 on atb-devel-224

2 years agoWHATSNEW.txt: Improved winbind logging and samba-log-parser
Pavel Filipenský [Wed, 7 Jun 2023 12:55:49 +0000 (14:55 +0200)] 
WHATSNEW.txt: Improved winbind logging and samba-log-parser

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jun  7 15:06:07 UTC 2023 on atb-devel-224

2 years agodocs-xml:manpages: Add man page for samba-log-parser
Pavel Filipenský [Tue, 9 May 2023 12:09:55 +0000 (14:09 +0200)] 
docs-xml:manpages: Add man page for samba-log-parser

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3:script: Add samba-log-parser
Pavel Filipenský [Thu, 9 Feb 2023 15:48:49 +0000 (16:48 +0100)] 
s3:script: Add samba-log-parser

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Pair-Programmed-With: Andreas Schneider <asn@samba.org>

2 years agosmbcacls/smbcquotas: check for valid UNC path
Björn Jacke [Tue, 10 Jan 2023 11:25:35 +0000 (12:25 +0100)] 
smbcacls/smbcquotas: check for valid UNC path

we used to strip the first two characters of the path and used that.

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

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jun  6 09:33:47 UTC 2023 on atb-devel-224

2 years agobootstrap: Add a note about cleaning bootstrap/
Łukasz Stelmach [Thu, 11 May 2023 11:33:45 +0000 (13:33 +0200)] 
bootstrap: Add a note about cleaning bootstrap/

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agoConfigure builtin heimdal to use KEYRING ccache
Łukasz Stelmach [Fri, 31 Mar 2023 17:42:13 +0000 (19:42 +0200)] 
Configure builtin heimdal to use KEYRING ccache

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>