]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
2 years agos4:kdc: Fix leak
Joseph Sutton [Tue, 5 Sep 2023 00:28:55 +0000 (12:28 +1200)] 
s4:kdc: Fix leak

Introduce a temporary memory context and allocate working structures on
to it.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Allocate variables on to more suitable memory context
Joseph Sutton [Tue, 5 Sep 2023 00:20:39 +0000 (12:20 +1200)] 
s4:kdc: Allocate variables on to more suitable memory context

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Increment PAC_DEVICE_INFO::domain_group_count only after SID has been success...
Joseph Sutton [Mon, 4 Sep 2023 23:06:50 +0000 (11:06 +1200)] 
s4:kdc: Increment PAC_DEVICE_INFO::domain_group_count only after SID has been successfully added

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Directly zero‐initialize PAC_DOMAIN_GROUP_MEMBERSHIP structure
Joseph Sutton [Mon, 4 Sep 2023 23:04:59 +0000 (11:04 +1200)] 
s4:kdc: Directly zero‐initialize PAC_DOMAIN_GROUP_MEMBERSHIP structure

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Assign RID and attribute together
Joseph Sutton [Mon, 4 Sep 2023 23:02:37 +0000 (11:02 +1200)] 
s4:kdc: Assign RID and attribute together

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Don’t corrupt domain groups structure if talloc_realloc() fails
Joseph Sutton [Mon, 4 Sep 2023 22:44:55 +0000 (10:44 +1200)] 
s4:kdc: Don’t corrupt domain groups structure if talloc_realloc() fails

Introduce a temporary variable instead of assigning the result of
talloc_realloc() directly to samr_RidWithAttributeArray::rids. In this
way we avoid having a structure with a non‐zero ‘count’ but with ‘rids’
set to the NULL pointer.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Check for overflow when adding a domain group SID
Joseph Sutton [Mon, 4 Sep 2023 22:32:26 +0000 (10:32 +1200)] 
s4:kdc: Check for overflow when adding a domain group SID

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Avoid potential use‐after‐free
Joseph Sutton [Mon, 4 Sep 2023 22:28:02 +0000 (10:28 +1200)] 
s4:kdc: Avoid potential use‐after‐free

We must allocate the domain groups on to the correct memory context,
lest they get freed prematurely.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Fix leak
Joseph Sutton [Mon, 4 Sep 2023 22:24:43 +0000 (10:24 +1200)] 
s4:kdc: Fix leak

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Use common exit point for functions
Joseph Sutton [Mon, 4 Sep 2023 22:20:04 +0000 (10:20 +1200)] 
s4:kdc: Use common exit point for functions

This makes it less likely that we forget to clean up resources.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Fix leaks
Joseph Sutton [Mon, 4 Sep 2023 05:00:04 +0000 (17:00 +1200)] 
s4:kdc: Fix leaks

Allocate variables on to a temporary context rather than on to the
potentially long‐lived context passed in by the caller.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Add correct Asserted Identity SID in response to an S4U2Self request
Joseph Sutton [Mon, 4 Sep 2023 01:20:34 +0000 (13:20 +1200)] 
s4:kdc: Add correct Asserted Identity SID in response to an S4U2Self request

I’m not sure exactly how this check was supposed to work. But in any
case, within fast_unwrap_request() the Heimdal KDC replaces the outer
padata with the padata from the inner FAST request. Hence, this check
does not accomplish anything useful: at no point should the KDC plugin
see the outer padata.

A couple of unwanted consequences resulted from this check. One was that
a client who sent empty FX‐FAST padata within the inner FAST request
would receive the *Authentication Authority* Asserted Identity SID
instead of the *Service* Asserted Identity SID. Another consequence was
that a client could in the same manner bypass the restriction on
performing S4U2Self with an RODC‐issued TGT.

Overall, samba_wdc_is_s4u2self_req() is somewhat of a hack. But the
Heimdal plugin API gives us nothing better to work with.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:auth: Fix leaks
Joseph Sutton [Sun, 3 Sep 2023 22:02:41 +0000 (10:02 +1200)] 
s4:auth: Fix leaks

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:auth: Check return values of talloc functions
Joseph Sutton [Sun, 3 Sep 2023 22:02:28 +0000 (10:02 +1200)] 
s4:auth: Check return values of talloc functions

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Prefer explicit initialization to ZERO_STRUCT()
Joseph Sutton [Fri, 1 Sep 2023 01:29:17 +0000 (13:29 +1200)] 
s4:dsdb: Prefer explicit initialization to ZERO_STRUCT()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Parenthesize macro expression
Joseph Sutton [Fri, 1 Sep 2023 01:29:03 +0000 (13:29 +1200)] 
s4:dsdb: Parenthesize macro expression

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:scripting: Prefer ‘x not in y’ to ‘not x in y’
Joseph Sutton [Fri, 1 Sep 2023 01:26:04 +0000 (13:26 +1200)] 
s4:scripting: Prefer ‘x not in y’ to ‘not x in y’

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:scripting: Fix comments
Joseph Sutton [Fri, 1 Sep 2023 01:25:29 +0000 (13:25 +1200)] 
s4:scripting: Fix comments

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Inline samba_get_pac_attrs_blob()
Joseph Sutton [Thu, 31 Aug 2023 00:32:42 +0000 (12:32 +1200)] 
s4:kdc: Inline samba_get_pac_attrs_blob()

A wrapper doesn’t add much utility to a function this small. We might as
well join these two into a single function.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:rpc_server: Fix inverted error messages
Joseph Sutton [Wed, 30 Aug 2023 01:58:18 +0000 (13:58 +1200)] 
s3:rpc_server: Fix inverted error messages

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:tests: Fix invalid escape sequence
Joseph Sutton [Tue, 29 Aug 2023 23:58:18 +0000 (11:58 +1200)] 
python:tests: Fix invalid escape sequence

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:tests: Remove unused variables
Joseph Sutton [Tue, 29 Aug 2023 23:58:07 +0000 (11:58 +1200)] 
python:tests: Remove unused variables

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodocs-xml: Add missing paragraph section
Joseph Sutton [Tue, 29 Aug 2023 01:49:18 +0000 (13:49 +1200)] 
docs-xml: Add missing paragraph section

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Fix leaks
Joseph Sutton [Thu, 24 Aug 2023 23:53:28 +0000 (11:53 +1200)] 
s4:kdc: Fix leaks

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Don’t operate directly on caller‐owned pointer
Joseph Sutton [Thu, 24 Aug 2023 23:49:27 +0000 (11:49 +1200)] 
s4:kdc: Don’t operate directly on caller‐owned pointer

This is more consistent with the other PAC blob functions, and easier to
reason about.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Allocate contents of PAC blobs on blob talloc contexts
Joseph Sutton [Thu, 24 Aug 2023 23:41:39 +0000 (11:41 +1200)] 
s4:kdc: Allocate contents of PAC blobs on blob talloc contexts

The lifetime of a blob’s contents should be tied to the lifetime of the
blob itself.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Inline samba_get_requester_sid_pac_blob()
Joseph Sutton [Thu, 24 Aug 2023 23:35:12 +0000 (11:35 +1200)] 
s4:kdc: Inline samba_get_requester_sid_pac_blob()

A wrapper doesn’t add much utility to a function this small. We might as
well join these two into a single function.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Fix error message
Joseph Sutton [Thu, 7 Sep 2023 21:13:51 +0000 (09:13 +1200)] 
s4:kdc: Fix error message

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Initialize pointers to NULL
Joseph Sutton [Thu, 24 Aug 2023 23:30:27 +0000 (11:30 +1200)] 
s4:kdc: Initialize pointers to NULL

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Correct error message
Joseph Sutton [Thu, 24 Aug 2023 23:29:24 +0000 (11:29 +1200)] 
s4:kdc: Correct error message

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Check return value of smb_krb5_principal_get_comp_string()
Joseph Sutton [Thu, 24 Aug 2023 23:28:07 +0000 (11:28 +1200)] 
s4:kdc: Check return value of smb_krb5_principal_get_comp_string()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Remove unused talloc context
Joseph Sutton [Thu, 24 Aug 2023 23:18:34 +0000 (11:18 +1200)] 
s4:kdc: Remove unused talloc context

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Check return value of samdb_result_dom_sid()
Joseph Sutton [Thu, 24 Aug 2023 23:17:24 +0000 (11:17 +1200)] 
s4:kdc: Check return value of samdb_result_dom_sid()

We should not pass a NULL pointer into dom_sid_split_rid().

Unlike samdb_result_dom_sid(), samdb_result_dom_sid_buf() produces an
error code on failure and does not require a heap allocation.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoclaims.idl: Be more lenient in our expectations for the compression of claims
Joseph Sutton [Thu, 24 Aug 2023 23:04:32 +0000 (11:04 +1200)] 
claims.idl: Be more lenient in our expectations for the compression of claims

384 bytes is not a strict threshold below which claims are never to be
compressed. Windows has been known to compress claims a mere 368 bytes
in size.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoclaims.idl: Allow empty claim value buffers
Joseph Sutton [Thu, 24 Aug 2023 23:01:09 +0000 (11:01 +1200)] 
claims.idl: Allow empty claim value buffers

Windows doesn’t reject these, nor do we have any reason to do so.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Make functions to add special SIDs non‐static
Joseph Sutton [Mon, 21 Aug 2023 01:55:27 +0000 (13:55 +1200)] 
s4:kdc: Make functions to add special SIDs non‐static

This allows us to call them from elsewhere.

Change their names accordingly to start with ‘samba_kdc_’.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Check result of talloc_realloc()
Joseph Sutton [Mon, 21 Aug 2023 01:52:14 +0000 (13:52 +1200)] 
s4:kdc: Check result of talloc_realloc()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Handle invalid enum values
Joseph Sutton [Mon, 21 Aug 2023 01:51:27 +0000 (13:51 +1200)] 
s4:kdc: Handle invalid enum values

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Check result of dom_sid_parse()
Joseph Sutton [Mon, 21 Aug 2023 01:49:38 +0000 (13:49 +1200)] 
s4:kdc: Check result of dom_sid_parse()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Remove unused flags
Joseph Sutton [Mon, 21 Aug 2023 01:46:57 +0000 (13:46 +1200)] 
s4:kdc: Remove unused flags

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Use smb_krb5_data_from_blob()
Joseph Sutton [Fri, 18 Aug 2023 03:00:20 +0000 (15:00 +1200)] 
s4:kdc: Use smb_krb5_data_from_blob()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Remove duplicate function signature
Joseph Sutton [Fri, 18 Aug 2023 03:00:04 +0000 (15:00 +1200)] 
s4:kdc: Remove duplicate function signature

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Prefer explicit initialization to ZERO_STRUCT()
Joseph Sutton [Thu, 7 Sep 2023 04:35:39 +0000 (16:35 +1200)] 
s4:kdc: Prefer explicit initialization to ZERO_STRUCT()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli:security: Prefer explicit initialization to ZERO_STRUCTP()
Joseph Sutton [Fri, 18 Aug 2023 00:33:01 +0000 (12:33 +1200)] 
libcli:security: Prefer explicit initialization to ZERO_STRUCTP()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:scripting: Remove unused imports
Joseph Sutton [Tue, 29 Aug 2023 23:58:34 +0000 (11:58 +1200)] 
s4:scripting: Remove unused imports

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:tests: Remove unused imports
Joseph Sutton [Wed, 16 Aug 2023 23:10:06 +0000 (11:10 +1200)] 
python:tests: Remove unused imports

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc:ndr: Avoid overflow in size calculation
Joseph Sutton [Tue, 15 Aug 2023 00:38:35 +0000 (12:38 +1200)] 
librpc:ndr: Avoid overflow in size calculation

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibgpo: Remove unnecessary cast
Joseph Sutton [Wed, 9 Aug 2023 04:52:46 +0000 (16:52 +1200)] 
libgpo: Remove unnecessary cast

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:tdr: Remove unnecessary cast
Joseph Sutton [Wed, 9 Aug 2023 04:51:46 +0000 (16:51 +1200)] 
lib:tdr: Remove unnecessary cast

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:mscat: Remove unnecessary casts
Joseph Sutton [Wed, 9 Aug 2023 04:51:33 +0000 (16:51 +1200)] 
lib:mscat: Remove unnecessary casts

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonsswitch/wb_common.c: fix socket fd and memory leaks of global state
Stefan Metzmacher [Thu, 7 Sep 2023 13:59:59 +0000 (15:59 +0200)] 
nsswitch/wb_common.c: fix socket fd and memory leaks of global state

When we are called in wb_atfork_child() or winbind_destructor(),
wb_thread_ctx_destructor() is not called for the global state
of the current nor any other thread, which means we would
leak the related memory and socket fds.

Now we maintain a global list protected by a global mutex.
We traverse the list and close all socket fds, which are no
longer used (winbind_destructor) or no longer valid in the
current process (wb_atfork_child), in addition we 'autofree'
the ones, which are only visible internally as global (per thread)
context.

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

Tested-by: Krzysztof Piotr Oledzki <ole@ans.pl>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Sep 14 18:53:07 UTC 2023 on atb-devel-224

2 years agonsswitch/wb_common.c: don't operate on a stale wb_global_ctx.key
Stefan Metzmacher [Fri, 8 Sep 2023 07:56:47 +0000 (09:56 +0200)] 
nsswitch/wb_common.c: don't operate on a stale wb_global_ctx.key

If nss_winbind is loaded into a process that uses fork multiple times
without any further calls into nss_winbind, wb_atfork_child handler
was using a wb_global_ctx.key that was no longer registered in the
pthread library, so we operated on a slot that was potentially
reused by other libraries or the main application. Which is likely
to cause memory corruption.

So we better don't call pthread_key_delete() in wb_atfork_child().

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

Reported-by: Krzysztof Piotr Oledzki <ole@ans.pl>
Tested-by: Krzysztof Piotr Oledzki <ole@ans.pl>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agonsswitch/wb_common.c: winbind_destructor can always use get_wb_global_ctx()
Stefan Metzmacher [Fri, 8 Sep 2023 07:53:42 +0000 (09:53 +0200)] 
nsswitch/wb_common.c: winbind_destructor can always use get_wb_global_ctx()

The HAVE_PTHREAD logic inside of get_wb_global_ctx() will do all
required magic.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agonsswitch/wb_common.c: fix build without HAVE_PTHREAD
Stefan Metzmacher [Thu, 7 Sep 2023 14:02:32 +0000 (16:02 +0200)] 
nsswitch/wb_common.c: fix build without HAVE_PTHREAD

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agonsswitch: add test for pthread_key_delete missuse (bug 15464)
Stefan Metzmacher [Fri, 8 Sep 2023 11:57:26 +0000 (13:57 +0200)] 
nsswitch: add test for pthread_key_delete missuse (bug 15464)

This is based on https://bugzilla.samba.org/attachment.cgi?id=18081
written by Krzysztof Piotr Oledzki <ole@ans.pl>

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years ago.gitlab-ci: Allow ext4 jobs to run on shared runners
Andrew Bartlett [Tue, 5 Sep 2023 21:37:19 +0000 (09:37 +1200)] 
.gitlab-ci: Allow ext4 jobs to run on shared runners

At the time of this commit, GitLab shared runners
tagged "gce" were 2x AMD EPYC 7B12 with 8GB ram.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2 years ago.gitlab-ci: make it explicit that some tests require ext4/5.15 kernel
Stefan Metzmacher [Thu, 14 Sep 2023 08:42:55 +0000 (10:42 +0200)] 
.gitlab-ci: make it explicit that some tests require ext4/5.15 kernel

This is better then requiring private runners,
as we'll be able to use shared runners for ext4 soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years ago.gitlab-ci: restore starting ubuntu2204-samba-o3 for the default pipeline
Stefan Metzmacher [Wed, 13 Sep 2023 15:07:34 +0000 (17:07 +0200)] 
.gitlab-ci: restore starting ubuntu2204-samba-o3 for the default pipeline

This got lost in commit bcc22d00569551cfa25851c8c267ec9decc63d21
for ubuntu1804-samba-o3 at the time...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agosmbd: make vfs_stat_fsp() a no-op on fake file-handles
Ralph Boehme [Fri, 4 Aug 2023 15:19:00 +0000 (17:19 +0200)] 
smbd: make vfs_stat_fsp() a no-op on fake file-handles

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 Sep 12 17:08:17 UTC 2023 on atb-devel-224

2 years agoauth:credentials: Check if password_obtained > obtained
Samuel Cabrero [Thu, 7 Sep 2023 12:51:15 +0000 (14:51 +0200)] 
auth:credentials: Check if password_obtained > obtained

Fixes reading the password from STDIN or environment vars if it was already
given in the command line:

$ export PASSWD_FD=0
$ ./bin/net offlinejoin composeodj <...> --password=FOO
<Waiting to read password from STDIN>

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Sep 11 03:36:28 UTC 2023 on atb-devel-224

2 years agonetapi: Pass net's cmdline credentials to libnetapi_net_init()
Samuel Cabrero [Thu, 7 Sep 2023 12:53:22 +0000 (14:53 +0200)] 
netapi: Pass net's cmdline credentials to libnetapi_net_init()

Avoid unnecessary credentials allocation and initialization by passing the
net's cmdline creds to libnetapi_net_init() directly.

Fixes the problem of running cli_credentials_guess() (which runs password
callbacks) twice, one for the net's cmdline creds and a second time for the
creds initialized in libnetapi_net_init(), just to override them immediately
after.

Example:

$ export PASSWD_FD=0
$ ./bin/net offlinejoin composeodj <...>
foo
bar

Password is read from STDIN twice.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetapi: Pass loadparm_context to libnetapi_net_init()
Samuel Cabrero [Thu, 7 Sep 2023 12:34:36 +0000 (14:34 +0200)] 
netapi: Pass loadparm_context to libnetapi_net_init()

The net's tool cmdline lp_ctx can be reused, no need to init a new one except
for external library users.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:rpc: bump named_pipe_auth_req_info version number
Douglas Bagnall [Thu, 7 Sep 2023 21:35:51 +0000 (09:35 +1200)] 
s3:rpc: bump named_pipe_auth_req_info version number

This is because commit f893cf85cc387b66c496661e11073b1215270022
changed the security token in secuirty.idl, and bumping the version
was missed.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years ago.gitlab-ci.yml: Move coverity build to internal Heimdal
Andrew Bartlett [Wed, 30 Aug 2023 02:45:49 +0000 (14:45 +1200)] 
.gitlab-ci.yml: Move coverity build to internal Heimdal

The opensuse155 image has MIT 1.20, not the required MIT 1.21, so build
with intenral Heimdal instead.

The opensuse155 image was chosen deliberatly in commit
f2eb411646bbc3cbedd4aecaba98bd363a6cd3df so this changes
the KDC choice rather than the image.  Eventually we will
need to do both.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2 years agos4:wrepl_server: Fix code spelling
Joseph Sutton [Wed, 6 Sep 2023 00:06:26 +0000 (12:06 +1200)] 
s4:wrepl_server: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:torture: Fix code spelling
Joseph Sutton [Tue, 5 Sep 2023 23:33:59 +0000 (11:33 +1200)] 
s4:torture: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:samba: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:24:56 +0000 (16:24 +1200)] 
s4:samba: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:rpc_server: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:18:24 +0000 (16:18 +1200)] 
s4:rpc_server: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:ntvfs: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:18:06 +0000 (16:18 +1200)] 
s4:ntvfs: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:libnet: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:17:44 +0000 (16:17 +1200)] 
s4:libnet: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:libcli: Fix code spelling
Joseph Sutton [Mon, 4 Sep 2023 04:34:04 +0000 (16:34 +1200)] 
s4:libcli: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:kdc: Fix code spelling
Joseph Sutton [Mon, 4 Sep 2023 04:52:57 +0000 (16:52 +1200)] 
s4:kdc: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb: Fix code spelling
Joseph Sutton [Fri, 1 Sep 2023 01:30:37 +0000 (13:30 +1200)] 
s4:dsdb: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dns_server: Fix code spelling
Joseph Sutton [Wed, 6 Sep 2023 04:34:33 +0000 (16:34 +1200)] 
s4:dns_server: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:client: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:12:03 +0000 (16:12 +1200)] 
s4:client: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:auth: Fix code spelling
Joseph Sutton [Tue, 5 Sep 2023 04:04:28 +0000 (16:04 +1200)] 
s4:auth: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:winbindd: Fix code spelling
Joseph Sutton [Mon, 4 Sep 2023 02:17:35 +0000 (14:17 +1200)] 
s3:winbindd: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:utils: Fix code spelling
Joseph Sutton [Tue, 5 Sep 2023 04:04:18 +0000 (16:04 +1200)] 
s3:utils: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:smbd: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:09:38 +0000 (16:09 +1200)] 
s3:smbd: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:rpc_server: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:09:20 +0000 (16:09 +1200)] 
s3:rpc_server: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:rpc_client: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:08:57 +0000 (16:08 +1200)] 
s3:rpc_client: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:registry: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:08:34 +0000 (16:08 +1200)] 
s3:registry: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:nmbd: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:08:17 +0000 (16:08 +1200)] 
s3:nmbd: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:librpc: Fix code spelling
Joseph Sutton [Tue, 5 Sep 2023 04:03:58 +0000 (16:03 +1200)] 
s3:librpc: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:libnet: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:07:41 +0000 (16:07 +1200)] 
s3:libnet: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:libads: Fix code spelling
Joseph Sutton [Fri, 1 Sep 2023 01:39:18 +0000 (13:39 +1200)] 
s3:libads: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:lib: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:05:38 +0000 (16:05 +1200)] 
s3:lib: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:auth: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:05:13 +0000 (16:05 +1200)] 
s3:auth: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoselftest: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:04:41 +0000 (16:04 +1200)] 
selftest: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopython:tests: Fix code spelling
Joseph Sutton [Sun, 3 Sep 2023 22:22:42 +0000 (10:22 +1200)] 
python:tests: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopidl: Fix code spelling
Joseph Sutton [Wed, 23 Aug 2023 03:53:59 +0000 (15:53 +1200)] 
pidl: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc: Fix code spelling
Joseph Sutton [Wed, 30 Aug 2023 03:18:19 +0000 (15:18 +1200)] 
librpc: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibgpo: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 04:01:50 +0000 (16:01 +1200)] 
libgpo: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli: Fix code spelling
Joseph Sutton [Tue, 5 Sep 2023 22:54:46 +0000 (10:54 +1200)] 
libcli: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:charset: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 03:57:53 +0000 (15:57 +1200)] 
lib:charset: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotevent: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 03:57:14 +0000 (15:57 +1200)] 
tevent: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotdb: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 03:56:56 +0000 (15:56 +1200)] 
tdb: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:printer_driver: Fix code spelling
Joseph Sutton [Thu, 7 Sep 2023 03:56:20 +0000 (15:56 +1200)] 
lib:printer_driver: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoldb: Fix code spelling
Joseph Sutton [Tue, 5 Sep 2023 22:54:35 +0000 (10:54 +1200)] 
ldb: Fix code spelling

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib:krb5_wrap: Fix spelling in documentation
Joseph Sutton [Mon, 4 Sep 2023 04:46:10 +0000 (16:46 +1200)] 
lib:krb5_wrap: Fix spelling in documentation

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