]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
2 years agopython/tests: Add test for creds.set_krb5_fast_credentials()
Andrew Bartlett [Sun, 19 Nov 2023 23:17:57 +0000 (12:17 +1300)] 
python/tests: Add test for creds.set_krb5_fast_credentials()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agopython/tests: Lock in key-word arguments as key-word only in samba.tests.gssapi
Andrew Bartlett [Sun, 19 Nov 2023 23:42:15 +0000 (12:42 +1300)] 
python/tests: Lock in key-word arguments as key-word only in samba.tests.gssapi

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agopython/tests: Import samba.gensec, not gensec
Andrew Bartlett [Mon, 20 Nov 2023 00:02:21 +0000 (13:02 +1300)] 
python/tests: Import samba.gensec, not gensec

This allows this function to be used by gensec.py (a test) without collision.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoauth/credentials: Add Python bindings for association of a connection for FAST
Andrew Bartlett [Sun, 19 Nov 2023 23:16:04 +0000 (12:16 +1300)] 
auth/credentials: Add Python bindings for association of a connection for FAST

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agoauth/credentials: Add API to allow requesting a Kerberos ticket to be protected with...
Andrew Bartlett [Fri, 17 Nov 2023 04:41:53 +0000 (17:41 +1300)] 
auth/credentials: Add API to allow requesting a Kerberos ticket to be protected with FAST

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agobuild: Add build time detection for the MIT FAST ccache API
Andrew Bartlett [Tue, 28 Nov 2023 00:51:07 +0000 (13:51 +1300)] 
build: Add build time detection for the MIT FAST ccache API

This will allow us to link against an older system Heimdal.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 years agothird_party/heimdal: Provide krb5_init_creds_opt_set_fast_ccache() and krb5_init_cred...
Andrew Bartlett [Wed, 29 Nov 2023 01:16:16 +0000 (14:16 +1300)] 
third_party/heimdal: Provide krb5_init_creds_opt_set_fast_ccache() and krb5_init_creds_opt_set_fast_flags() (import lorikeet-heimdal-202311290114 (commit 4c8517e161396330c76240bf09609a0dd5f9ea20))

It is easier for external callers to manipulate the krb5_get_init_creds_opt
(via the helpers) as this is passed down from higher up than the krb5_init_creds_context.

And just as importantly, alignment with MIT makes end-user callers happier.

Finally, this resolves the ambiguity as to which layer owns the
krb5_ccache, because now we match the MIT behaviour the init_creds code
re-opens a private copy inside libkrb5, meaning the caller closes the
cache it opened, rather than handing it over to the library.

(The unrelated changes are fixes to the test_pac test, also included in this import,
but in distinct lorikeet-heimdal commits, to allow it to compile)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2 years agolibcli/security: note suboptimality of conditional ACE Contains operators
Douglas Bagnall [Fri, 24 Nov 2023 23:55:09 +0000 (12:55 +1300)] 
libcli/security: note suboptimality of conditional ACE Contains operators

The Contains and Any_of operators could use a sorted comparison like
compare_composites_via_sort(), rather than O(n²) nested loops. But
that would involve amount of quite fiddly work that I am not starting
on now.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Nov 27 23:38:13 UTC 2023 on atb-devel-224

2 years agolibcli/security: comparability check: claim members are of one type
Douglas Bagnall [Thu, 23 Nov 2023 00:03:15 +0000 (13:03 +1300)] 
libcli/security: comparability check: claim members are of one type

We know from the way claims are defined, and from the code that checks
sortedness and sets the flag.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: shift comparability check to shortcut exits
Douglas Bagnall [Thu, 23 Nov 2023 00:01:49 +0000 (13:01 +1300)] 
libcli/security: shift comparability check to shortcut exits

The ordinary comparison path, using the sorted arrays, already implicitly
checks for comparability. We only need this when we're leaving early.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: add shortcuts for conditional ACE compare
Douglas Bagnall [Wed, 22 Nov 2023 23:47:45 +0000 (12:47 +1300)] 
libcli/security: add shortcuts for conditional ACE compare

If the number of members does not match in certain ways we can
say the sets are not equal without comparing the members.

We first need to check for comparability, though, so that we can return
an error if things aren't comparable.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: improve conditional ACE composite comparison
Douglas Bagnall [Fri, 10 Nov 2023 03:27:45 +0000 (16:27 +1300)] 
libcli/security: improve conditional ACE composite comparison

We had the comparison method wrong. Composites are compared as sets or
flabby sets, depending on their origin. Until now we compared them as
something a bit like sets, but not quite, in a maximally inefficient way.

Claims are always sets, and the left hand side is always a claim, but
literal composites on the right hand side can be multi-sets
(containing duplicate values). When it comes to comparison, composites
are reduced down to sets. To do the comparison we sort each side and
compare in order.

The fact that either side might ask for case-sensitive comparison (if
it is a claim) is an interesting complication.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: separate out claim_v1_to_ace_composite_unchecked()
Douglas Bagnall [Fri, 17 Nov 2023 00:58:12 +0000 (13:58 +1300)] 
libcli/security: separate out claim_v1_to_ace_composite_unchecked()

For SDDL Resource ACE conversions we don't want to check too much
claim validity so that a semi-invalid ACE can round-trip through
deserialisation and serialisation. This is because Windows allows it,
but also because if the check puts the values in a sorted order that
makes the round-trip less round (that is, the return string is
semantically the same but possibly different in byte order).

The validity we're talking about is mostly uniqueness. For example
`S:(RA;;;;;WD;("foo",TU,0,7,5,7))` has two 7s, and that would be
invalid as a claim, but this is not checked while in ACE form.

On the other hand `S:(RA;;;;;WD;("foo",TU,0,3,2))` is valid, but the
return string will have 3 and 2 reversed when the check is made. We
prefer the ACE to stay the same while it is just being an ACE.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: avoid leak on SDDL encode failure
Douglas Bagnall [Thu, 16 Nov 2023 23:01:15 +0000 (12:01 +1300)] 
libcli/security: avoid leak on SDDL encode failure

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: claim_v1_to_ace_token(): avoid unnecessary re-sort
Douglas Bagnall [Wed, 22 Nov 2023 03:40:12 +0000 (16:40 +1300)] 
libcli/security: claim_v1_to_ace_token(): avoid unnecessary re-sort

If it is a wire claim (which is probably most common), the checking
and sorting has already happened. We don't need to make a copy to
sort and check.

In either case, there is still a copy step to make the conditional ACE
token.

This shuffles around some knownfails because the claim_v1_copy()
function we were using is checking for duplicates, which we don't
always want. That will be fixed soon.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: add_claim_to_token() re-sorts/checks claims
Douglas Bagnall [Wed, 22 Nov 2023 03:38:13 +0000 (16:38 +1300)] 
libcli/security: add_claim_to_token() re-sorts/checks claims

This function is used in tests and fuzzing.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: resource attribute claims use claim_v1_check_and_sort()
Douglas Bagnall [Wed, 15 Nov 2023 03:51:19 +0000 (16:51 +1300)] 
libcli/security: resource attribute claims use claim_v1_check_and_sort()

Because RA ACEs live a double life, sometimes being ACEs and sometimes
being claims, we make a copy of the claim strucutre for sorting and
further use in conditional ACEs.

We don't need to do that for wire claims, because they are not
persistent or forwarded on to somewhere else.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: wire claim conversion uses claim_v1_check_and_sort()
Douglas Bagnall [Thu, 2 Nov 2023 05:13:13 +0000 (18:13 +1300)] 
libcli/security: wire claim conversion uses claim_v1_check_and_sort()

This roughly returns things to where they were a few commits ago, with
the claims being checked for uniqueness.

The difference is the claims will be sorted afterwards, and the
uniqueness check will be far more efficient on large claims.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: claim_v1_check_and_sort(): add all types
Douglas Bagnall [Wed, 22 Nov 2023 03:14:25 +0000 (16:14 +1300)] 
libcli/security: claim_v1_check_and_sort(): add all types

To manage this sort we need a qsort_r-like sort context which holds:

a) the value type,
b) a case sensitive flag for the string compare, and
c) a return flag indicating a failure. Failures are not picked up until
   after the sort finishes.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: begin claim_v1_check_and_sort with Boolean checks
Douglas Bagnall [Tue, 21 Nov 2023 22:07:29 +0000 (11:07 +1300)] 
libcli/security: begin claim_v1_check_and_sort with Boolean checks

claim_v1_check_and_sort() is meant to sort the claim values and check
that there are no duplicates, as well as making some value checks.

In order to ease into the idea, we look first at the case where the claim
has Boolean values. There are only two values allowed, which limits the
length of a valid claim set and means we only really need to "sort" in
the {1, 0} case, which we rewrite in place as {0, 1}.

That's what will happen with other types: we'll sort in-place, make
some checks on values, set flags, and return an error if there are
duplicates or value errors.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: don't allow two NULL string claims
Douglas Bagnall [Fri, 24 Nov 2023 04:59:24 +0000 (17:59 +1300)] 
libcli/security: don't allow two NULL string claims

This restores the behaviour with regard to duplicate NULL strings that
existed before the last commit. I'm putting it separately, because it
seems so strange, and I not entirely certain the behaviour is
intentional.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: wire claims conversion: remove strings uniqueness check
Douglas Bagnall [Wed, 22 Nov 2023 01:57:09 +0000 (14:57 +1300)] 
libcli/security: wire claims conversion: remove strings uniqueness check

This changes the behaviour when one of the strings is NULL. Previously
a single NULL string would be ignored, and two would cause an error.
That will be restored in the next commit.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: int wire claims drop uniqueness check
Douglas Bagnall [Wed, 22 Nov 2023 01:54:25 +0000 (14:54 +1300)] 
libcli/security: int wire claims drop uniqueness check

And we allocate all the values together as an array, because
we might as well.

This and the next couple of commits might look like steps backwards,
and they are, but they allow us to get a run-up to leap over a big
fence.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: simplify wire claim conversion mem, 3/3: rm tmp_ctx
Douglas Bagnall [Wed, 22 Nov 2023 01:48:31 +0000 (14:48 +1300)] 
libcli/security: simplify wire claim conversion mem, 3/3: rm tmp_ctx

The interstitial tmp_ctx now does nothing but be interstitial, so
let's get rid of it.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: simplify wire claim conversion mem, 2/3: one tree
Douglas Bagnall [Wed, 22 Nov 2023 01:44:30 +0000 (14:44 +1300)] 
libcli/security: simplify wire claim conversion mem, 2/3: one tree

These values would have leaked in the event of failure (but only onto
the caller mem_ctx, which might be fleeting -- especially as its
security token is now failing).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: simplify wire claim conversion mem, 1/3: avoid NULL parent
Douglas Bagnall [Wed, 22 Nov 2023 01:39:49 +0000 (14:39 +1300)] 
libcli/security: simplify wire claim conversion mem, 1/3: avoid NULL parent

The reason for this, apart from weighing up possible over-allocations
vs realloc costs, is in the first iteration of the loop,

       claim_values = talloc_array(claims,

would allocate onto NULL, which leaks.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopytest: conditional_ace_claims tests large composite comparisons
Douglas Bagnall [Mon, 13 Nov 2023 23:53:24 +0000 (12:53 +1300)] 
pytest: conditional_ace_claims tests large composite comparisons

Our composite comparisons are currently all wrong.

Soon they will be fixed, but we are going to have an inflection point
where we switch from the naive compare-everything approach to a sort
based comparison, and we want to test both sides. Also, we use these
tests for a little bit of timing, which reveals it is all fast enough.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security/sddl: improve some SDDL error messages
Douglas Bagnall [Sun, 12 Nov 2023 23:56:13 +0000 (12:56 +1300)] 
libcli/security/sddl: improve some SDDL error messages

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopytest: conditional_ace_claims: write_c_test_on_failure() copes with claims
Douglas Bagnall [Mon, 13 Nov 2023 00:34:57 +0000 (13:34 +1300)] 
pytest: conditional_ace_claims: write_c_test_on_failure() copes with claims

*copes badly, but better than crashing.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopytest: token_factory note that a flag is not set
Douglas Bagnall [Mon, 13 Nov 2023 23:46:21 +0000 (12:46 +1300)] 
pytest: token_factory note that a flag is not set

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopytest: token_factory copes with empty claims
Douglas Bagnall [Mon, 13 Nov 2023 00:36:00 +0000 (13:36 +1300)] 
pytest: token_factory copes with empty claims

We don't have a good story yet with regard to empty claims, but we at
least want to be able to create them in tests.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopytest: token_factory claims can have case_sensitive flag
Douglas Bagnall [Mon, 13 Nov 2023 23:51:10 +0000 (12:51 +1300)] 
pytest: token_factory claims can have case_sensitive flag

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopytest: token_factory separate out list_to_claim() helper
Douglas Bagnall [Sun, 12 Nov 2023 23:57:13 +0000 (12:57 +1300)] 
pytest: token_factory separate out list_to_claim() helper

This is so conditional_ace_claims test can create claim objects which
can e.g. have the case sensitive flag set.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: sddl_conditional_ace: check a talloc_new()
Douglas Bagnall [Fri, 10 Nov 2023 03:19:40 +0000 (16:19 +1300)] 
libcli/security: sddl_conditional_ace: check a talloc_new()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: conditional ACE sddl writers take const tokens
Douglas Bagnall [Fri, 10 Nov 2023 03:18:32 +0000 (16:18 +1300)] 
libcli/security: conditional ACE sddl writers take const tokens

We don't change these when writing the SDDL.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib/security:CA: tokens_are_comparable() accepts NULL operator
Douglas Bagnall [Fri, 10 Nov 2023 03:15:25 +0000 (16:15 +1300)] 
lib/security:CA: tokens_are_comparable() accepts NULL operator

In some circumstances we are going to know general comparability
without having an operator around to use.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: CA: tokens_are_comparable() considers the obvious
Douglas Bagnall [Fri, 10 Nov 2023 03:13:40 +0000 (16:13 +1300)] 
libcli/security: CA: tokens_are_comparable() considers the obvious

Existing callers already make this check, but we are soon going to use
it in contexts that don't.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: add test_claims_conversion
Douglas Bagnall [Fri, 24 Nov 2023 00:37:42 +0000 (13:37 +1300)] 
libcli/security: add test_claims_conversion

These are unit tests for converting wire claims into sorted claims v1
structures.

These are based from packets derived from the krb5.conditional_ace
tests, and currently don't test more than they do, but they work about
a hundred thousand times quicker.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: test_run_conditional_ace tests more comparisons
Douglas Bagnall [Thu, 16 Nov 2023 22:30:03 +0000 (11:30 +1300)] 
libcli/security: test_run_conditional_ace tests more comparisons

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: test_run_conditional_ace can set debug levels
Douglas Bagnall [Thu, 16 Nov 2023 22:29:06 +0000 (11:29 +1300)] 
libcli/security: test_run_conditional_ace can set debug levels

No -d, just `bin/test_run_conditional_ace 3`.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc/idl:security: add claims flag indicating orderly and unique members
Douglas Bagnall [Fri, 10 Nov 2023 03:56:04 +0000 (16:56 +1300)] 
librpc/idl:security: add claims flag indicating orderly and unique members

The same flag will be used in conditional ACE composites, and on
CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 structures derived from wire
claims and resource attribute ACEs, when we know we have checked the
claim has no duplicate values.

Resource Attribute ACEs contain CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1
at rest, but we are not going to set the flag there on the off chance
that the ACE could fly off to another application and have another
application specific meaning there. We will only check for uniqueness
and set the flag on ephemeral copies of resource claims during access
check operations.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc/idl:security: add a couple of claims flags
Douglas Bagnall [Fri, 10 Nov 2023 01:53:44 +0000 (14:53 +1300)] 
librpc/idl:security: add a couple of claims flags

We don't use these.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc/idl:condtional_ace: shift CONDITIONAL_ACE_FLAG_TOKEN_FROM_ATTR to last bit
Douglas Bagnall [Fri, 10 Nov 2023 01:31:59 +0000 (14:31 +1300)] 
librpc/idl:condtional_ace: shift CONDITIONAL_ACE_FLAG_TOKEN_FROM_ATTR to last bit

This region is "available for application-specific data" in the
CLAIM_SECURITY_ATTRIBUTE_ space, according to [MS-DTYP] 2.4.10.1,
so it nicer to use that, even though we are not actually setting the
flag on the V1 claims.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibrpc/idl:conditional_ace: make a flags field 32 bit
Douglas Bagnall [Fri, 10 Nov 2023 01:24:48 +0000 (14:24 +1300)] 
librpc/idl:conditional_ace: make a flags field 32 bit

This allows it to align with
CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1.flags, with which it shares
values and will soon share more.

It was 16 bit because we needed few flags, and at one point .type was
8 bit, so 16 bits packed nicely into a smaller struct.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: remove redundant claim SID size check
Douglas Bagnall [Mon, 27 Nov 2023 21:46:40 +0000 (10:46 +1300)] 
libcli/security: remove redundant claim SID size check

blob_string_sid_to_sid() immediately checks the size is within 5-191, so the 1-10000
just gives you a different message in chircumstances you'll never see.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: avoid leak when converting SID claims
Douglas Bagnall [Mon, 27 Nov 2023 21:35:43 +0000 (10:35 +1300)] 
libcli/security: avoid leak when converting SID claims

Apart from the leak fix, this is faster and stricter, not accepting
SID string buffers with trailing garbage ("S-1-2-3qwerty" would have
been accepted, but not now).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3: smbd: Allow fchmod from the NFS-style mode ACL in set_nt_acl() for a SMB2 POSIX...
Jeremy Allison [Thu, 1 Mar 2018 22:37:52 +0000 (14:37 -0800)] 
s3: smbd: Allow fchmod from the NFS-style mode ACL in set_nt_acl() for a SMB2 POSIX handle.

To set a mode, send a one-element ACL.

Pair-Programmed-With: Ralph Boehme <slow@samba.org>

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Nov 27 19:31:01 UTC 2023 on atb-devel-224

2 years agosmbd: bring back "smb3 unix extensions" option
Ralph Boehme [Wed, 8 Nov 2023 16:49:19 +0000 (17:49 +0100)] 
smbd: bring back "smb3 unix extensions" option

This basically reverts commit b3cae8dcf192f65031f143e5bb9135c895611d98
with a few important differences:

* SMB3 UNIX extensions are always built, but disabled by default at runtime.

* They are globally enabled in the fileserver test environment.

* It's now a per-share option, so admins can selectively disable them
  on a per-share basis. This allows clients to detect early that a share
  doesn't support user mount requested POSIX and fail appropiately, passing
  the failure to the requesting application (mount command).

Signed-off-by: Ralph Boehme <slow@samba.org>
2 years agosmbd: factor out smb2_negotiate_context_process_posix()
Ralph Boehme [Wed, 22 Nov 2023 11:53:36 +0000 (12:53 +0100)] 
smbd: factor out smb2_negotiate_context_process_posix()

No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: tweak POSIX check in smbd_do_qfilepathinfo()
Ralph Boehme [Mon, 13 Nov 2023 09:36:14 +0000 (10:36 +0100)] 
smbd: tweak POSIX check in smbd_do_qfilepathinfo()

This check is only needed for SMB2, so check for that, and in the SMB2 codepath
we'll always have a valid fsp, so we can drop that check.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: check is POSIX is enabled on the fsp in fsinfo_unix_valid_level()
Ralph Boehme [Mon, 13 Nov 2023 09:35:30 +0000 (10:35 +0100)] 
smbd: check is POSIX is enabled on the fsp in fsinfo_unix_valid_level()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: pass fsp to fsinfo_unix_valid_level()
Ralph Boehme [Mon, 13 Nov 2023 07:04:33 +0000 (08:04 +0100)] 
smbd: pass fsp to fsinfo_unix_valid_level()

We need the fsp down in fsinfo_unix_valid_level(), pass it down.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: pass fsp to smbd_do_qfsinfo()
Ralph Boehme [Mon, 13 Nov 2023 06:43:11 +0000 (07:43 +0100)] 
smbd: pass fsp to smbd_do_qfsinfo()

We need the fsp down in fsinfo_unix_valid_level(), start passing it down.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: leave comment on broken SMB1 POSIX open handling of SMB_O_DIRECT
Ralph Boehme [Fri, 24 Nov 2023 15:29:57 +0000 (16:29 +0100)] 
smbd: leave comment on broken SMB1 POSIX open handling of SMB_O_DIRECT

Since e0814dc5082dd4ecca8a155e0ce24b073158fd92 the passed in attributes get
replaced by the mode in create_file_default().

As FILE_FLAG_NO_BUFFERING is never checked when doing the final IO, it doesn't
really matter.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosamba-tool: Improve help messages for "samba-tool domain auth policy"
Andrew Bartlett [Thu, 23 Nov 2023 04:31:23 +0000 (17:31 +1300)] 
samba-tool: Improve help messages for "samba-tool domain auth policy"

Signed-off-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): Mon Nov 27 04:05:46 UTC 2023 on atb-devel-224

2 years agodocs-xml: Improve and consolidate "samba-tool domain auth policy create/modify" docs
Andrew Bartlett [Wed, 22 Nov 2023 23:47:04 +0000 (12:47 +1300)] 
docs-xml: Improve and consolidate "samba-tool domain auth policy create/modify" docs

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2 years agonetcmd: auth: set better metavar that matches the docs
Rob van der Linde [Thu, 23 Nov 2023 01:08:04 +0000 (14:08 +1300)] 
netcmd: auth: set better metavar that matches the docs

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security/tests: gunzip the oversized-acls test vectors
Douglas Bagnall [Fri, 24 Nov 2023 04:15:55 +0000 (17:15 +1300)] 
libcli/security/tests: gunzip the oversized-acls test vectors

These are just as readable with `less` as they were with `zless`.

This file has been slightly manually edited to add line-breaks. There
is not an easy setting in Python's json module to get good formatting.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Nov 27 02:10:12 UTC 2023 on atb-devel-224

2 years agolibcli/security/tests: remove duplicate TX-integer tests from oversized-ACLs
Douglas Bagnall [Fri, 24 Nov 2023 03:59:05 +0000 (16:59 +1300)] 
libcli/security/tests: remove duplicate TX-integer tests from oversized-ACLs

We had two sets of test vectors (Windows ground-truth for SDDL
compilation) that got mixed up.

The "oversized ACLs" set is ACLs that contain repeated ACEs, like
"D:P(D;;;;;MP)(D;;;;;MP)" -- Windows will assign a size to the ACL
that is greater than the sum of the ACEs, while Samba will not (in
part because we don't actually store a size for the ACL, instead
calculating it on the fly from the size of the ACEs).

The "TX integers" set is for resource attribute ACEs with octet-string
data that contains pure integers (lacking '#' characters) in their
SDDL, like «(RA;;;;;WD;("bar",TX,0x0,0077,00,0077,00))». We used to
think that was weird, and that RA-TX ACEs should contain octet-strings
in the conditional ACE style. But now we have realised it's not weird,
it's normal, and we have fixed our handling of these ACEs.

As a result of this mix-up, some of the tests labelled as "oversized
ACLs" started passing when we fixed the TX integer problem, and that
was confusing. All of the removed tests are already on the TX integer
set -- the removed ones were duplicates.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security:sddl: remove vestiges of shared conditional/resource ACE SID parsing
Douglas Bagnall [Thu, 2 Nov 2023 02:48:20 +0000 (15:48 +1300)] 
libcli/security:sddl: remove vestiges of shared conditional/resource ACE SID parsing

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: improve error messages in RA ACE SDDL
Douglas Bagnall [Thu, 2 Nov 2023 02:42:11 +0000 (15:42 +1300)] 
libcli/security: improve error messages in RA ACE SDDL

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: conditional ACE sid parser no longer expects RA ACEs
Douglas Bagnall [Thu, 2 Nov 2023 02:41:33 +0000 (15:41 +1300)] 
libcli/security: conditional ACE sid parser no longer expects RA ACEs

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: parse resource attribute ace SIDs separately
Douglas Bagnall [Thu, 2 Nov 2023 02:37:33 +0000 (15:37 +1300)] 
libcli/security: parse resource attribute ace SIDs separately

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security/sddl: write RA octet strings the Windows way
Douglas Bagnall [Fri, 24 Nov 2023 03:24:00 +0000 (16:24 +1300)] 
libcli/security/sddl: write RA octet strings the Windows way

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: add a parser for resource attribute ACE byte strings
Douglas Bagnall [Thu, 2 Nov 2023 02:28:15 +0000 (15:28 +1300)] 
libcli/security: add a parser for resource attribute ACE byte strings

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: sddl_conditional_ace: remove check_resource_attr_type()
Douglas Bagnall [Wed, 22 Nov 2023 00:17:17 +0000 (13:17 +1300)] 
libcli/security: sddl_conditional_ace: remove check_resource_attr_type()

This is unneeded, as now all the checks are done in the relevant
parse_* functions.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: sddl_conditional_ace: add parse_bool for RA aces
Douglas Bagnall [Wed, 22 Nov 2023 00:24:21 +0000 (13:24 +1300)] 
libcli/security: sddl_conditional_ace: add parse_bool for RA aces

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: sddl_conditional_ace: add parse_uint for RA aces
Douglas Bagnall [Wed, 22 Nov 2023 00:23:26 +0000 (13:23 +1300)] 
libcli/security: sddl_conditional_ace: add parse_uint for RA aces

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: un-invert parse_resource_attr_list, check type first
Douglas Bagnall [Thu, 2 Nov 2023 02:25:06 +0000 (15:25 +1300)] 
libcli/security: un-invert parse_resource_attr_list, check type first

We were reusing parse_literal() because it almost does what we need,
but it is different enough that check_resource_attr_type() is large
and complicated, and can't handle all the cases (in particular octet-
strings and SIDs are different in resource ACEs).

This way is better because we know the type in advance, so we can use
that to choose the parser, which will help with octet-strings that are
only digits.

In this commit we're leaving the check there, but it soon won't do
anything that the parse_* functions don't, and we will remove it.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security/test_sddl_conditional_ace: adjust RA octet parse tests
Douglas Bagnall [Thu, 9 Nov 2023 22:35:42 +0000 (11:35 +1300)] 
libcli/security/test_sddl_conditional_ace: adjust RA octet parse tests

We are going to parse octet strings like Windows (as opposed to like
Windows docs), so the tests need changing.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security:sddl_condtional_ace: log compiler errors at some debug levels
Douglas Bagnall [Thu, 2 Nov 2023 02:11:58 +0000 (15:11 +1300)] 
libcli/security:sddl_condtional_ace: log compiler errors at some debug levels

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibcli/security: initialise conditional ACE token flags
Douglas Bagnall [Fri, 17 Nov 2023 03:34:23 +0000 (16:34 +1300)] 
libcli/security: initialise conditional ACE token flags

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopytest: security_descriptors tests get enumerator in name
Douglas Bagnall [Sun, 19 Nov 2023 22:45:32 +0000 (11:45 +1300)] 
pytest: security_descriptors tests get enumerator in name

This will make knownfails easier, given the names contain so many
regular expression metacharacters.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agodosmode: prefer capabilities over become_root
Björn Jacke [Mon, 20 Nov 2023 11:36:00 +0000 (12:36 +0100)] 
dosmode: prefer capabilities over become_root

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolibgpo: fix wrong lineending in admx files
Björn Jacke [Wed, 22 Nov 2023 17:46:30 +0000 (18:46 +0100)] 
libgpo: fix wrong lineending in admx files

When changing or reviewing admx file patches, make sure, that those files are
dos fileformat and they need to have the magic ^M at the end of each line ...

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoRevert "README.Coding.md: add DBG_STARTUP_NOTICE macro"
Stefan Metzmacher [Thu, 23 Nov 2023 12:20:23 +0000 (13:20 +0100)] 
Revert "README.Coding.md: add DBG_STARTUP_NOTICE macro"

This reverts commit bb370b9381e5d223ff4ac62f612888f90a63fcc5.

We no longer use log level -1

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Nov 24 10:34:58 UTC 2023 on atb-devel-224

2 years agolib/util: convert DBG_STARTUP_NOTICE() to use debug_set_forced_log_priority(DBGLVL_NO...
Stefan Metzmacher [Wed, 22 Nov 2023 16:18:29 +0000 (17:18 +0100)] 
lib/util: convert DBG_STARTUP_NOTICE() to use debug_set_forced_log_priority(DBGLVL_NOTICE)

Using -1 as log level is not compatible without our infrastructure.

As all backends are initialized with .log_level = -1, which means
they don't log the message, but now they all try to handle the
startup message even if they are not configured.

E.g. is means that systemd's journalctl get the message twice
now, first via the syslog and also the systemd backend.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolib/util: add debug_set_forced_log_priority()
Stefan Metzmacher [Wed, 22 Nov 2023 16:03:30 +0000 (17:03 +0100)] 
lib/util: add debug_set_forced_log_priority()

By default the priority for syslog/systemd is derived from
the log level of the debug message.

But for things like startup messages we want to
change the priority temporary, like this:

debug_set_forced_log_priority(DBGLVL_NOTICE);
D_ERR("Startup...\n");
debug_set_forced_log_priority(-1);

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoClaims initial black box tests
Rob van der Linde [Mon, 13 Nov 2023 10:48:52 +0000 (23:48 +1300)] 
Claims initial black box tests

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Thu Nov 23 00:32:33 UTC 2023 on atb-devel-224

2 years agonetcmd: auth policy: add allowed-to-authenticate-from-device-group attributes
Rob van der Linde [Tue, 21 Nov 2023 02:23:59 +0000 (15:23 +1300)] 
netcmd: auth policy: add allowed-to-authenticate-from-device-group attributes

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: auth policy: fix missing 'by' in help string
Rob van der Linde [Tue, 21 Nov 2023 02:41:31 +0000 (15:41 +1300)] 
netcmd: auth policy: fix missing 'by' in help string

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: auth policy: add allowed-to-authenticate-to-by-group attributes
Rob van der Linde [Tue, 21 Nov 2023 02:09:05 +0000 (15:09 +1300)] 
netcmd: auth policy: add allowed-to-authenticate-to-by-group attributes

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: auth policy: rename "from silo" to "from device silo"
Rob van der Linde [Tue, 21 Nov 2023 02:03:24 +0000 (15:03 +1300)] 
netcmd: auth policy: rename "from silo" to "from device silo"

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: auth policy: document allowed to authenticate from silo and to by silo attributes
Rob van der Linde [Thu, 16 Nov 2023 00:39:23 +0000 (13:39 +1300)] 
netcmd: auth policy: document allowed to authenticate from silo and to by silo attributes

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: auth policy: add allowed to authenticate to by silo attributes
Rob van der Linde [Mon, 13 Nov 2023 10:48:36 +0000 (23:48 +1300)] 
netcmd: auth policy: add allowed to authenticate to by silo attributes

--user-allowed-to-authenticate-to-by-silo
--service-allowed-to-authenticate-to-by-silo
--computer-allowed-to-authenticate-to-by-silo

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: models: add field test for SIDField
Rob van der Linde [Wed, 22 Nov 2023 04:18:20 +0000 (17:18 +1300)] 
netcmd: models: add field test for SIDField

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: models: add a Group model
Rob van der Linde [Tue, 21 Nov 2023 03:00:18 +0000 (16:00 +1300)] 
netcmd: models: add a Group model

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: models: make systemFlags and systemOnly fields readonly
Rob van der Linde [Wed, 22 Nov 2023 02:38:55 +0000 (15:38 +1300)] 
netcmd: models: make systemFlags and systemOnly fields readonly

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: models: ensure that backlinks are always readonly
Rob van der Linde [Wed, 22 Nov 2023 02:35:38 +0000 (15:35 +1300)] 
netcmd: models: ensure that backlinks are always readonly

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: models: add readonly attribute on fields to exclude it from save
Rob van der Linde [Wed, 22 Nov 2023 01:13:08 +0000 (14:13 +1300)] 
netcmd: models: add readonly attribute on fields to exclude it from save

There was trouble when saving fields like is system object, these need to be excluded on save.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: models: get_base_dn returns default rather than be abstract
Rob van der Linde [Tue, 21 Nov 2023 02:57:14 +0000 (15:57 +1300)] 
netcmd: models: get_base_dn returns default rather than be abstract

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: models: add SIDField field
Rob van der Linde [Mon, 20 Nov 2023 23:42:03 +0000 (12:42 +1300)] 
netcmd: models: add SIDField field

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: models: use correct SDDL for authentication silos
Rob van der Linde [Mon, 13 Nov 2023 10:46:57 +0000 (23:46 +1300)] 
netcmd: models: use correct SDDL for authentication silos

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agonetcmd: fix typo in groups and computer commands
Rob van der Linde [Mon, 20 Nov 2023 23:40:03 +0000 (12:40 +1300)] 
netcmd: fix typo in groups and computer commands

Everywhere else it is using Group's except for one place which makes it obvious this was incorrect.

Same goes for Computers's vs Computer's

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoselftest: move planoldpythontestsuite up so it can be used by blackbox tests
Rob van der Linde [Wed, 8 Nov 2023 02:07:41 +0000 (15:07 +1300)] 
selftest: move planoldpythontestsuite up so it can be used by blackbox tests

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agotests: gensec: docstrings in the middle of code should be comments
Rob van der Linde [Wed, 8 Nov 2023 01:37:12 +0000 (14:37 +1300)] 
tests: gensec: docstrings in the middle of code should be comments

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agosmbd: Fix Coverity ID 1499372 Uninitialized scalar variable
Volker Lendecke [Wed, 15 Nov 2023 13:53:06 +0000 (14:53 +0100)] 
smbd: Fix Coverity ID 1499372 Uninitialized scalar variable

This is real.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Nov 21 18:33:51 UTC 2023 on atb-devel-224

2 years agowinbind: Fix Coverity ID 1398910
Volker Lendecke [Wed, 15 Nov 2023 13:48:20 +0000 (14:48 +0100)] 
winbind: Fix Coverity ID 1398910

Coverity isn't smart enough for talloc

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolsa4: Fix Coverity ID 1499410
Volker Lendecke [Wed, 15 Nov 2023 13:39:33 +0000 (14:39 +0100)] 
lsa4: Fix Coverity ID 1499410

It complains about uninitialized access, and I'm not sure it isn't
right. Just initialize the structure.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosamr4: Fix Coverity ID 1499378
Volker Lendecke [Wed, 15 Nov 2023 13:36:20 +0000 (14:36 +0100)] 
samr4: Fix Coverity ID 1499378

Coverity isn't smart enough to see this is initialized. As it's good
practice to initialize vars, just do it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>