]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 years agonet: add new --dns-ttl option to specify the ttl of dns records
Björn Baumbach [Thu, 16 Feb 2023 17:36:37 +0000 (18:36 +0100)] 
net: add new --dns-ttl option to specify the ttl of dns records

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotestprogs/blackbox/test_weak_disable_ntlmssp_ldap.sh: verify test results ($failed)
Björn Baumbach [Wed, 22 Feb 2023 19:29:02 +0000 (19:29 +0000)] 
testprogs/blackbox/test_weak_disable_ntlmssp_ldap.sh: verify test results ($failed)

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotestprogs/blackbox/test_special_group.sh: verify test results ($failed)
Björn Baumbach [Wed, 22 Feb 2023 19:28:26 +0000 (19:28 +0000)] 
testprogs/blackbox/test_special_group.sh: verify test results ($failed)

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotestprogs/blackbox/test_net_ads_dns.sh: verify test results ($failed)
Björn Baumbach [Wed, 22 Feb 2023 19:26:34 +0000 (19:26 +0000)] 
testprogs/blackbox/test_net_ads_dns.sh: verify test results ($failed)

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotestprogs: net ads dns: do not increase the $failed counter in "net ads dns" when...
Björn Baumbach [Wed, 22 Feb 2023 19:20:51 +0000 (19:20 +0000)] 
testprogs: net ads dns: do not increase the $failed counter in "net ads dns" when test is OK

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotestprogs: remove used records in "net ads dns" tests
Björn Baumbach [Fri, 24 Feb 2023 15:52:05 +0000 (16:52 +0100)] 
testprogs: remove used records in "net ads dns" tests

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotestprogs: use more unique names in "net ads dns" tests
Björn Baumbach [Fri, 24 Feb 2023 15:27:17 +0000 (16:27 +0100)] 
testprogs: use more unique names in "net ads dns" tests

ADMINNAME can be used for records, created by the AD admin
MACHINENAME for records, created by the machine (-P)
UNPRIVNAME for records, created by the unprivileged user

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotestprogs: remove only used dns records in "net ads dns" tests
Björn Baumbach [Fri, 24 Feb 2023 15:35:02 +0000 (16:35 +0100)] 
testprogs: remove only used dns records in "net ads dns" tests

$NAME was not added here in this section, but $UNPRIV.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotestprogs: use uniqe names in "net ads dns" tests to avoid conflicts
Björn Baumbach [Wed, 22 Feb 2023 19:15:23 +0000 (19:15 +0000)] 
testprogs: use uniqe names in "net ads dns" tests to avoid conflicts

Avoid conflicts when running the same tests multiple times.
Reduces the needs to cleanup all objects properly.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotestprogs: adapt return values of testit_expect_failure_grep and testit_grep_count...
Björn Baumbach [Wed, 22 Feb 2023 19:02:38 +0000 (19:02 +0000)] 
testprogs: adapt return values of testit_expect_failure_grep and testit_grep_count to function description

Improves logic when calling tests and make use of the $failed counter.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotestprogs: net ads dns tests: remove test user after usage.
Björn Baumbach [Wed, 22 Feb 2023 14:57:54 +0000 (15:57 +0100)] 
testprogs: net ads dns tests: remove test user after usage.

Not required anymore and would produce errors, when the test runs
a second time.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotestprogs: fix some "net ads dns" tests
Björn Baumbach [Wed, 22 Feb 2023 14:22:58 +0000 (15:22 +0100)] 
testprogs: fix some "net ads dns" tests

Use testit_grep_count instead of greping the output of testit.
Running testit with "| grep" falsifies the test results.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoAdd a git-blame-ignore-revs file
Jelmer Vernooij [Sat, 28 Jan 2023 20:30:24 +0000 (20:30 +0000)] 
Add a git-blame-ignore-revs file

'git blame' can ignore certain revisions when annotating, e.g. revisions that just reformatting.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Mar  3 02:02:51 UTC 2023 on atb-devel-224

3 years agosamba-tool: Clarify cse register command file dest
David Mulder [Mon, 27 Feb 2023 15:37:10 +0000 (08:37 -0700)] 
samba-tool: Clarify cse register command file dest

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolibrpc: Fix compile error for libnet_join.idl
Christof Schmitt [Wed, 1 Mar 2023 23:43:14 +0000 (16:43 -0700)] 
librpc: Fix compile error for libnet_join.idl

Fix this compile error:

   [753/756] Processing source3/librpc/idl/libnet_join.idl
    source3/librpc/idl/ads.idl:2:10: fatal error: config.h: No such file or directory
    #include "config.h"
          ^~~~~~~~~~
    compilation terminated.
    source3/librpc/idl/libnet_join.idl:3: error: Failed to parse source3/librpc/idl/ads.idl
    source3/librpc/idl/libnet_join.idl:50: warning: [out] argument `account_name' not a pointer

libnet_join.idl imports ads.idl which includes config.h. The build rule
for ads.idl provides the include directory for config.h, so add a new
rule to also specify that include directory for libnet_join.idl.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4: remove unused lib/com/*
Douglas Bagnall [Wed, 1 Mar 2023 23:28:13 +0000 (12:28 +1300)] 
s4: remove unused lib/com/*

Maybe the following IDL files are now unused:

librpc/idl/oxidresolver.idl
librpc/idl/remact.idl
librpc/idl/dcom.idl

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3:rpc_server/netlogon: Fix typo
Joseph Sutton [Wed, 1 Mar 2023 00:32:39 +0000 (13:32 +1300)] 
s3:rpc_server/netlogon: Fix typo

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotorture/backupkey: Fix possibly wrong typo'd array index
Joseph Sutton [Tue, 28 Feb 2023 22:39:56 +0000 (11:39 +1300)] 
torture/backupkey: Fix possibly wrong typo'd array index

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotorture/backupkey: Fix flapping test
Joseph Sutton [Tue, 28 Feb 2023 22:37:03 +0000 (11:37 +1300)] 
torture/backupkey: Fix flapping test

UNEXPECTED(failure): samba4.rpc.backupkey with seal.backupkey.server_wrap_decrypt_wrong_r2(ad_dc_default)
REASON: Exception: Exception: ../../source4/torture/rpc/backupkey.c:2219: r.out.result was WERR_INVALID_ACCESS, expected WERR_INVALID_PARAMETER: decrypt should fail with WERR_INVALID_PARAMETER

As commit 664bde19bf1db1b3740621cdf3f46f9bfd0e8452 states:

"The use of the wrong key can still create structures that parse as a
SID, therefore we can sometimes get an unusual error, which becomes a
flapping test".

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest/delete_object: Remove unused variables
Joseph Sutton [Tue, 28 Feb 2023 20:35:14 +0000 (09:35 +1300)] 
pytest/delete_object: Remove unused variables

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest/getnc_exop: Remove unused variable
Joseph Sutton [Tue, 28 Feb 2023 20:34:26 +0000 (09:34 +1300)] 
pytest/getnc_exop: Remove unused variable

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest/repl_move: Remove unused variables
Joseph Sutton [Tue, 28 Feb 2023 20:31:45 +0000 (09:31 +1300)] 
pytest/repl_move: Remove unused variables

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest/repl_rodc: Remove unused variable
Joseph Sutton [Tue, 28 Feb 2023 20:27:07 +0000 (09:27 +1300)] 
pytest/repl_rodc: Remove unused variable

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest/replica_sync: Remove unused variable
Joseph Sutton [Tue, 28 Feb 2023 20:25:42 +0000 (09:25 +1300)] 
pytest/replica_sync: Remove unused variable

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest/ridalloc_exop: Remove unused variables
Joseph Sutton [Tue, 28 Feb 2023 20:24:52 +0000 (09:24 +1300)] 
pytest/ridalloc_exop: Remove unused variables

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest/samba_tool_drs_critical: Remove unused variables
Joseph Sutton [Tue, 28 Feb 2023 20:23:41 +0000 (09:23 +1300)] 
pytest/samba_tool_drs_critical: Remove unused variables

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest/samba_tool_drs_no_dns: Remove unused variables
Joseph Sutton [Tue, 28 Feb 2023 20:23:09 +0000 (09:23 +1300)] 
pytest/samba_tool_drs_no_dns: Remove unused variables

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest/samba_tool_drs: Remove unused variables
Joseph Sutton [Tue, 28 Feb 2023 20:22:26 +0000 (09:22 +1300)] 
pytest/samba_tool_drs: Remove unused variables

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopytest/samba_tool_drs: Convert bytes to UTF-8 string
Joseph Sutton [Tue, 28 Feb 2023 04:02:52 +0000 (17:02 +1300)] 
pytest/samba_tool_drs: Convert bytes to UTF-8 string

We later use this variable as part of a string substitution, and if we
leave it as bytes we will end up with b' ' quotes surrounding it, which
we do not want. Fix this by converting it to a string.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolib:cmdline: Fix typo
Joseph Sutton [Tue, 28 Feb 2023 04:01:28 +0000 (17:01 +1300)] 
lib:cmdline: Fix typo

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoauth/credentials: Fix typos
Joseph Sutton [Tue, 28 Feb 2023 04:00:57 +0000 (17:00 +1300)] 
auth/credentials: Fix typos

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopython/schema: Fix conversion to UTF-8 string
Joseph Sutton [Tue, 28 Feb 2023 03:56:54 +0000 (16:56 +1300)] 
python/schema: Fix conversion to UTF-8 string

str(b'foo') yields "b'foo'", which is wrong. Fix this to get "foo"
instead.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopython/samba/common: Fix typos
Joseph Sutton [Tue, 28 Feb 2023 03:56:24 +0000 (16:56 +1300)] 
python/samba/common: Fix typos

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoauth/credentials: Fix off-by-one buffer write
Joseph Sutton [Tue, 28 Feb 2023 03:55:06 +0000 (16:55 +1300)] 
auth/credentials: Fix off-by-one buffer write

If p == pass + 127, assigning to '*++p' writes beyond the array.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool: Don't use invalid escape sequences
Joseph Sutton [Fri, 24 Feb 2023 01:54:02 +0000 (14:54 +1300)] 
samba-tool: Don't use invalid escape sequences

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agogp: Don't use invalid escape sequences
Joseph Sutton [Fri, 24 Feb 2023 01:53:36 +0000 (14:53 +1300)] 
gp: Don't use invalid escape sequences

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agogp: Avoid shadowing import
Joseph Sutton [Fri, 24 Feb 2023 01:52:40 +0000 (14:52 +1300)] 
gp: Avoid shadowing import

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:samba_spnupdate: Fix typo
Joseph Sutton [Tue, 21 Feb 2023 23:07:30 +0000 (12:07 +1300)] 
s4:samba_spnupdate: Fix typo

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoselftest: Fix typo
Joseph Sutton [Mon, 20 Feb 2023 23:44:41 +0000 (12:44 +1300)] 
selftest: Fix typo

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:samba_dnsupdate: Avoid resource leaks
Joseph Sutton [Mon, 20 Feb 2023 22:45:11 +0000 (11:45 +1300)] 
s4:samba_dnsupdate: Avoid resource leaks

View with 'git show -b'.

The seek(0) call is unnecessary.

Closing a file removes the lock held on it.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:samba_spnupdate: Avoid resource leak
Joseph Sutton [Mon, 20 Feb 2023 22:44:07 +0000 (11:44 +1300)] 
s4:samba_spnupdate: Avoid resource leak

View with 'git show -b'.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopython/samba: Avoid resource leak
Joseph Sutton [Mon, 20 Feb 2023 22:42:27 +0000 (11:42 +1300)] 
python/samba: Avoid resource leak

View with 'git show -b'.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoselftest: Don't use invalid escape sequences
Joseph Sutton [Mon, 20 Feb 2023 22:41:34 +0000 (11:41 +1300)] 
selftest: Don't use invalid escape sequences

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba_version.py: Avoid resource leak
Joseph Sutton [Mon, 20 Feb 2023 22:38:54 +0000 (11:38 +1300)] 
samba_version.py: Avoid resource leak

View with 'git show -b'.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agowscript: Fix invalid escape sequences
Joseph Sutton [Thu, 2 Mar 2023 03:43:26 +0000 (16:43 +1300)] 
wscript: Fix invalid escape sequences

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3:modules: Fix invalid escape sequences
Joseph Sutton [Thu, 2 Mar 2023 03:42:47 +0000 (16:42 +1300)] 
s3:modules: Fix invalid escape sequences

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoselftest: Fix invalid escape sequences
Joseph Sutton [Mon, 20 Feb 2023 20:51:08 +0000 (09:51 +1300)] 
selftest: Fix invalid escape sequences

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolib:pyldb: Throw error on invalid controls
Joseph Sutton [Mon, 16 Jan 2023 23:33:17 +0000 (12:33 +1300)] 
lib:pyldb: Throw error on invalid controls

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolib:ldb: Fix typo
Joseph Sutton [Mon, 16 Jan 2023 22:19:19 +0000 (11:19 +1300)] 
lib:ldb: Fix typo

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:dnsserver: Check all records, not just one
Joseph Sutton [Sun, 15 Jan 2023 19:17:38 +0000 (08:17 +1300)] 
s4:dnsserver: Check all records, not just one

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agonsswitch: Fix CID 1518966 Resource leaks (RESOURCE_LEAK)
Joseph Sutton [Mon, 9 Jan 2023 02:12:45 +0000 (15:12 +1300)] 
nsswitch: Fix CID 1518966 Resource leaks (RESOURCE_LEAK)

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4-dsdb: Make array static
Joseph Sutton [Thu, 22 Dec 2022 04:15:56 +0000 (17:15 +1300)] 
s4-dsdb: Make array static

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests: Fix old-style function definitions
Joseph Sutton [Thu, 2 Mar 2023 03:36:07 +0000 (16:36 +1300)] 
tests: Fix old-style function definitions

These files are included into the source3/wscript configure
checks and so need to avoid C89 features otherwise they
may cause an incorrect configure failure.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosource3/wscript: Fix configure-time checks
Joseph Sutton [Wed, 2 Nov 2022 01:57:03 +0000 (14:57 +1300)] 
source3/wscript: Fix configure-time checks

Compilers are getting strict about this C89 behaviour and this
kind of thing is already causing some configure checks to fail with
modern compilers like clang.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Fix typo
Joseph Sutton [Wed, 1 Mar 2023 00:32:21 +0000 (13:32 +1300)] 
tests/krb5: Fix typo

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Add tests adding a user to a group prior to a TGS-REQ
Joseph Sutton [Fri, 24 Feb 2023 00:12:44 +0000 (13:12 +1300)] 
tests/krb5: Add tests adding a user to a group prior to a TGS-REQ

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Permit modifying claim attributes mid-test
Joseph Sutton [Tue, 21 Feb 2023 02:44:43 +0000 (15:44 +1300)] 
tests/krb5: Permit modifying claim attributes mid-test

We might want to find out what happens to claim values in the PAC if
they change in the database.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Split out setup_claims()
Joseph Sutton [Tue, 21 Feb 2023 02:44:14 +0000 (15:44 +1300)] 
tests/krb5: Split out setup_claims()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Generate more readable string representation
Joseph Sutton [Tue, 21 Feb 2023 01:00:16 +0000 (14:00 +1300)] 
tests/krb5: Generate more readable string representation

This makes assertion failure messages easier to decipher.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Add map_to_dn()
Joseph Sutton [Mon, 20 Feb 2023 23:06:00 +0000 (12:06 +1300)] 
tests/krb5: Add map_to_dn()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Refactor out map_to_sid()
Joseph Sutton [Mon, 20 Feb 2023 23:07:40 +0000 (12:07 +1300)] 
tests/krb5: Refactor out map_to_sid()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Avoid duplicate group members
Joseph Sutton [Mon, 20 Feb 2023 23:04:38 +0000 (12:04 +1300)] 
tests/krb5: Avoid duplicate group members

Decode the existing members into strings, so that if we add additional
members (that will also be strings), we won't try to add duplicates (and
have samdb.modify() fail).

Further, ensure callers don't try to pass in a bytes object for the DN.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Move ticket_with_sids() to base class
Joseph Sutton [Mon, 20 Feb 2023 02:19:01 +0000 (15:19 +1300)] 
tests/krb5: Move ticket_with_sids() to base class

We need to use this in another test.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Support nested SID structures in map_sids()
Joseph Sutton [Mon, 20 Feb 2023 02:08:21 +0000 (15:08 +1300)] 
tests/krb5: Support nested SID structures in map_sids()

The passed-in set of SIDs may now contain frozensets that themselves
contain SIDs, enabling nested groups. This is necessary to test how
resource SIDs are grouped together in the device info structure.

'git show -b' shows that we're not actually changing very much.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Move some utility functions from group_tests to base class
Joseph Sutton [Mon, 20 Feb 2023 01:30:49 +0000 (14:30 +1300)] 
tests/krb5: Move some utility functions from group_tests to base class

We'll want to make use of them later.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Remove unused constant
Joseph Sutton [Mon, 20 Feb 2023 01:31:36 +0000 (14:31 +1300)] 
tests/krb5: Remove unused constant

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Refactor setup_groups() to admit multiple preexisting principals and...
Joseph Sutton [Mon, 20 Feb 2023 01:16:31 +0000 (14:16 +1300)] 
tests/krb5: Refactor setup_groups() to admit multiple preexisting principals and primary groups

instead of hardcoded user and trust user principals, and a single
primary group.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Fix typo
Joseph Sutton [Mon, 20 Feb 2023 00:47:16 +0000 (13:47 +1300)] 
tests/krb5: Fix typo

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Fix typo
Joseph Sutton [Mon, 30 Jan 2023 22:53:13 +0000 (11:53 +1300)] 
tests/krb5: Fix typo

'of', not 'on'.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Refactor claims tests to use get_target()
Joseph Sutton [Wed, 11 Jan 2023 01:17:53 +0000 (14:17 +1300)] 
tests/krb5: Refactor claims tests to use get_target()

This simplifies the code for getting the credentials of the target
service.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Move get_target() to base class
Joseph Sutton [Wed, 11 Jan 2023 01:17:41 +0000 (14:17 +1300)] 
tests/krb5: Move get_target() to base class

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Remove client_as_etypes parameter
Joseph Sutton [Mon, 11 Oct 2021 01:53:21 +0000 (14:53 +1300)] 
tests/krb5: Remove client_as_etypes parameter

The client_as_etypes parameter previously indicated which etypes we
thought the client supported. In practice, this was rarely specified, so
we simply assumed that all three main enctypes were supported.

Now that we have removed this parameter, rewrite the etype-info padata
checking code to be simpler, and no longer to contain loops.

Use get_default_enctypes() to determine which enctypes are supported.
For tests that inherit from KDCBaseTest, this is based on the domain
functional level, and will be more correct for tests that previously
passed in client_as_etypes=None.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Request only supported encryption types in get_tgt()
Joseph Sutton [Thu, 2 Mar 2023 01:46:27 +0000 (14:46 +1300)] 
tests/krb5: Request only supported encryption types in get_tgt()

If the domain uses functional level 2003, calling get_tgt() would
request an AES256-encrypted ticket. The KDC would respond to that
request with incorrect etype-info, and were it not for many tests lying
(via client_as_etypes) about what etypes were supported, those tests
would fail pointlessly.

As this behaviour is not what get_tgt() is intended to test, we now only
request etypes that are actually supported.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Lazily fetch SamDB in get_default_enctypes()
Joseph Sutton [Thu, 2 Mar 2023 01:45:40 +0000 (14:45 +1300)] 
tests/krb5: Lazily fetch SamDB in get_default_enctypes()

There's no need to get a connection to SamDB if we already have the
domain functional level.

connect_kdc() in lockout_tests.py is one place where we already have the
domain functional level, but deliberately drop our SamDB connection. If
we need to call get_default_enctypes(), that shouldn't cause us to try
to connect again.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agotests/krb5: Refactor decode_service_ticket()
Joseph Sutton [Mon, 18 Oct 2021 01:29:29 +0000 (14:29 +1300)] 
tests/krb5: Refactor decode_service_ticket()

TicketDecryptionKey_from_creds() is a simpler way to create the key.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:torture:basic: use milliseconds granularity in delayed_write_update7
Amir Goldstein [Thu, 9 Feb 2023 09:39:21 +0000 (11:39 +0200)] 
s4:torture:basic: use milliseconds granularity in delayed_write_update7

The test sets an mtime with non zero nsec and verifies that
the timestamp of pre-close matches the timestamp after close-open.

This is a regression test for
https://bugzilla.samba.org/show_bug.cgi?id=6529

The bug speaks of loosing the milliseconds part of the timestamp,
but the test uses a value of 103*100ns for the sub-second part.

Meaning that if the backing filesystem has only milliseconds
granularity, the test practically checks that a value of
0 milliseconds is preserved, which will not have actually
caught the bug.

Also, with the default 'smbd getinfo ask sharemode = yes'
the test will fail if the filesystem truncates the sub-second part
to milliseconds granularity.

Use a non-zero milliseconds value with zero microseconds in the test
to support backing filesystems with milliseconds granularity.

Signed-off-by: Amir Goldstein <amir@ctera.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Mar  1 20:55:47 UTC 2023 on atb-devel-224

3 years agolib: add NTTIME_[U|m]SEC macros
Amir Goldstein [Tue, 28 Feb 2023 11:53:03 +0000 (12:53 +0100)] 
lib: add NTTIME_[U|m]SEC macros

Signed-off-by: Amir Goldstein <amir@ctera.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos4:torture:basic: fix SET_INFO_* macros in delayed_write_update*
Amir Goldstein [Thu, 9 Feb 2023 09:39:21 +0000 (11:39 +0200)] 
s4:torture:basic: fix SET_INFO_* macros in delayed_write_update*

The macros were ignoring the finfo argument.

Signed-off-by: Amir Goldstein <amir@ctera.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3:winbind: Improve warning message if we are out of autorid ranges
Andreas Schneider [Mon, 27 Feb 2023 11:14:41 +0000 (12:14 +0100)] 
s3:winbind: Improve warning message if we are out of autorid ranges

The message should help our users to understand what's the problem. The
message was rather cryptic before.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Feb 28 14:18:32 UTC 2023 on atb-devel-224

3 years agos3:utils: Check if the autorid rangesize is a multiple of the range
Andreas Schneider [Mon, 27 Feb 2023 09:01:16 +0000 (10:01 +0100)] 
s3:utils: Check if the autorid rangesize is a multiple of the range

We also have this in our documentation.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agosmbd: Fix case normalization in for directories
Volker Lendecke [Fri, 17 Feb 2023 09:02:37 +0000 (10:02 +0100)] 
smbd: Fix case normalization in for directories

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15313
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Feb 24 08:46:14 UTC 2023 on atb-devel-224

3 years agotests: Show that the case sensitive large dir optimization is broken
Volker Lendecke [Fri, 17 Feb 2023 14:41:12 +0000 (15:41 +0100)] 
tests: Show that the case sensitive large dir optimization is broken

We don't normalize the directories

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15313
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotests: Move libsmb-basic to fileserver_smb1 environment
Volker Lendecke [Fri, 17 Feb 2023 14:40:30 +0000 (15:40 +0100)] 
tests: Move libsmb-basic to fileserver_smb1 environment

This has the lower-case share, used in the next commit

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15313
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agodoc/vfs_ceph: document ceph:filesystem parameter
John Mulligan [Wed, 15 Feb 2023 21:09:48 +0000 (16:09 -0500)] 
doc/vfs_ceph: document ceph:filesystem parameter

Document how the `ceph:filesystem` parameter allows one to select
the cephfs file system to use for the share.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Feb 24 05:37:57 UTC 2023 on atb-devel-224

3 years agodoc/vfs_ceph: update confusing default hint for ceph:user_id param
John Mulligan [Wed, 15 Feb 2023 21:04:07 +0000 (16:04 -0500)] 
doc/vfs_ceph: update confusing default hint for ceph:user_id param

Previously, the manpage hinted that the `ceph:user_id` parameter derived
a default value from the process id. This implies that it referring
to the PID but this is not what libcephfs actually does. Rather, this
param is used to derive the `client.<id>` authorization name ceph uses.
This mistake probably originates in a comment in the libcephfs header.

When I first started using the vfs_ceph module this confused me as I
didn't know what to use to get access to my cluster. Eventually, after
reading both docs and code I found that it does not use the pid but
defaults to a value in the ceph client library (typically "admin").

Therefore, if you are using commands like `ceph fs authorize x
client.foo` or `ceph auth get client.bar` to authorize a client you
would supply smb.conf with `ceph:user_id = foo` or `ceph:user_id = bar`
respectively.  These entries then need corresponding entries in your
ceph keyring file.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 years agovfs_ceph: add support to select ceph file system
John Mulligan [Wed, 15 Feb 2023 20:21:43 +0000 (15:21 -0500)] 
vfs_ceph: add support to select ceph file system

Add a config parameter `ceph:filesystem` that will be passed to
ceph_select_filesystem when provided. This allows shares on a single
smbd to access multiple different cephfs file systems.

The ceph_select_filesystem call was added as part of ceph 'nautilus'
(v14), released on 2019-03-19 and EOLed on 2021-06-30.
Since ceph 'pacific' (v16) multiple file system support is stable
and ready to use. At the time of this commit, 'pacific' is the oldest
actively supported version of ceph upstream.

Since samba tests building on ubntu 18.04, which has ceph packages
older than v14, a waf check for the function is added to test for
the presence of ceph_select_filesystem and disable its use on
these very old platforms.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 years agovfs_ceph: cache ceph mounts based on share configuration params
John Mulligan [Wed, 15 Feb 2023 20:12:12 +0000 (15:12 -0500)] 
vfs_ceph: cache ceph mounts based on share configuration params

Previously, the vfs_ceph module kept one global cached mount.
This makes it impossible to support multiple ceph clusters or
file systems. Add a mount cache in a similar fashion to the connection
cache found in the vfs_glusterfs module. The vfs_ceph cache uses
a single "cookie" value, a unique string based on config params, to
ID the cache entry. Shares that produce the same cookie will share
cephfs mount objects and increment a counter when multiple shares
are using the same cache entry.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 years agovfs_ceph: split ceph mount logic into a new function
John Mulligan [Wed, 15 Feb 2023 19:22:00 +0000 (14:22 -0500)] 
vfs_ceph: split ceph mount logic into a new function

This new function is entirely dedicated to just setting up a libcephfs
mount. Handling the cmount global and samba connection params remains
in cephwrap_connect. This change will later be used to avoid a single
global cached connection and add improved connection handling.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 years agopython: fix mutable default arguments
Rob van der Linde [Thu, 23 Feb 2023 02:54:37 +0000 (15:54 +1300)] 
python: fix mutable default arguments

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 23 23:33:46 UTC 2023 on atb-devel-224

3 years agoselftest: source3: fix mutable default arguments
Rob van der Linde [Thu, 23 Feb 2023 02:54:21 +0000 (15:54 +1300)] 
selftest: source3: fix mutable default arguments

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agoselftest: source4: fix mutable default arguments
Rob van der Linde [Thu, 23 Feb 2023 02:53:58 +0000 (15:53 +1300)] 
selftest: source4: fix mutable default arguments

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agobuildtools: fix mutable default arguments
Rob van der Linde [Thu, 23 Feb 2023 02:52:21 +0000 (15:52 +1300)] 
buildtools: fix mutable default arguments

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agoselftest: fix mutable default arguments
Rob van der Linde [Thu, 23 Feb 2023 02:51:48 +0000 (15:51 +1300)] 
selftest: fix mutable default arguments

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agoselftest: fix typo in test comment
Rob van der Linde [Thu, 23 Feb 2023 02:50:53 +0000 (15:50 +1300)] 
selftest: fix typo in test comment

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agoselftest: fix scope and attrs not passed to search
Rob van der Linde [Thu, 23 Feb 2023 02:49:11 +0000 (15:49 +1300)] 
selftest: fix scope and attrs not passed to search

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agoselftest: fix invalid loop variables uid and gid
Rob van der Linde [Thu, 23 Feb 2023 02:46:43 +0000 (15:46 +1300)] 
selftest: fix invalid loop variables uid and gid

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agoselftest: fix flapping samba-tool drs showrepl test
Rob van der Linde [Thu, 23 Feb 2023 03:56:30 +0000 (16:56 +1300)] 
selftest: fix flapping samba-tool drs showrepl test

Test should have been using "schema_pair_dc", it was picking this up from the variable env in the loop above it.

However, it was hardcoded to use promoted_dc.

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

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agoselftest: make two samba-tool drs tests generic
Rob van der Linde [Thu, 23 Feb 2023 03:56:07 +0000 (16:56 +1300)] 
selftest: make two samba-tool drs tests generic

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

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agoselftest: specify env rather than picking it up from loop
Rob van der Linde [Thu, 23 Feb 2023 03:18:42 +0000 (16:18 +1300)] 
selftest: specify env rather than picking it up from loop

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agoselftest: remove unused import
Rob van der Linde [Wed, 22 Feb 2023 22:54:16 +0000 (11:54 +1300)] 
selftest: remove unused import

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