]>
git.ipfire.org Git - thirdparty/samba.git/log
Björn Baumbach [Wed, 20 Nov 2024 16:10:12 +0000 (17:10 +0100)]
samba-tool user disable: rename filter variable to search_filter
filter() is a Python built-in function to filter iterables.
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jule Anger <janger@samba.org>
Björn Baumbach [Wed, 20 Nov 2024 16:03:24 +0000 (17:03 +0100)]
samba-tool user disable: set proper --filter option description
Seems to be copied from samba-tool user setpassword command.
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jule Anger <janger@samba.org>
Björn Baumbach [Tue, 26 Nov 2024 16:47:30 +0000 (17:47 +0100)]
samba-tool group removemembers: avoid python backtrace on error
Pair-programmed-with: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Björn Baumbach <bb@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jule Anger <janger@samba.org>
Björn Baumbach [Fri, 22 Nov 2024 21:35:29 +0000 (22:35 +0100)]
python/samdb: no need to set member_base_dn multiple times
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jule Anger <janger@samba.org>
Björn Baumbach [Tue, 26 Nov 2024 14:46:02 +0000 (15:46 +0100)]
python/samdb: fix group member removal by SID
Otherwise the removal of groupmembers by SID fails silently, because the
DN does not match the the DN in group member list.
Pair-programmed-with: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jule Anger <janger@samba.org>
Björn Baumbach [Mon, 25 Nov 2024 13:05:40 +0000 (14:05 +0100)]
python/samdb: fix check which checks if user is already member of group
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jule Anger <janger@samba.org>
Björn Baumbach [Wed, 20 Nov 2024 22:28:51 +0000 (23:28 +0100)]
python/samdb: rename filter variable to search_filter
filter() is a Python built-in function to filter iterables.
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jule Anger <janger@samba.org>
Björn Baumbach [Wed, 20 Nov 2024 20:33:49 +0000 (21:33 +0100)]
python/samdb: add missing function parameter description
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jule Anger <janger@samba.org>
Björn Baumbach [Wed, 18 Sep 2024 17:22:29 +0000 (19:22 +0200)]
python/samdb: fix attribute name in parameter description
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jule Anger <janger@samba.org>
Andreas Schneider [Wed, 22 Jan 2025 14:37:07 +0000 (15:37 +0100)]
third_party: Update socket_wrapper to version 1.4.4
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jan 23 11:28:32 UTC 2025 on atb-devel-224
Andreas Schneider [Tue, 21 Jan 2025 16:59:27 +0000 (17:59 +0100)]
lib:replace: Don't use deprecated readline CPPFunction cast
HAVE_RL_COMPLETION_FUNC_T was unused and not checking for the right
function.
libcli/smbreadline/smbreadline.c: In function ‘smb_readline’:
libcli/smbreadline/smbreadline.c:139:17: warning: ‘CPPFunction’ is deprecated [-Wdeprecated-declarations]
139 | rl_attempted_completion_function = RL_COMPLETION_CAST completion_fn;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libcli/smbreadline/smbreadline.c:139:50: error: assignment to ‘char ** (*)(const char *, int, int)’ from incompatible pointer type ‘char ** (*)(void)’ [-Wincompatible-pointer-types]
139 | rl_attempted_completion_function = RL_COMPLETION_CAST completion_fn;
| ^
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15788
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): Tue Jan 21 19:38:37 UTC 2025 on atb-devel-224
Andreas Schneider [Tue, 21 Jan 2025 16:59:12 +0000 (17:59 +0100)]
lib:replace: Remove trailing spaces from readline.h
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15788
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Volker Lendecke [Sun, 19 Jan 2025 16:27:56 +0000 (17:27 +0100)]
vfs_fruit: Fix
63f0b59cbed
After 30 years of coding C, pointers and macros are still error-prone :-(
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Jan 20 08:00:24 UTC 2025 on atb-devel-224
Andreas Schneider [Fri, 17 Jan 2025 12:28:30 +0000 (13:28 +0100)]
lib:util: Fix stack-use-after-return in crypt_as_best_we_can()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15784
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Fri Jan 17 23:21:13 UTC 2025 on atb-devel-224
Shachar Sharon [Tue, 14 Jan 2025 09:46:05 +0000 (11:46 +0200)]
vfs_ceph_new: add smbprofile for async-ops
Commit
fcd3fc34b2ec5e ("vfs_ceph_new: add profiling support") added
PROFILE accounting for non-async VFS hooks. Add also SMBPROFILE for
async (read/write/fsync) hooks.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15703
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Jan 17 16:47:28 UTC 2025 on atb-devel-224
Jeremy Allison [Fri, 17 Jan 2025 00:12:31 +0000 (16:12 -0800)]
auth: Cleanup exit code paths in kerberos_decode_pac().
One more memory leak missed and now fixed. tmp_ctx
must be freed once the pac data is talloc_move'd.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15782
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Jan 17 12:01:47 UTC 2025 on atb-devel-224
Jeremy Allison [Wed, 15 Jan 2025 18:21:19 +0000 (10:21 -0800)]
auth: Add missing talloc_free() in error code path.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15782
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Jan 16 14:32:39 UTC 2025 on atb-devel-224
Stefan Metzmacher [Sat, 23 Jul 2022 22:46:06 +0000 (00:46 +0200)]
s3:winbindd: split our wb_gettoken_trybuiltins() helper
This makes the logical steps a bit cleaner and future changes easier.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jan 15 14:00:28 UTC 2025 on atb-devel-224
Stefan Metzmacher [Sat, 23 Jul 2022 22:44:07 +0000 (00:44 +0200)]
s3:winbindd: split out wb_gettoken_trylocalgroups() function
This makes the logical steps a bit cleaner and future changes easier.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Fri, 22 Jul 2022 13:15:56 +0000 (15:15 +0200)]
s3:winbindd: add winbindd_domain_verify_sid() helper
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Fri, 22 Jul 2022 13:15:02 +0000 (15:15 +0200)]
s3:winbindd: consistently use add_sid_to_array_unique() in winbindd_ads.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Tue, 26 Jul 2022 08:52:19 +0000 (10:52 +0200)]
s3:winbindd: use struct initializers for all struct winbindd_methods cases
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Wed, 15 Jan 2025 11:41:21 +0000 (12:41 +0100)]
s3:auth: let check_sam_security() add NETLOGON_NTLMV2_ENABLED
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15783
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Wed, 15 Jan 2025 10:57:12 +0000 (11:57 +0100)]
s4:auth/ntlm: let authsam_check_password_internals() add NETLOGON_NTLMV2_ENABLED
Windows returns NETLOGON_NTLMV2_ENABLED in all
netr_LogonSamLogon* response messages.
Even if NTLMv1 was actually used and also
for password authentication.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15783
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Wed, 15 Jan 2025 11:22:34 +0000 (12:22 +0100)]
python:tests/krb5: let netlogon.py check for NETLOGON_NTLMV2_ENABLED
It's there for network_samlogon and interactive_samlogon,
but not in ticket_samlogon.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15783
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Wed, 8 Jan 2025 09:49:42 +0000 (10:49 +0100)]
selftest: force 'client use krb5 netlogon = yes' for admem_idmap_autorid
With 'reject aes netlogon servers = yes' we prevent any fallback.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan 14 00:37:34 UTC 2025 on atb-devel-224
Stefan Metzmacher [Mon, 11 Nov 2024 18:32:48 +0000 (19:32 +0100)]
s4:torture/rpc: add rpc.pac tests with DCERPC_SCHANNEL_KRB5/ServerAuthenticateKerberos()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 27 Nov 2024 11:32:27 +0000 (12:32 +0100)]
selftest: add 'server support krb5 netlogon = yes' for fl2008r2dc
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 27 Nov 2024 11:21:57 +0000 (12:21 +0100)]
s4:torture/rpc: let rpc.samlogon also test DCERPC_SCHANNEL_KRB5/ServerAuthenticateKerberos()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 27 Nov 2024 11:17:27 +0000 (12:17 +0100)]
s4:torture/rpc: let rpc.samlogon test credential_flags again...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Fri, 8 Nov 2024 14:56:45 +0000 (15:56 +0100)]
s4:torture/rpc: let rpc.schannel also use of DCERPC_SCHANNEL_KRB5
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Mon, 11 Nov 2024 19:30:25 +0000 (20:30 +0100)]
s4:torture/rpc: prepare test_lsa_ops for ServerAuthenticateKerberos
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Mon, 11 Nov 2024 19:26:55 +0000 (20:26 +0100)]
s4:torture/rpc: use expected_{account,authority}_name variables in test_lsa_ops
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 27 Nov 2024 11:21:12 +0000 (12:21 +0100)]
s4:torture/rpc: prepare netlogon tests for ServerAuthenticateKerberos
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 27 Nov 2024 11:18:36 +0000 (12:18 +0100)]
s4:torture/rpc: prepare lsa lookup tests for ServerAuthenticateKerberos
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 27 Nov 2024 11:15:42 +0000 (12:15 +0100)]
s4:torture/rpc: make more use of netlogon_creds_client_verify()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Fri, 8 Nov 2024 16:48:31 +0000 (17:48 +0100)]
s4:librpc/rpc: implement DCERPC_SCHANNEL_KRB5
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Thu, 7 Nov 2024 19:00:08 +0000 (20:00 +0100)]
s3:tests: let test_update_keytab.sh use rpc changetrustpw --server
If we pass the server name via -I/--ipaddress means we internally loose
the server name and fail to use kerberos with just the ip address.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Thu, 7 Nov 2024 18:09:26 +0000 (19:09 +0100)]
python:tests: let s3_net_join.py avoid kerberos_state=DONT_USE_KERBEROS
We may use ServerAuthenticateKerberos in future and that needed to
use kerberos.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Thu, 7 Nov 2024 17:31:25 +0000 (18:31 +0100)]
testprogs/blackbox: let test_rpcclient_schannel.sh explicitly use --option=clientusekrb5netlogon
This also tests lsa over kerberos
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Thu, 7 Nov 2024 16:37:05 +0000 (17:37 +0100)]
python:tests: let auth_log.py also test --option=clientusekrb5netlogon=yes
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Thu, 7 Nov 2024 15:41:00 +0000 (16:41 +0100)]
python:tests: let auth_log.py explicitly use --option=clientusekrb5netlogon=no
It also add some additional checks to make sure netlogon with AES was
used.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Thu, 7 Nov 2024 15:37:56 +0000 (16:37 +0100)]
python:tests: let auth_log.py use self.assertIn(received, [4, 5]
This will simplify further changes.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 27 Nov 2024 11:32:27 +0000 (12:32 +0100)]
selftest: add 'server support krb5 netlogon = yes' for ad_dc_ntvfs
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Fri, 6 Sep 2024 12:07:15 +0000 (14:07 +0200)]
libcli/auth: add support for ServerAuthenticateKerberos()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 6 Nov 2024 13:00:58 +0000 (14:00 +0100)]
s3:winbindd: split out cm_connect_schannel_or_krb5() helper
This will allow us to use ServerAuthenticateKerberos() later.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 30 Oct 2024 11:13:36 +0000 (12:13 +0100)]
s3:cli_netlogon: prepare for netr_ServerAuthenticateKerberos()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 27 Nov 2024 09:59:58 +0000 (10:59 +0100)]
s3:winbindd: use GENSEC_FEATURE_NO_DELEGATION for trust credentials for netlogon
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 27 Nov 2024 09:59:58 +0000 (10:59 +0100)]
s3:rpcclient: use GENSEC_FEATURE_NO_DELEGATION for trust credentials
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 27 Nov 2024 09:59:58 +0000 (10:59 +0100)]
s3:libnet_join: use GENSEC_FEATURE_NO_DELEGATION for trust credentials
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 30 Oct 2024 11:13:36 +0000 (12:13 +0100)]
s3:cli_netlogon: use GENSEC_FEATURE_NO_DELEGATION for trust credentials
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Fri, 6 Sep 2024 12:07:15 +0000 (14:07 +0200)]
libcli/auth: add netlogon_creds_cli_use_kerberos() helper
This allows the calling code to decide if a krb5 or anonymous
netlogon connection should be tried.
Currently we don't try ServerAuthenticateKerberos, but that will change
in a few commits. But before we need to prepare the callers...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Thu, 7 Nov 2024 12:25:37 +0000 (13:25 +0100)]
docs-xml/smbdotconf: add "client use krb5 netlogon" option
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Thu, 7 Nov 2024 11:41:05 +0000 (12:41 +0100)]
docs-xml/smbdotconf: add "reject aes netlogon servers" option
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Thu, 31 Oct 2024 17:32:52 +0000 (18:32 +0100)]
s3:libads: prepare trust_pw_change() for ServerAuthenticateKerberos()
We use kerberos_kinit_passwords_ext() to check the password before
and after ServerPasswordSet2() as ServerAuthenticateKerberos()
does not check it. We use the ip address of the dcerpc connection
in order to use a fixed KDC, so that we talk to the same server
that also received the ServerPasswordSet2().
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Tue, 5 Nov 2024 11:42:37 +0000 (12:42 +0100)]
s3:libads: rename variables in trust_pw_change()
We'll have more than nt_hashes soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Shweta Sodani [Thu, 2 Jan 2025 13:42:08 +0000 (19:12 +0530)]
vfs_ceph_new: add profiling support
Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Jan 13 21:26:34 UTC 2025 on atb-devel-224
Vinit Agnihotri [Tue, 3 Dec 2024 05:51:09 +0000 (11:21 +0530)]
sharesec: Check if share exists in configuration
Load config from registry without share info and check if sharename
exists from configuration. This results into lesser delay for the same.
In case of view we load config with all shares to ensure we get all
shares for diplay purpose.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15780
Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: John Mulligan <jmulligan@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Jan 10 10:45:30 UTC 2025 on atb-devel-224
Vinit Agnihotri [Tue, 3 Dec 2024 05:49:09 +0000 (11:19 +0530)]
sharesec: Add function to check existence of share from config
Add function to detect if a share name exists in the registry or config file.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15780
Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: John Mulligan <jmulligan@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Vinit Agnihotri [Tue, 3 Dec 2024 05:42:34 +0000 (11:12 +0530)]
param: Add API to load registry without share info
As number of shares increases loading entire registry configuration along with
share information becomes very costly operation.
Since we may not require share information all time, we can optimise
this by using API just loading configuration without any share info.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15780
Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: John Mulligan <jmulligan@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Vinit Agnihotri [Thu, 12 Dec 2024 13:35:24 +0000 (19:05 +0530)]
sharesec: Fix warning frame not freed in order
This change should fix following warning:
Freed frame ../../source3/utils/sharesec.c:515, expected ../../source3/utils/sharesec.c:637
Frame was not getting freed in case of servicename is NULL.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15780
Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: John Mulligan <jmulligan@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Guenther Deschner [Wed, 11 Dec 2024 10:03:47 +0000 (15:33 +0530)]
s3-sharesec: Add Test to verify command option "--view-all"
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15780
Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: John Mulligan <jmulligan@samba.org>
Stefan Metzmacher [Thu, 19 Dec 2024 12:34:18 +0000 (13:34 +0100)]
s4:selftest: samba.tests.krb5.netlogon don't need explicit FAST_SUPPORT
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jan 8 10:16:50 UTC 2025 on atb-devel-224
Stefan Metzmacher [Mon, 16 Dec 2024 17:11:31 +0000 (18:11 +0100)]
python:tests/krb5: let netlogon.py test referral ticket for SEC_CHAN_DNS_DOMAIN
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Mon, 16 Dec 2024 14:12:21 +0000 (15:12 +0100)]
python:tests/krb5: allow get_service_ticket to accept a trust referral ticket without kvno
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Mon, 16 Dec 2024 14:51:34 +0000 (15:51 +0100)]
python:tests/krb5: allow tickets without a kvno
This is needed for trust referrals.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 18 Dec 2024 13:59:06 +0000 (14:59 +0100)]
python:tests/krb5: let netlogon.py export changed passwords to keytab
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Mon, 16 Dec 2024 14:18:54 +0000 (15:18 +0100)]
python:tests/krb5: add domain trust tests to netlogon.py
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Mon, 2 Dec 2024 07:48:32 +0000 (08:48 +0100)]
python:tests/krb5: add a create_trust() helper function to test trusted domains
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 18 Dec 2024 10:44:27 +0000 (11:44 +0100)]
python:tests/krb5: allow exporting a keytab file of the accounts used by the tests
EXPORT_KEYTAB_FILE=/dev/shm/export.keytab
EXPORT_KEYTAB_APPEND=0 or 1
EXPORT_EXISTING_CREDS_TO_KEYTAB=0 or 1
EXPORT_GIVEN_CREDS_TO_KEYTAB=0 or 1
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Mon, 16 Dec 2024 12:47:34 +0000 (13:47 +0100)]
python:tests/krb5: add KerberosCredentials.[g|s]et_trust_{incoming,outgoing,account}_creds
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Sat, 14 Dec 2024 16:51:44 +0000 (17:51 +0100)]
pycredentials: add [g|s]et_old_nt_hash()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Fri, 13 Dec 2024 15:11:34 +0000 (16:11 +0100)]
s4:rpc_server/netlogon: fix error codes for netr_NetrLogonSendToSam() with SEC_CHAN_RODC
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Fri, 13 Dec 2024 15:01:27 +0000 (16:01 +0100)]
s4:rpc_server/netlogon: an RODC is not allowed to call netr_ServerPasswordGet()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Fri, 13 Dec 2024 14:46:02 +0000 (15:46 +0100)]
python:tests/krb5: let netlogon.py run the tests also as rodc
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Fri, 13 Dec 2024 14:44:43 +0000 (15:44 +0100)]
python:tests/krb5: allow netlogon.py tests to work against a KDC with claims enabled
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Fri, 13 Dec 2024 14:42:37 +0000 (15:42 +0100)]
python:tests/krb5: allow get_mock_rodc_krbtgt_creds(preserve=False) to create a tmp rodc
This also exposes credentials for the machine account for netlogon
testing.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Wed, 18 Dec 2024 13:57:06 +0000 (14:57 +0100)]
python:tests/krb5: fix etypes_to_test values in RawKerberosTest
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Thu, 12 Dec 2024 15:26:23 +0000 (16:26 +0100)]
s4:rpc_server/netlogon: fill netlogon_creds_CredentialState->tdo_guid
This will help us to lookup the tdo object using a <GUID=TDO-GUID>
search base.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Thu, 12 Dec 2024 15:09:50 +0000 (16:09 +0100)]
schannel.idl: add tdo_guid to netlogon_creds_CredentialState
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Stefan Metzmacher [Tue, 7 Jan 2025 13:06:43 +0000 (14:06 +0100)]
s4:dsdb: fix logic of dsdb_trust_routing_by_name()
We need to use the longest dnsname match as possible.
If we are the domain samba.example.com and have a trust
to example.com, a routing request for dc.samba.example.com
should return the tdo for samba.example.com instead
of example.com.
I reproduced the problem with the following diff:
> diff --git a/selftest/target/Samba.pm b/selftest/target/Samba.pm
> index
15d7692b5d64 ..
6e9595b784c4 100644
> --- a/selftest/target/Samba.pm
> +++ b/selftest/target/Samba.pm
> @@ -564,7 +564,7 @@ sub realm_to_ip_mappings
> 'samba2000.example.com' => 'dc5',
> 'samba2003.example.com' => 'dc6',
> 'samba2008r2.example.com' => 'dc7',
> - 'addom.samba.example.com' => 'addc',
> + 'addom.samba2008r2.example.com' => 'addc',
> 'addom2.samba.example.com' => 'addcsmb1',
> 'sub.samba.example.com' => 'localsubdc',
> 'chgdcpassword.samba.example.com' => 'chgdcpass',
> diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
> index
0e4cf50235c3 ..
6bca0cfd0c89 100755
> --- a/selftest/target/Samba4.pm
> +++ b/selftest/target/Samba4.pm
> @@ -2631,7 +2631,7 @@ sub setup_fl2008r2dc
> return undef;
> }
>
> - $env = $self->setup_trust($env, $ad_dc_vars, "forest", "");
> + $env = $self->setup_trust($env, $ad_dc_vars, "forest", "--skip-validation");
> if (!defined $env) {
> return undef;
> }
> @@ -2843,7 +2843,7 @@ sub _setup_ad_dc
> $server = "addc";
> }
> if (!defined($dom)) {
> - $dom = "addom.samba.example.com";
> + $dom = "addom.samba2008r2.example.com";
> }
> my $env = $self->provision_ad_dc($path, $server, "ADDOMAIN",
> $dom,
and running:
make -j testenv SELFTEST_TESTENV="fl2008r2dc:local"
Inside the testenv:
bin/smbclient //addc.addom.samba2008r2.example.com/netlogon \
-U$TRUST_USERNAME@$TRUST_REALM%$TRUST_PASSWORD \
--use-kerberos=required \
-c 'ls'
It lets the KDC of ADDOM.SAMBA2008R2.EXAMPLE.COM to
generate a (referral) ticket for
krbtgt/SAMBA2008R2.EXAMPLE.COM@ADDOM.SAMBA2008R2.EXAMPLE.COM
instead of
cifs/addc.addom.samba2008r2.example.com@ADDOM.SAMBA2008R2.EXAMPLE.COM
As ADDOM.SAMBA2008R2.EXAMPLE.COM has a forest trust (without msDS-TrustForestTrustInfo)
to SAMBA2008R2.EXAMPLE.COM dsdb_trust_update_best_tln() overwrote the
best match of addom.samba2008r2.example.com with samba2008r2.example.com.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15778
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Jan 8 04:14:47 UTC 2025 on atb-devel-224
Ralph Boehme [Thu, 5 Dec 2024 09:26:59 +0000 (10:26 +0100)]
smbd: fill fsp_flas.posix_append in open_file_ntcreate()
This small changes enables the new append-IO machinery.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan 7 23:05:57 UTC 2025 on atb-devel-224
Ralph Boehme [Thu, 28 Nov 2024 11:12:26 +0000 (12:12 +0100)]
tests: test SMB3 POSIX append-IO behaviour
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Fri, 29 Nov 2024 13:09:12 +0000 (14:09 +0100)]
smbd: allow VFS_PWRITE_APPEND_OFFSET in vfs_valid_pwrite_range()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Fri, 22 Nov 2024 18:41:51 +0000 (19:41 +0100)]
smbd: assert fsp->fsp_flags.posix_append and offset in smbd_smb2_write_send()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Fri, 22 Nov 2024 18:40:38 +0000 (19:40 +0100)]
smbd: prepare smb2_write.c for handling a negative offset
Use off_t instead of uint64_t for the offset in order to support negative
offsets coming in over the wire for SMB3 POSIX append-IO which enforces
offset=VFS_PWRITE_APPEND_OFFSET (-1) for all writes.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Fri, 22 Nov 2024 18:38:33 +0000 (19:38 +0100)]
vfs_default: implement POSIX append-IO
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Fri, 29 Nov 2024 13:06:39 +0000 (14:06 +0100)]
s3/lib: use VFS_PWRITE_APPEND_OFFSET in default_sys_recvfile()
Note that splice() itself doesn't work with an O_APPEND outfd:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=
efc968d450e013049a662d22727cf132618dcb2f
Hence for the real splice() codepath itself no changes are needed, as splice
will just fail with EINVAL triggering the fallback code.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Sun, 24 Nov 2024 07:23:36 +0000 (08:23 +0100)]
vfs: implement POSIX append-IO in vfs_pwrite_data()
This basically just avoids clobbering a possible offset=VFS_PWRITE_APPEND_OFFSET
when calling SMB_VFS_PWRITE().
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Sun, 24 Nov 2024 08:27:36 +0000 (09:27 +0100)]
vfs_io_uring: implement POSIX append-IO
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Sun, 24 Nov 2024 07:10:25 +0000 (08:10 +0100)]
vfs_aio_fork: implement POSIX append-IO
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Sun, 24 Nov 2024 07:08:26 +0000 (08:08 +0100)]
lib: add sys_write_full()
Basically a copy of sys_pwrite_full(), calling write() instead of pwrite().
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Fri, 29 Nov 2024 12:04:36 +0000 (13:04 +0100)]
smbd: check for VFS_PWRITE_APPEND_OFFSET in vfs_fill_sparse()
This is the only place a function dealing with allocation and file length being
called from the write IO path. In the case of POSIX append-IO with
offset=VFS_PWRITE_APPEND_OFFSET vfs_fill_sparse() must be a noop.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Fri, 29 Nov 2024 12:00:30 +0000 (13:00 +0100)]
smbd: add vfs_valid_allocation_range() as a copy of vfs_valid_pwrite_range()
Not a copy of the whole code obviously, a copy of behaviour. A subsequent commit
will further change vfs_valid_pwrite_range().
Existing callers of vfs_valid_pwrite_range() that are not calling it in the
write-IO codepath, but when dealing with allocation and size, are converted to
use vfs_valid_allocation_range().
No change in behaviour.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Thu, 28 Nov 2024 07:08:46 +0000 (08:08 +0100)]
s3/pylibsmb: add VFS_PWRITE_APPEND_OFFSET
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Fri, 22 Nov 2024 18:36:18 +0000 (19:36 +0100)]
vfs: add VFS_PWRITE_APPEND_OFFSET
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Fri, 22 Nov 2024 18:36:39 +0000 (19:36 +0100)]
vfs: add fsp_flags.posix_append
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Sat, 9 Nov 2024 15:15:08 +0000 (16:15 +0100)]
smbd: fix access_mask to FILE_APPEND_DATA mapping for POSIX opens
Only use POSIX O_APPEND flag if the client requested FILE_APPEND_DATA without
FILE_WRITE_DATA.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15751
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Mon, 11 Nov 2024 09:39:15 +0000 (10:39 +0100)]
tests: add a test for copy-chunk on a POSIX handle
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15751
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Thu, 5 Dec 2024 09:20:00 +0000 (10:20 +0100)]
tests: use libsmb.unix_mode_to_wire() in smb3unix.py
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15751
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>