summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lib/replace - add extra check to bsd_attr_listAndrew Walker2023-01-021-0/+12
| | | | | | | | | | | | | | | | | | | | | The FreeBSD extattr API may return success and truncated namelist. We need to check for this in bsd_attr_list to ensure that we don't accidentally read off the end of the buffer. In the case of a truncated value, the pascal strings for attr names will reflect the lengths as if the value were not truncated. For example: `58DosStrea` In case of short read we now set error to ERANGE and fail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15271 Signed-off-by: Andrew Walker <awalker@ixsystems.com> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Mon Jan 2 14:27:23 UTC 2023 on sn-devel-184
* Happy New Year 2023!Stefan Metzmacher2023-01-012-2/+2
| | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sun Jan 1 00:24:02 UTC 2023 on sn-devel-184
* s3:rpc_server/srvsvc: make sure we (re-)load all shares as root.Stefan Metzmacher2022-12-292-13/+16
| | | | | | | | | | | | | | | | | | | | | This fixes a regression in commit f03665bb7e8ea97699062630f2aa1bac4c5dfc7f The use of reload_services() has a lot of side effects, e.g. reopen of log files and other things, which are only useful in smbd, but not in rpcd_classic. It was also unloading the user and registry shares we loaded a few lines above. We need to do all (re-)loading as root, otherwise we won't be able to read root only smb.conf files, access registry shares, ... BUG: https://bugzilla.samba.org/show_bug.cgi?id=15243 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15266 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Walker <awalker@ixsystems.com> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Dec 29 21:14:02 UTC 2022 on sn-devel-184
* selftest: add samba3.blackbox.registry_shareStefan Metzmacher2022-12-294-0/+74
| | | | | | | | | | | | This demonstrates the regression introduced by f03665bb7e8ea97699062630f2aa1bac4c5dfc7f, where registry shares are no longer listed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15243 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15266 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Walker <awalker@ixsystems.com>
* s4:setup:tests: Use system ldbdump if we build with system ldbAndreas Schneider2022-12-231-1/+4
| | | | | | | | 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): Fri Dec 23 15:31:31 UTC 2022 on sn-devel-184
* python:tests: Use system ldbsearch if we built against system libldbAndreas Schneider2022-12-231-6/+10
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* python:tests: Use system ldbdump if we build with system ldbAndreas Schneider2022-12-231-1/+5
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* python:tests: Use system ldbsearch if we build with system libldbAndreas Schneider2022-12-231-1/+4
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* nsswitch:tests: Use system_or_builddir_binary() for test_rfc2307_mappingAndreas Schneider2022-12-231-6/+3
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for upgradeprovision-oldreleaseAndreas Schneider2022-12-231-10/+3
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for tombstones-expungeAndreas Schneider2022-12-231-24/+4
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for test_trust_tokenAndreas Schneider2022-12-231-5/+2
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for test_special_groupAndreas Schneider2022-12-231-4/+1
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for test_primary_groupAndreas Schneider2022-12-231-9/+2
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for test_pkinit_simpleAndreas Schneider2022-12-231-4/+2
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for test_pkinit_pacAndreas Schneider2022-12-231-4/+2
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for test_old_enctypesAndreas Schneider2022-12-231-10/+3
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for test_net_ads_dnsAndreas Schneider2022-12-231-11/+4
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for test_net_adsAndreas Schneider2022-12-231-20/+6
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for test_ldb_simpleAndreas Schneider2022-12-231-3/+2
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for test_ldbAndreas Schneider2022-12-231-3/+2
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for test_ktpassAndreas Schneider2022-12-231-4/+1
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for test_kinit_mitAndreas Schneider2022-12-231-10/+4
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for test_kinit_heimdalAndreas Schneider2022-12-231-10/+3
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for test_client_kerberosAndreas Schneider2022-12-231-9/+2
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for renamedcAndreas Schneider2022-12-231-6/+3
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for ldapcmp_restoredcAndreas Schneider2022-12-231-4/+2
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for functionalprepAndreas Schneider2022-12-231-4/+1
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for demote-saveddbAndreas Schneider2022-12-231-4/+1
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for dbcheck-oldreleaseAndreas Schneider2022-12-231-19/+6
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Use system_or_builddir_binary() for dbcheck and runtime testsAndreas Schneider2022-12-233-31/+8
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Add system_or_builddir_binary()Andreas Schneider2022-12-232-5/+30
| | | | | | This should be used if we use a system or builddir binary. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* testprogs: Fix remove_directory()Andreas Schneider2022-12-231-1/+1
| | | | | | common_test_fns.inc: line 121: [: too many arguments Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* waf: Run python tests also with tr_TR localeAndreas Schneider2022-12-231-0/+7
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15248 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): Fri Dec 23 14:17:31 UTC 2022 on sn-devel-184
* lib:ldb: Use ldb_ascii_toupper() for case foldingAndreas Schneider2022-12-233-14/+25
| | | | | | | | | | | | | | | | | For example there are at least two locales (tr_TR and az_AZ) in glibc having dotless i transformation different from Latin scripts and GUID versus Guid comparison would be different there (attribute name would not match in the test). See also https://en.wikipedia.org/wiki/Dotted_and_dotless_I https://lists.samba.org/archive/samba-technical/2019-December/134659.html This fixes: LC_ALL=tr_TR.UTF-8 make test BUG: https://bugzilla.samba.org/show_bug.cgi?id=15248 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib:ldb: Add ldb_ascii_toupper()Andreas Schneider2022-12-232-0/+17
| | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15248 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib:ldb: Remove trailing white spaces in ldb_private.hAndreas Schneider2022-12-231-5/+5
| | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15248 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib:ldb: Fix trailing whitespaces in common/ldb_utf8.cAndreas Schneider2022-12-231-2/+2
| | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15248 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib:ldb: Fix trailing whitespaces in common/attrib_handlers.cAndreas Schneider2022-12-231-16/+16
| | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15248 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Make send_trans2_replies() staticVolker Lendecke2022-12-222-16/+8
| | | | | | | | 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): Thu Dec 22 20:46:53 UTC 2022 on sn-devel-184
* smbd: Hide the SMB1 posix symlink behaviour behind UCF_LCOMP_LNK_OKVolker Lendecke2022-12-222-1/+9
| | | | | | | | | | | | | | This will be used in the future to also open symlinks as reparse points, so this won't be specific to only SMB1 posix extensions. I have tried to avoid additional flags for several weeks by making openat_pathref_fsp or other flavors of this to always open fsp's with symlink O_PATH opens, because I think NT_STATUS_OBJECT_NAME_NOT_FOUND with a valid stat is a really bad and racy way to express that we just hit a symlink, but I miserably failed. Adding additional flags (another one will follow) is wrong, but I don't see another way right now. Signed-off-by: Volker Lendecke <vl@samba.org>
* smbd: Simplify filename_convert_dirfsp_nosymlink()Volker Lendecke2022-12-221-10/+2
| | | | | | | Avoid a nested if, the "&&" is easier to understand for me. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Simplify filename_convert_dirfsp_nosymlink()Volker Lendecke2022-12-221-35/+38
| | | | | | | | | | Factor out the symlink-case into a more obvious if-statement with less indentation. Review with git show -b Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Reduce indentation in ucf_flags_from_smb_request()Volker Lendecke2022-12-221-10/+12
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Implement SET_REPARSE_POINT buffer size checksVolker Lendecke2022-12-222-3/+39
| | | | | | | | | | | | | Partially survives samba.tests.reparsepoints.ReparsePoints.test_create_reparse NTTRANS-FSCTL needs changing: Windows 2016 returns INVALID_BUFFER_SIZE instead of our NOT_A_REPARSE_POINT. This is not the whole story, but this smbtorture3 change makes autobuild survive. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Rename "ctx" to the more common "mem_ctx" in reparse functionsVolker Lendecke2022-12-222-6/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Print the file name in reparse point functionsVolker Lendecke2022-12-221-3/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/compression: add simple python bindingsDouglas Bagnall2022-12-224-0/+522
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are four functions, allowing compression and decompression in the two formats we support so far. The functions will accept bytes or unicode strings which are treated as utf-8. The LZ77+Huffman decompression algorithm requires an exact target length to decompress, so this is mandatory. The plain decompression algorithm does not need an exact length, but you can provide one to help it know how much space to allocate. As currently written, you can provide a short length and it will often succeed in decompressing to a different shorter string. These bindings are intended to make ad-hoc investigation easier, not for production use. This is reflected in the guesses about output size that plain_decompress() makes if you don't supply one -- either they are stupidly wasteful or ridiculously insufficient, depending on whether or not you were trying to decompress a 20MB string. >>> a = '12345678' >>> import compression >>> b = compression.huffman_compress(a) >>> b b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 #.... >>> len(b) 262 >>> c = compression.huffman_decompress(b, len(a)) >>> c b'12345678' # note, c is bytes, a is str >>> a '12345678' >>> d = compression.plain_compress(a) >>> d b'\xff\xff\xff\x0012345678' >>> compression.plain_decompress(d) # no size specified, guesses b'12345678' >>> compression.plain_decompress(d,5) b'12345' >>> compression.plain_decompress(d,0) # 0 for auto b'12345678' >>> compression.plain_decompress(d,1) b'1' >>> compression.plain_decompress(a,444) Traceback (most recent call last): compression.CompressionError: unable to decompress data into a buffer of 444 bytes. >>> compression.plain_decompress(b,444) b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 #... That last one decompresses the Huffman compressed file with the plain compressor; pretty much any string is valid for plain decompression. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:client: Fix a use-after-free issue in smbclientAndreas Schneider2022-12-221-2/+3
| | | | | | | | | | | | | | | | Detected by make test TESTS="samba3.blackbox.chdir-cache" with an optimized build or with AddressSanitizer. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15268 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Dec 22 10:52:31 UTC 2022 on sn-devel-184
* s3:script: Improve test_chdir_cache.shAndreas Schneider2022-12-221-4/+8
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15268 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>