]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 years agofuzz: add fuzz_lzxpress_huffman_compress
Douglas Bagnall [Thu, 17 Nov 2022 03:09:26 +0000 (16:09 +1300)] 
fuzz: add fuzz_lzxpress_huffman_compress

This differs from fuzz_lzxpress_huffman_round_trip (next commit) in
that the output buffer might be too small for the compressed data, in
which case we want to see an error and not a crash.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agofuzz: add fuzz_lzxpress_huffman_decompress
Douglas Bagnall [Thu, 17 Nov 2022 03:08:52 +0000 (16:08 +1300)] 
fuzz: add fuzz_lzxpress_huffman_decompress

Most strings will not successfully decompress, which is OK. What we
care about of course is memory safety.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib/compression/tests: add lzhuffman timer functions
Douglas Bagnall [Thu, 17 Nov 2022 20:54:57 +0000 (09:54 +1300)] 
lib/compression/tests: add lzhuffman timer functions

With LZXHUFF_DEBUG_VERBOSE set, we measure the compression and
decompression rate relative to the decompressed size.

On reasonably long strings on my laptop, compiled with -O0, it turns
out to between 20 and 500 MB/s, both ways, depending on the complexity
of the string. Very short strings are of course dominated by overhead.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib/compression: debug routines for lzxpress-huffman
Douglas Bagnall [Fri, 18 Nov 2022 02:54:37 +0000 (15:54 +1300)] 
lib/compression: debug routines for lzxpress-huffman

If you need to see a Huffman tree (and sometimes you do), set
DEBUG_HUFFMAN_TREE to true at the top of lzxpress_huffman.c, and run:

  make bin/test_lzx_huffman && bin/test_lzx_huffman

Actually, that will show you hundreds of trees, and you'll be glad of
that if you are ever trying to understand this.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib/compression/lzhuff: add debug flag to skip LZ77
Douglas Bagnall [Sun, 20 Nov 2022 21:23:53 +0000 (10:23 +1300)] 
lib/compression/lzhuff: add debug flag to skip LZ77

Encoding without LZ77 matches is valid, and it is useful for isolating
bugs.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib/compression: LZ77 + Huffman compression
Douglas Bagnall [Thu, 17 Nov 2022 10:14:58 +0000 (23:14 +1300)] 
lib/compression: LZ77 + Huffman compression

This compresses files as described in MS-XCA 2.2, and as decompressed
by the decompressor in the previous commit.

As with the decompressor, there are two public functions -- one that
uses a talloc context, and one that uses pre-allocated memory. The
compressor requires a tightly bound amount of auxillary memory
(>220kB) in a few different buffers, which is all gathered together in
the public struct lzxhuff_compressor_mem. An instantiated but not
initialised copy of this struct is required by the non-talloc
function; it can be used over and over again.

Our compression speed is about the same as the decompression speed
(between 20 and 500 MB/s on this laptop, depending on the data), and
our compression ratio is very similar to that of Windows.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib/compression: add LZ77 + Huffman decompression
Douglas Bagnall [Thu, 17 Nov 2022 01:24:52 +0000 (14:24 +1300)] 
lib/compression: add LZ77 + Huffman decompression

This format is described in [MS-XCA] 2.1 and 2.2, with exegesis in
many posts on the cifs-protocol list[1].

The two public functions are:

ssize_t lzxpress_huffman_decompress(const uint8_t *input,
    size_t input_size,
    uint8_t *output,
    size_t output_size);

uint8_t *lzxpress_huffman_decompress_talloc(TALLOC_CTX *mem_ctx,
    const uint8_t *input_bytes,
    size_t input_size,
    size_t output_size);

In both cases the caller needs to know the *exact* decompressed size,
which is essential for decompression. The _talloc version allocates
the buffer for you, and uses the talloc context to allocate a 128k
working buffer. THe non-talloc function will allocate the working
buffer on the stack.

This compression format gives better compression for messages of
several kilobytes than the "plain" LXZPRESS compression, but is
probably a bit slower to decompress and is certainly worse for very
short messages, having a fixed 256 byte overhead for the first Huffman
table.

Experiments show decompression rates between 20 and 500 MB per second,
depending on the compression ratio and data size, on an i5-1135G7 with
no compiler optimisations.

This compression format is used in AD claims and in SMB, but that
doesn't happen with this commit.

I will not try to describe LZ77 or Huffman encoding here. Don't expect
an answer in MS-XCA either; instead read the code and/or Wikipedia.

[1] Much of that starts here:

https://lists.samba.org/archive/cifs-protocol/2022-October/

but there's more earlier, particularly in June/July 2020, when
Aurélien Aptel was working on an implementation that ended up in
Wireshark.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Pair-programmed-with: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agotestdata: add test vectors for LZ77+Huffman [de-]compression
Douglas Bagnall [Thu, 17 Nov 2022 03:07:08 +0000 (16:07 +1300)] 
testdata: add test vectors for LZ77+Huffman [de-]compression

Some of the decompressed files were found via fuzzing, some are public
domain texts, and some are designed to test one aspect or another of
the format. For example, some aspects of Huffman tree creation can
only be tested when there is an extreme imbalance in the frequency of
symbols.

See the README for what files are where.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agotest/source_chars: ignore testdata/compression
Douglas Bagnall [Tue, 22 Nov 2022 23:10:20 +0000 (12:10 +1300)] 
test/source_chars: ignore testdata/compression

We are going to have all kinds of rubbish there.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agolib/compression: move lzxpress_plain test into tests/
Douglas Bagnall [Thu, 17 Nov 2022 03:07:37 +0000 (16:07 +1300)] 
lib/compression: move lzxpress_plain test into tests/

We are going to add more tests for lib/compression, and they can't all
be called "testsuite.c".

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agofuzz: add fuzzers for stable_sort
Douglas Bagnall [Wed, 30 Nov 2022 03:59:51 +0000 (16:59 +1300)] 
fuzz: add fuzzers for stable_sort

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agoutil: add stable sort functions
Douglas Bagnall [Wed, 28 Sep 2022 01:40:10 +0000 (14:40 +1300)] 
util: add stable sort functions

Sometimes (e.g. in lzxpress Huffman encoding, and in some of our
tests: c.f. https://lists.samba.org/archive/samba-technical/2018-March/126010.html)
we want a stable sort algorithm (meaning one that retains the previous
order of items that compare equal).

The GNU libc qsort() is *usually* stable, in that it first tries to
use a mergesort but reverts to quicksort if the necessary allocations
fail. That has led Samba developers to unthinkingly assume qsort() is
stable which is not the case on many platforms, and might not always
be on GNU/Linuxes either.

This adds four functions. stable_sort() sorts an array, and requires
an auxiliary working array of the same size. stable_sort_talloc()
takes a talloc context so it ca create a working array and call
stable_sort(). stable_sort_r() takes an opaque context blob that gets
passed to the compare function, like qsort_r() and ldb_qsort(). And
stable_sort_talloc_r() rounds out the quadrant.

These are LGPL so that the can be used in ldb, which has problems with
unstable sort.

The tests are borrowed and extended from test_ldb_qsort.c.

When sorting non-trivial structs this is roughly as fast as GNU qsort,
but GNU qsort has optimisations for small items, using direct
assignments of rather than memcpy where the size allows the item to be
cast as some kind of int.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
3 years agos3: smbd: Fix schedule_smb2_aio_read() to allow the last read in a compound to go...
Jeremy Allison [Fri, 18 Nov 2022 18:50:35 +0000 (10:50 -0800)] 
s3: smbd: Fix schedule_smb2_aio_read() to allow the last read in a compound to go async.

Remove knownfail.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Dec  1 16:04:07 UTC 2022 on sn-devel-184

3 years agos3: smbd: Fix schedule_aio_smb2_write() to allow the last write in a compound to...
Jeremy Allison [Fri, 18 Nov 2022 18:45:19 +0000 (10:45 -0800)] 
s3: smbd: Fix schedule_aio_smb2_write() to allow the last write in a compound to go async.

Remove knownfail.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos4: torture: Add compound_async.read_read test to show we don't go async on the last...
Jeremy Allison [Thu, 17 Nov 2022 23:50:30 +0000 (15:50 -0800)] 
s4: torture: Add compound_async.read_read test to show we don't go async on the last read in a compound.

Add knownfail.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos4: torture: Add compound_async.write_write test to show we don't go async on the...
Jeremy Allison [Thu, 17 Nov 2022 23:39:16 +0000 (15:39 -0800)] 
s4: torture: Add compound_async.write_write test to show we don't go async on the last write in a compound.

Add knownfail.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos4: torture: Tweak the compound padding streamfile test to send 3 reads instead of...
Jeremy Allison [Fri, 18 Nov 2022 21:30:05 +0000 (13:30 -0800)] 
s4: torture: Tweak the compound padding streamfile test to send 3 reads instead of 2, and check the middle read padding.

The protocol allows the last read in a related compound to be split
off and possibly go async (and smbd soon will do this). If the
last read is split off, then the padding is different. By sending
3 reads and checking the padding on the 2nd read, we cope with
the smbd change and are still correctly checking the padding
on a compound related read.

Do this for the stream filename compound padding test.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos4: torture: Tweak the compound padding basefile test to send 3 reads instead of...
Jeremy Allison [Fri, 18 Nov 2022 21:23:48 +0000 (13:23 -0800)] 
s4: torture: Tweak the compound padding basefile test to send 3 reads instead of 2, and check the middle read padding.

The protocol allows the last read in a related compound to be split
off and possibly go async (and smbd soon will do this). If the
last read is split off, then the padding is different. By sending
3 reads and checking the padding on the 2nd read, we cope with
the smbd change and are still correctly checking the padding
on a compound related read.

Do this for the base filename compound padding test.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: tests: Change smb2.compound_async to run against share aio_delay_inject instead...
Jeremy Allison [Fri, 18 Nov 2022 17:53:23 +0000 (09:53 -0800)] 
s3: tests: Change smb2.compound_async to run against share aio_delay_inject instead of tmp.

It doesn't hurt the fsync compound async tests, and we need this for
the next commits to ensure smb2_read/smb2_write compound tests take
longer than 500ms so can be sure the last read/write in the compound
will go async.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos4:torture: Fix segfault in multichannel test
Andreas Schneider [Wed, 30 Nov 2022 17:23:17 +0000 (18:23 +0100)] 
s4:torture: Fix segfault in multichannel test

The timer for the timeout_cb() handler was created on a memory context
which doesn't get freed, so the timer was still valid when running
the next test and fired there. It was then writing into random memory
leading to segfaults.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Dec  1 15:03:19 UTC 2022 on sn-devel-184

3 years agosmbd: Allow POSIX getinfo levels for smb3 unix extensions
Volker Lendecke [Tue, 22 Nov 2022 15:00:53 +0000 (16:00 +0100)] 
smbd: Allow POSIX getinfo levels for smb3 unix extensions

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Nov 29 11:23:58 UTC 2022 on sn-devel-184

3 years agos3: Test that store_smb2_posix_info hides info for '..'
David Mulder [Thu, 3 Nov 2022 16:28:58 +0000 (10:28 -0600)] 
s3: Test that store_smb2_posix_info hides info for '..'

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: store_smb2_posix_info hide info for '..'
David Mulder [Tue, 18 Oct 2022 13:37:47 +0000 (07:37 -0600)] 
s3: smbd: store_smb2_posix_info hide info for '..'

When receiving a query for '..', hide the owner
and group sids, the inode, and the dev id.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agosmbd: Implement SMB2_FS_POSIX_INFORMATION_INTERNAL
David Mulder [Mon, 12 Sep 2022 23:09:50 +0000 (16:09 -0700)] 
smbd: Implement SMB2_FS_POSIX_INFORMATION_INTERNAL

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agotests/s3: Test file/dir permissions with SMB3 posix
David Mulder [Fri, 5 Aug 2022 20:00:30 +0000 (14:00 -0600)] 
tests/s3: Test file/dir permissions with SMB3 posix

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agotests/s3: Test case sensitive open with SMB3 posix
David Mulder [Fri, 5 Aug 2022 19:05:48 +0000 (13:05 -0600)] 
tests/s3: Test case sensitive open with SMB3 posix

Disabled because we don't handle posix paths
correctly yet.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agotests/s3: Test delete on close with SMB3 posix
David Mulder [Fri, 5 Aug 2022 16:56:32 +0000 (10:56 -0600)] 
tests/s3: Test delete on close with SMB3 posix

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolibcli: Add client support for SMB2_FILE_POSIX_INFORMATION
David Mulder [Fri, 8 Jul 2022 19:15:51 +0000 (13:15 -0600)] 
libcli: Add client support for SMB2_FILE_POSIX_INFORMATION

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agotests/s3: Test reserved chars in posix filename
David Mulder [Thu, 7 Jul 2022 18:57:01 +0000 (12:57 -0600)] 
tests/s3: Test reserved chars in posix filename

Disabled because we don't handle posix paths
correctly yet.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agosmbd: Implement SMB2_FILE_POSIX_INFORMATION in smbd_marshall_dir_entry
David Mulder [Fri, 17 Jun 2022 21:06:29 +0000 (15:06 -0600)] 
smbd: Implement SMB2_FILE_POSIX_INFORMATION in smbd_marshall_dir_entry

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agotests/s3: Test SMB2_FIND_POSIX_INFORMATION dir query
David Mulder [Wed, 15 Jun 2022 21:39:00 +0000 (15:39 -0600)] 
tests/s3: Test SMB2_FIND_POSIX_INFORMATION dir query

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolibsmb: Allow listing with posix context
David Mulder [Tue, 20 Sep 2022 16:28:20 +0000 (10:28 -0600)] 
libsmb: Allow listing with posix context

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolibsmb: Make info_level configurable in dir listing
David Mulder [Wed, 15 Jun 2022 19:20:30 +0000 (13:20 -0600)] 
libsmb: Make info_level configurable in dir listing

This was hard coded to SMB2_FIND_ID_BOTH_DIRECTORY_INFO

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agosmbd: Plumb SMB2_FIND_POSIX_INFORMATION through the directory reading code.
Jeremy Allison [Mon, 18 Dec 2017 21:27:06 +0000 (13:27 -0800)] 
smbd: Plumb SMB2_FIND_POSIX_INFORMATION through the directory reading code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Add SMB2_FILE_POSIX_INFORMATION getinfo info level (100 on the wire).
Jeremy Allison [Thu, 14 Dec 2017 23:18:21 +0000 (15:18 -0800)] 
s3: smbd: Add SMB2_FILE_POSIX_INFORMATION getinfo info level (100 on the wire).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agosmbd: reject FILE_ATTRIBUTE_TEMPORARY on directories
Ralph Boehme [Tue, 22 Nov 2022 06:31:52 +0000 (07:31 +0100)] 
smbd: reject FILE_ATTRIBUTE_TEMPORARY on directories

Cf MS-FSA 2.1.5.14.2

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Nov 28 10:14:12 UTC 2022 on sn-devel-184

3 years agotorture: add a test trying to set FILE_ATTRIBUTE_TEMPORARY on a directory
Ralph Boehme [Tue, 22 Nov 2022 09:45:35 +0000 (10:45 +0100)] 
torture: add a test trying to set FILE_ATTRIBUTE_TEMPORARY on a directory

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agovfs: fix the build of nfs4acl_xattr_ without rpc/xdr.h support
Stefan Metzmacher [Wed, 27 Mar 2019 03:34:12 +0000 (04:34 +0100)] 
vfs: fix the build of nfs4acl_xattr_ without rpc/xdr.h support

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Nov 25 06:07:32 UTC 2022 on sn-devel-184

3 years agonet: use correct printf format, fi3_id is an uint32_t
Ralph Boehme [Tue, 10 Jan 2017 11:22:28 +0000 (12:22 +0100)] 
net: use correct printf format, fi3_id is an uint32_t

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Nov 24 16:39:12 UTC 2022 on sn-devel-184

3 years agogitlab-ci: do some basic testing on ubuntu1804-32bit
Stefan Metzmacher [Tue, 22 Nov 2022 09:41:39 +0000 (10:41 +0100)] 
gitlab-ci: do some basic testing on ubuntu1804-32bit

For now we allow build warnings and only do some basic testing.
We also ignore timestamp related problems, as well as some charset
failures.

Over time we should try to address the situation by not allowing warnings
and verify if expected failures are harmless or not.

But it's already much better then having no 32bit testing at all!

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Nov 24 12:05:26 UTC 2022 on sn-devel-184

3 years agoselftest: add --default-ldb-backend option
Stefan Metzmacher [Tue, 22 Nov 2022 09:31:19 +0000 (10:31 +0100)] 
selftest: add --default-ldb-backend option

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoselftest: samba-ktest-mit also needs $ENV{KRB5RCACHETYPE} = "none"
Stefan Metzmacher [Fri, 4 Nov 2022 10:23:07 +0000 (10:23 +0000)] 
selftest: samba-ktest-mit also needs $ENV{KRB5RCACHETYPE} = "none"

We need to pass --mitkrb5 to selftest.pl in all cases we use
system mit kerberos not only when we also test the kdc.

We can't use a replay cache in selftest verifies the stat.st_uid
against getuid().

BTW: while debugging this on ubuntu 22.04 I exported
KRB5_TRACE="/dev/stderr", which means we get tracing into
the servers log file and into selftest_prefix/subunit for the client...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoCVE-2022-42898: HEIMDAL: lib/krb5: fix _krb5_get_int64 on systems where 'unsigned...
Stefan Metzmacher [Wed, 16 Nov 2022 11:08:45 +0000 (12:08 +0100)] 
CVE-2022-42898: HEIMDAL: lib/krb5: fix _krb5_get_int64 on systems where 'unsigned long' is just 32-bit

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agothird_party: Update socket_wrapper to version 1.3.5
Stefan Metzmacher [Wed, 23 Nov 2022 11:14:12 +0000 (12:14 +0100)] 
third_party: Update socket_wrapper to version 1.3.5

This injects O_LARGEFILE as needed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib/replace: let rep_openat2() inject O_LARGEFILE as needed
Stefan Metzmacher [Wed, 23 Nov 2022 10:38:20 +0000 (11:38 +0100)] 
lib/replace: let rep_openat2() inject O_LARGEFILE as needed

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:locking: relax __SHARE_MODE_LOCK_SPACE check for 32bit platforms
Stefan Metzmacher [Tue, 22 Nov 2022 09:47:33 +0000 (10:47 +0100)] 
s3:locking: relax __SHARE_MODE_LOCK_SPACE check for 32bit platforms

sizeof(struct share_mode_lock) is only 28 bytes instead of 32 bytes
on 32bit systems...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos4:kdc: make sure reset_bad_password_netlogon() stops subreq before return
Stefan Metzmacher [Mon, 7 Nov 2022 16:40:07 +0000 (17:40 +0100)] 
s4:kdc: make sure reset_bad_password_netlogon() stops subreq before return

We pass the stack variable 'req' to dcerpc_winbind_SendToSam_r_send(),
so we need to make sure the runtime of the subreq in not longer
than the stack variable.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:messaging: add irpc_bh_do_ndr_print() in order to debug irpc calls
Stefan Metzmacher [Mon, 7 Nov 2022 16:15:32 +0000 (17:15 +0100)] 
s4:messaging: add irpc_bh_do_ndr_print() in order to debug irpc calls

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoCVE-2021-20251: s4:auth: fix use after free in authsam_logon_success_accounting()
Stefan Metzmacher [Mon, 7 Nov 2022 16:21:44 +0000 (17:21 +0100)] 
CVE-2021-20251: s4:auth: fix use after free in authsam_logon_success_accounting()

This fixes a use after free problem introduced by
commit 7b8e32efc336fb728e0c7e3dd6fbe2ed54122124,
which has msg = current; which means the lifetime
of the 'msg' memory is no longer in the scope of th
caller.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agobootstrap: Remove duplicate line from CentOS 8 powertools install
Joseph Sutton [Mon, 10 Oct 2022 00:54:08 +0000 (13:54 +1300)] 
bootstrap: Remove duplicate line from CentOS 8 powertools install

This was missed in 136ec5bc01e2648bae34a1158f923fbf5a86d561 when
we moved to CentOS 8 stream.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agobootstrap: Spelling fix in bootstrap from Michael Tokarev
Andrew Bartlett [Wed, 26 Oct 2022 22:39:02 +0000 (11:39 +1300)] 
bootstrap: Spelling fix in bootstrap from Michael Tokarev

This could not previously be included as all changes require a full image rebuild
as they change the SHA1 hash.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agotests: Replace OpenSSL MD4 invocation with a python3 call
Andrew Bartlett [Sun, 30 Oct 2022 23:01:12 +0000 (12:01 +1300)] 
tests: Replace OpenSSL MD4 invocation with a python3 call

This will allow the test to pass on Ubuntu 22.04 which has MD4 disabled
in OpenSSL by default.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agotests: Start testing smb2 symlink error returns
Volker Lendecke [Thu, 27 Oct 2022 10:59:53 +0000 (12:59 +0200)] 
tests: Start testing smb2 symlink error returns

This still all fails, but if you run them against Windows they work.

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 22 19:25:34 UTC 2022 on sn-devel-184

3 years agotests: Add nosymlinks_smb1allow share
Volker Lendecke [Thu, 27 Oct 2022 10:48:59 +0000 (12:48 +0200)] 
tests: Add nosymlinks_smb1allow share

The next commits will create symlinks via posix extensions to test the
smb2 symlink error return. Creating posix symlinks is not allowed with
follow symlinks = no, but it's currently our only way to create
symlinks over SMB. This could go away once we can create symlinks via
reparse points.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotests: Start testing reparsepoints
Volker Lendecke [Thu, 10 Nov 2022 17:31:11 +0000 (18:31 +0100)] 
tests: Start testing reparsepoints

This still all fails, but if you run them against Windows they work.

How to run:

PYTHONPATH=bin/python \
LOCAL_PATH=/tmp \
SMB1_SHARE=share \
SMB2_SHARE=share \
SHARENAME=share \
SERVER_IP=<server-ip> \
DOMAIN=<your-domain> \
USERNAME=Administrator \
PASSWORD=<your-password> \
SMB_CONF_PATH=/usr/local/samba/etc/smb.conf \
SERVERCONFFILE="$SMB_CONF_PATH" \
python3 -m samba.subunit.run samba.tests.reparsepoints

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add protocol()
Volker Lendecke [Thu, 3 Nov 2022 15:42:12 +0000 (16:42 +0100)] 
pylibsmb: Add protocol()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add CreateDisposition values
Volker Lendecke [Thu, 3 Nov 2022 15:39:44 +0000 (16:39 +0100)] 
pylibsmb: Add CreateDisposition values

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add FSCTL codes
Volker Lendecke [Thu, 3 Nov 2022 15:18:37 +0000 (16:18 +0100)] 
pylibsmb: Add FSCTL codes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibcli: Add python wappers to reparse_symlink.c
Volker Lendecke [Thu, 3 Nov 2022 11:26:34 +0000 (12:26 +0100)] 
libcli: Add python wappers to reparse_symlink.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Factor out reparse_buffer_marshall from symlink_reparse_buffer_marshall()
Volker Lendecke [Thu, 10 Nov 2022 12:46:25 +0000 (13:46 +0100)] 
libsmb: Factor out reparse_buffer_marshall from symlink_reparse_buffer_marshall()

Make it easier to play with reparse points

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add fsctl()
Volker Lendecke [Tue, 1 Nov 2022 15:14:06 +0000 (16:14 +0100)] 
pylibsmb: Add fsctl()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add create options
Volker Lendecke [Tue, 20 Sep 2022 15:58:04 +0000 (17:58 +0200)] 
pylibsmb: Add create options

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add smb1_symlink()
Volker Lendecke [Tue, 18 Oct 2022 14:55:53 +0000 (16:55 +0200)] 
pylibsmb: Add smb1_symlink()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add smb1_readlink()
Volker Lendecke [Tue, 18 Oct 2022 14:41:30 +0000 (16:41 +0200)] 
pylibsmb: Add smb1_readlink()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add smb1_posix() to request smb1 posix extensions
Volker Lendecke [Sun, 16 Oct 2022 17:41:58 +0000 (19:41 +0200)] 
pylibsmb: Add smb1_posix() to request smb1 posix extensions

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Pass symlink error to create_ex exception
Volker Lendecke [Tue, 20 Sep 2022 15:28:27 +0000 (17:28 +0200)] 
pylibsmb: Pass symlink error to create_ex exception

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Pass symlink error up through cli_smb2_create_fnum_recv()
Volker Lendecke [Tue, 20 Sep 2022 12:31:31 +0000 (14:31 +0200)] 
libsmb: Pass symlink error up through cli_smb2_create_fnum_recv()

Not passing through the sync wrapper yet. Not needed right now, and
it's simple to add if required.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Return symlink error struct from smb2cli_create_recv()
Volker Lendecke [Mon, 25 Oct 2021 13:23:43 +0000 (15:23 +0200)] 
libsmb: Return symlink error struct from smb2cli_create_recv()

Looks larger than it is, this just adds a parameter and while there
adapts long lines to README.Coding

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Parse the smb2 symlink error response in smb2cli_create()
Volker Lendecke [Wed, 26 Oct 2022 11:58:56 +0000 (13:58 +0200)] 
libsmb: Parse the smb2 symlink error response in smb2cli_create()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Keep name_utf16 around in smb2cli_create()
Volker Lendecke [Thu, 20 Oct 2022 08:10:43 +0000 (10:10 +0200)] 
libsmb: Keep name_utf16 around in smb2cli_create()

This is needed to pass up the "unparsed" part of the smb2 symlink
error response in unix charset form.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Pass unparsed_path_length to symlink_reparse_buffer_marshall()
Volker Lendecke [Fri, 14 Oct 2022 15:12:26 +0000 (17:12 +0200)] 
smbd: Pass unparsed_path_length to symlink_reparse_buffer_marshall()

[MS-FSCC] 2.1.2.4 Symbolic Link Reparse Data Buffer lists this field
as reserved, but [MS-SMB2] 2.2.2.2.1 Symbolic Link Error Response is
the exact same format with the reserved field as UnparsedPathLength.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Pass error_context_count through smbd_smb2_request_error_ex()
Volker Lendecke [Fri, 14 Oct 2022 14:23:30 +0000 (16:23 +0200)] 
smbd: Pass error_context_count through smbd_smb2_request_error_ex()

See [MS-SMB2] 2.2.2: This field MUST be set to 0 for SMB dialects
other than 3.1.1. For the SMB dialect 3.1.1, if this field is nonzero,
the ErrorData field MUST be formatted as a variable-length array of
SMB2 ERROR Context structures containing ErrorContextCount entries.

Not used right now yet, but once we start to return STOPPED_ON_SYMLINK properly
this is required.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Factor out safe_symlink_target_path()
Volker Lendecke [Tue, 25 Oct 2022 08:26:26 +0000 (10:26 +0200)] 
smbd: Factor out safe_symlink_target_path()

Small refactoring to make filename_convert_dirfsp() itself a bit
shorter using a subroutine.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotests: Fix an incorrect comment
Volker Lendecke [Wed, 9 Nov 2022 11:35:59 +0000 (12:35 +0100)] 
tests: Fix an incorrect comment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Add "DOMAIN" to authentication creds
Volker Lendecke [Wed, 9 Nov 2022 10:25:51 +0000 (11:25 +0100)] 
libsmb: Add "DOMAIN" to authentication creds

If you want to create symlinks on Windows using reparse points, you
need to authenticate as local administrator, just "administrator" is
not enough. So this is required to run some tests against Windows.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Fix cli_fsctl()
Volker Lendecke [Wed, 9 Nov 2022 11:56:11 +0000 (12:56 +0100)] 
libsmb: Fix cli_fsctl()

Untested code is broken code. Found while testing symlinks over SMB1.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Fix cli_smb2_fsctl_recv()
Volker Lendecke [Tue, 1 Nov 2022 15:12:33 +0000 (16:12 +0100)] 
libsmb: Fix cli_smb2_fsctl_recv()

Untested code is broken code... data_blob_talloc() returns a NULL blob
for NULL/0 input.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Fix removing a rogue reparse point
Volker Lendecke [Thu, 10 Nov 2022 16:40:22 +0000 (17:40 +0100)] 
libsmb: Fix removing a rogue reparse point

If you set a reparse point for which Windows server does not have a
handler, it returns NT_STATUS_IO_REPARSE_TAG_NOT_HANDLED when you
later open it without FILE_OPEN_REPARSE_POINT.

See the discussion thread starting with
https://lists.samba.org/archive/cifs-protocol/2022-November/003888.html

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Add template code
Volker Lendecke [Thu, 3 Nov 2022 11:37:58 +0000 (12:37 +0100)] 
pylibsmb: Add template code

I've looked this up in my samples too often :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Whitespace fixes
Volker Lendecke [Wed, 9 Nov 2022 09:15:31 +0000 (10:15 +0100)] 
lib: Whitespace fixes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoidl: Fix whitespace
Volker Lendecke [Wed, 2 Nov 2022 12:24:22 +0000 (13:24 +0100)] 
idl: Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibcli: Make "attr_strs" static
Volker Lendecke [Thu, 10 Nov 2022 10:22:13 +0000 (11:22 +0100)] 
libcli: Make "attr_strs" static

This saves 70 bytes of .text, we don't need this on the stack.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Make lib/util/iov_buf.h self-contained
Volker Lendecke [Thu, 10 Nov 2022 12:42:01 +0000 (13:42 +0100)] 
lib: Make lib/util/iov_buf.h self-contained

We need "struct iovec", which comes in via sys/uio.h, incuded by
system/filesys.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopam_winbind: Fix a memleak
Volker Lendecke [Fri, 4 Nov 2022 10:23:52 +0000 (11:23 +0100)] 
pam_winbind: Fix a memleak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: Test PAM Access with DENY_ALL
David Mulder [Fri, 18 Nov 2022 18:42:15 +0000 (11:42 -0700)] 
gp: Test PAM Access with DENY_ALL

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Nov 21 22:05:01 UTC 2022 on sn-devel-184

3 years agogp: PAM Access should implicitly deny ALL w/ allow
David Mulder [Thu, 17 Nov 2022 23:33:24 +0000 (16:33 -0700)] 
gp: PAM Access should implicitly deny ALL w/ allow

If an allow entry is specified, the PAM Access
CSE should implicitly deny ALL (everyone other
than the explicit allow entries).

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: samba-tool manage gpo access add don't fail w/out upn
David Mulder [Thu, 17 Nov 2022 19:37:20 +0000 (12:37 -0700)] 
gp: samba-tool manage gpo access add don't fail w/out upn

The search response for the user could possibly
not include a upn (this happens with Administrator
for example).

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: Make samba-tool gpo manage sudoers remove backward compatible
David Mulder [Wed, 16 Nov 2022 22:04:16 +0000 (15:04 -0700)] 
gp: Make samba-tool gpo manage sudoers remove backward compatible

Ensure `samba-tool gpo manage sudoers remove` is
backward compatible with the GPME sudo rules.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: Test that samba-tool gpo manage removes gpme sudoers
David Mulder [Wed, 16 Nov 2022 22:03:18 +0000 (15:03 -0700)] 
gp: Test that samba-tool gpo manage removes gpme sudoers

The file format for storing the sudo rules
changed in samba-tool, but these can still be
added via the GPME. We should still include them
here.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: Make samba-tool gpo manage sudoers list backward compatible
David Mulder [Wed, 16 Nov 2022 17:46:11 +0000 (10:46 -0700)] 
gp: Make samba-tool gpo manage sudoers list backward compatible

Ensure `samba-tool gpo manage sudoers list` is
backward compatible with the GPME sudo rules.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogp: Test that samba-tool gpo manage lists gpme sudoers
David Mulder [Wed, 16 Nov 2022 17:44:22 +0000 (10:44 -0700)] 
gp: Test that samba-tool gpo manage lists gpme sudoers

The file format for storing the sudo rules
changed in samba-tool, but these can still be
added via the GPME. We should still include them
here.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3:rpc_server: Fix include directive substitution when enumerating shares
Andreas Schneider [Wed, 16 Nov 2022 10:24:12 +0000 (11:24 +0100)] 
s3:rpc_server: Fix include directive substitution when enumerating shares

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Nov 18 19:17:31 UTC 2022 on sn-devel-184

3 years agos3:tests: Add substitution test for listing shares
Andreas Schneider [Wed, 16 Nov 2022 10:23:44 +0000 (11:23 +0100)] 
s3:tests: Add substitution test for listing shares

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3:tests: Add substitution test for include directive
Andreas Schneider [Tue, 15 Nov 2022 15:35:15 +0000 (16:35 +0100)] 
s3:tests: Add substitution test for include directive

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Cause SMB2_OP_FLUSH to go synchronous in a compound anywhere but the last...
Jeremy Allison [Thu, 20 Oct 2022 22:19:05 +0000 (15:19 -0700)] 
s3: smbd: Cause SMB2_OP_FLUSH to go synchronous in a compound anywhere but the last operation in the list.

Async read and write go synchronous in the same case,
so do the same here.

Remove knownfail.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Nov 17 05:55:42 UTC 2022 on sn-devel-184

3 years agos3: smbd: Add utility function smbd_smb2_is_last_in_compound().
Jeremy Allison [Thu, 20 Oct 2022 22:08:14 +0000 (15:08 -0700)] 
s3: smbd: Add utility function smbd_smb2_is_last_in_compound().

Not yet used. Returns true if we're processing the last SMB2 request in a
compound.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos4: torture: Add an async SMB2_OP_FLUSH + SMB2_OP_FLUSH test to smb2.compound_async.
Jeremy Allison [Thu, 20 Oct 2022 21:22:25 +0000 (14:22 -0700)] 
s4: torture: Add an async SMB2_OP_FLUSH + SMB2_OP_FLUSH test to smb2.compound_async.

Shows we fail sending an SMB2_OP_FLUSH + SMB2_OP_FLUSH
compound if we immediately close the file afterward.

Internally the flushes go async and we free the req, then
we process the close. When the flushes complete they try to access
already freed data.

Extra test which will allow me to test when the final
component (flush) of the compound goes async and returns
NT_STATUS_PENDING.

Add knownfail.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos4: torture: Add an async SMB2_OP_FLUSH + SMB2_OP_CLOSE test to smb2.compound_async.
Jeremy Allison [Tue, 18 Oct 2022 23:22:33 +0000 (16:22 -0700)] 
s4: torture: Add an async SMB2_OP_FLUSH + SMB2_OP_CLOSE test to smb2.compound_async.

Shows we fail sending an SMB2_OP_FLUSH + SMB2_OP_CLOSE
compound. Internally the flush goes async and
we free the req, then we process the close.
When the flush completes it tries to access
already freed data.

Found using the Apple MacOSX client at SNIA SDC 2022.

Add knownfail.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agonsswitch: Fix uninitialized memory when allocating pwdlastset_prelim
Noel Power [Wed, 16 Nov 2022 15:37:52 +0000 (15:37 +0000)] 
nsswitch: Fix uninitialized memory when allocating pwdlastset_prelim

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15224
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 16 19:29:21 UTC 2022 on sn-devel-184

3 years agogitlab-ci: Update Fedora to version 37
Andreas Schneider [Wed, 16 Nov 2022 08:37:16 +0000 (09:37 +0100)] 
gitlab-ci: Update Fedora to version 37

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): Wed Nov 16 16:29:30 UTC 2022 on sn-devel-184