summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* VERSION: Disable GIT_SNAPSHOT for the 4.16.7 release.samba-4.16.7Jule Anger2022-11-151-1/+1
| | | | Signed-off-by: Jule Anger <janger@samba.org>
* WHATSNEW: Add release notes for Samba 4.16.7.Jule Anger2022-11-151-2/+48
| | | | Signed-off-by: Jule Anger <janger@samba.org>
* CVE-2022-42898 third_party/heimdal: PAC parse integer overflowsJoseph Sutton2022-11-152-218/+444
| | | | | | | | | | | | | | Catch overflows that result from adding PAC_INFO_BUFFER_SIZE. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15203 Heavily edited by committer Nico Williams <nico@twosigma.com>, original by Joseph Sutton <josephsutton@catalyst.net.nz>. Signed-off-by: Nico Williams <nico@twosigma.com> [jsutton@samba.org Zero-initialised header_size in krb5_pac_parse() to avoid a maybe-uninitialized error; added a missing check for ret == 0]
* VERSION: Bump version up to Samba 4.16.7...Jule Anger2022-11-151-2/+2
| | | | | | | and re-enable GIT_SNAPSHOT. Signed-off-by: Jule Anger <janger@samba.org> (cherry picked from commit c2095819c31ca66fa8a0936cca79ff1e7973966b)
* VERSION: Disable GIT_SNAPSHOT for the 4.16.6 release.samba-4.16.6Jule Anger2022-10-241-1/+1
| | | | Signed-off-by: Jule Anger <janger@samba.org>
* WHATSNEW: Add release notes for Samba 4.16.6.Jule Anger2022-10-241-2/+44
| | | | Signed-off-by: Jule Anger <janger@samba.org>
* CVE-2022-3437 third_party/heimdal: Pass correct length to _gssapi_verify_pad()Joseph Sutton2022-10-242-4/+2
| | | | | | | | | | | | | | We later subtract 8 when calculating the length of the output message buffer. If padlength is excessively high, this calculation can underflow and result in a very large positive value. Now we properly constrain the value of padlength so underflow shouldn't be possible. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15134 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2022-3437 third_party/heimdal: Check for overflow in _gsskrb5_get_mech()Joseph Sutton2022-10-242-1/+2
| | | | | | | | | | | | | | If len_len is equal to total_len - 1 (i.e. the input consists only of a 0x60 byte and a length), the expression 'total_len - 1 - len_len - 1', used as the 'len' parameter to der_get_length(), will overflow to SIZE_MAX. Then der_get_length() will proceed to read, unconstrained, whatever data follows in memory. Add a check to ensure that doesn't happen. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15134 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2022-3437 third_party/heimdal: Check buffer length against overflow for ↵Joseph Sutton2022-10-242-5/+14
| | | | | | | | | DES{,3} unwrap BUG: https://bugzilla.samba.org/show_bug.cgi?id=15134 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2022-3437 third_party/heimdal: Check the result of _gsskrb5_get_mech()Joseph Sutton2022-10-242-1/+4
| | | | | | | | | | We should make sure that the result of 'total_len - mech_len' won't overflow, and that we don't memcmp() past the end of the buffer. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15134 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2022-3437 third_party/heimdal: Avoid undefined behaviour in ↵Joseph Sutton2022-10-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | _gssapi_verify_pad() By decrementing 'pad' only when we know it's safe, we ensure we can't stray backwards past the start of a buffer, which would be undefined behaviour. In the previous version of the loop, 'i' is the number of bytes left to check, and 'pad' is the current byte we're checking. 'pad' was decremented at the end of each loop iteration. If 'i' was 1 (so we checked the final byte), 'pad' could potentially be pointing to the first byte of the input buffer, and the decrement would put it one byte behind the buffer. That would be undefined behaviour. The patch changes it so that 'pad' is the byte we previously checked, which allows us to ensure that we only decrement it when we know we have a byte to check. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15134 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2022-3437 third_party/heimdal: Don't pass NULL pointers to memcpy() in ↵Joseph Sutton2022-10-241-6/+8
| | | | | | | | | DES unwrap BUG: https://bugzilla.samba.org/show_bug.cgi?id=15134 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2022-3437 third_party/heimdal: Use constant-time memcmp() in unwrap_des3()Joseph Sutton2022-10-241-1/+1
| | | | | | | | | | The surrounding checks all use ct_memcmp(), so this one was presumably meant to as well. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15134 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2022-3437 third_party/heimdal: Use constant-time memcmp() for arcfour unwrapJoseph Sutton2022-10-241-7/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15134 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2022-3437 s4/auth/tests: Add unit tests for unwrap_des3()Joseph Sutton2022-10-244-0/+1279
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15134 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2022-3437 third_party/heimdal_build: Add gssapi-subsystem subsystemJoseph Sutton2022-10-241-6/+12
| | | | | | | | | | This allows us to access (and so test) functions internal to GSSAPI by depending on this subsystem. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15134 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2022-3437 third_party/heimdal: Remove __func__ compatibility workaroundJoseph Sutton2022-10-241-4/+0
| | | | | | | | | | | | As described by the C standard, __func__ is a variable, not a macro. Hence this #ifndef check does not work as intended, and only serves to unconditionally disable __func__. A nonoperating __func__ prevents cmocka operating correctly, so remove this definition. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15134 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* VERSION: Bump version up to Samba 4.16.5...Jule Anger2022-09-071-2/+2
| | | | | | and re-enable GIT_SNAPSHOT. Signed-off-by: Jule Anger <janger@samba.org>
* VERSION: Disable GIT_SNAPSHOT for the 4.16.5 release.samba-4.16.5Jule Anger2022-09-071-1/+1
| | | | Signed-off-by: Jule Anger <janger@samba.org>
* WHATSNEW: Add release notes for Samba 4.16.5.Jule Anger2022-09-071-2/+65
| | | | Signed-off-by: Jule Anger <janger@samba.org>
* smbd: check for streams support in unix_convert()Ralph Boehme2022-09-062-2/+8
| | | | | | | | | | | | | | | | | | | | Fixes a regression introduced by the fixes for bug 15126 where we crash in vfs_default in vfswrap_stat(): assert failed: !is_named_stream(smb_fname) The frontend calls into the VFS from build_stream_path() with a stream path without checking if the share supports streams. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15161 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> [slow@samba.org: change from master adapted for unix_convert()] Autobuild-User(v4-16-test): Jule Anger <janger@samba.org> Autobuild-Date(v4-16-test): Tue Sep 6 08:49:51 UTC 2022 on sn-devel-184
* smbd: return NT_STATUS_OBJECT_NAME_INVALID if a share doesn't support streamsRalph Boehme2022-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | This is what a Windows server returns. Tested with a share residing on a FAT formatted drive, a Windows filesystem that doesn't support streams. Combinations tested: file::$DATA file:stream file:stream:$DATA All three fail with NT_STATUS_OBJECT_NAME_INVALID. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15161 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 201e1969bf31af07e8bd52876ff7f4d72b48a848)
* smbtorture: add a test trying to create a stream on share without streams ↵Ralph Boehme2022-09-065-0/+53
| | | | | | | | | | | | support BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15161 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (backported from commit 3dcdab86f13fabb7a8c6ce71c59a565287d11244) [slow@samba.org: context changes from different tests]
* smbd: implement access checks for SMB2-GETINFO as per MS-SMB2 3.3.5.20.1Ralph Boehme2022-09-063-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The spec lists the following as requiring special access: - for requiring FILE_READ_ATTRIBUTES: FileBasicInformation FileAllInformation FileNetworkOpenInformation FileAttributeTagInformation - for requiring FILE_READ_EA: FileFullEaInformation All other infolevels are unrestricted. We ignore the IPC related infolevels: FilePipeInformation FilePipeLocalInformation FilePipeRemoteInformation BUG: https://bugzilla.samba.org/show_bug.cgi?id=15153 RN: Missing SMB2-GETINFO access checks from MS-SMB2 3.3.5.20.1 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Aug 23 12:54:08 UTC 2022 on sn-devel-184 (cherry picked from commit 6d493a9d568c08cfe5242821ccbd5a5ee1fe5284)
* smbtorture: check required access for SMB2-GETINFORalph Boehme2022-09-063-0/+150
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15153 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 9b2d28157107602fcbe659664cf9ca25f08bb30b)
* s4/libcli/smb2: avoid using smb2_composite_setpathinfo() in smb2_util_setatr()Ralph Boehme2022-09-062-15/+32
| | | | | | | | | | | | | | | smb2_composite_setpathinfo() uses SEC_FLAG_MAXIMUM_ALLOWED which can have unwanted side effects like breaking oplocks if the effective access includes [READ|WRITE]_DATA. For changing the DOS attributes we only need SEC_FILE_WRITE_ATTRIBUTE. With this change test_smb2_oplock_batch25() doesn't trigger an oplock break anymore. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15153 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 66e40690bdd41800a01333ce4243bd62ee2b1894)
* smbd: directly pass fsp to SMB_VFS_FGETXATTR() in fget_ea_dos_attribute()Ralph Boehme2022-09-061-2/+2
| | | | | | | | | | | | | | | | We're now consistently passing the base_fsp to SMB_VFS_FSET_DOS_ATTRIBUTES(), so we don't need to check for a stream_fsp here anymore. Additionally vfs_default will assert a non-stream fsp inside vfswrap_fgetxattr(), so in case any caller wrongly passes a stream fsp, this is caught in vfs_default. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 968a5ae89f0d0da219e7dd05dd1f7f7c96dbb910)
* smbd: add and use vfs_fget_dos_attributes()Ralph Boehme2022-09-065-5/+59
| | | | | | | | | | | | | | | | | | | | | Commit d71ef1365cdde47aeb3465699181656b0655fa04 caused a regression where the creation date on streams wasn't updated anymore on the stream fsp. By adding a simple wrapper vfs_fget_dos_attributes() that takes care of - passing only the base_fsp to the VFS, so the VFS can be completely agnostic of all the streams related complexity like fake fds, - propagating any updated btime from the base_fsp->fsp_name to the stream_fsp->fsp_name BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (backported from commit 3f7d8db9945a325020e4d1574289dea9e8331c29) [slow@samba.org: also update itime and file_id]
* smbtorture: add test smb2.stream.attributes2Ralph Boehme2022-09-062-0/+356
| | | | | | | | | | | Specifically torture the creation date is the same for the file and its streams. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit e74b10e17ee5df0f77ac5349242841be8d71c4e8)
* smbtorture: rename smb2.streams.attributes to smb2.streams.attributes1Ralph Boehme2022-09-062-5/+5
| | | | | | | | | | | | A subsequent commit adds another streams test named "attributes2", this change avoids matching the new testname with the existing knownfail entries. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit b5848d391be4f7633745d9c36e432ac8b1c9dba2)
* vfs_default: assert all passed in fsp's and names are non-stream typeRalph Boehme2022-09-061-38/+56
| | | | | | | | | | | | | | | | | | Enforce fsp is a non-stream one in as many VFS operations as possible in vfs_default. We really need an assert here instead of returning an error, as otherwise he can have very hard to diagnose bugs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 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): Wed Aug 10 16:32:35 UTC 2022 on sn-devel-184 (backported from commit fc45fcfde51b0b0bdcd524c82a0f9eabf7273045) [slow@samba.org: skip some hunks that are not applicable]
* vfs_streams_xattr: restrict which fcntl's are allowed on streamsRalph Boehme2022-09-061-0/+33
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 51243e3849736acbbf1d8f52cc02cdec5995fde4)
* smbd: skip access checks for stat-opens on streams in open_file()Ralph Boehme2022-09-061-22/+29
| | | | | | | | | | | | | | | | For streams, access is already checked in create_file_unixpath() by check_base_file_access(). We already skip the access check in this function when doing an IO open of a file, see above in open_file(), also skip it for "stat opens". BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (backported from commit f0299abf1b28a14518328710d9f84bef17fd2ecf) [slow@samba.org: smbd_check_access_rights_fsp(dirfsp) -> smbd_check_access_rights_fsp(parent_dir->fsp)]
* smbd: use metadata_fsp() in get_acl_group_bits()Ralph Boehme2022-09-061-1/+1
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (backported from commit 06555c6bcb5644fc9eea35b3cbae8d8801c65ab6) [slow@samba.org: metadata_fsp(fsp) -> metadata_fsp(smb_fname->fsp)]
* smbd: ignore request to set the SPARSE attribute on streamsRalph Boehme2022-09-061-0/+13
| | | | | | | | | | | | | As per MS-FSA 2.1.1.5 this is a per stream attribute, but our backends don't support it in a consistent way, therefor just pretend success and ignore the request. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 3af8f8e8741cc8c889bbf416ccd38a1b702917ec)
* smbd: use metadata_fsp() with SMB_VFS_FSET_DOS_ATTRIBUTES()Ralph Boehme2022-09-061-3/+2
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 55e55804bb2d0f21c1bbe207257bb40555f3b7a2)
* smbd: use metadata_fsp() with SMB_VFS_FGET_DOS_ATTRIBUTES()Ralph Boehme2022-09-062-2/+4
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 03b9ce84736d536ab2dd8a5ce1a2656e6a90c8c8)
* smbd: use metadata_fsp() with SMB_VFS_FSET_NT_ACL()Ralph Boehme2022-09-063-4/+10
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 4ab29e2a345b48ebba652d5154e96adf954a6757)
* smbd: use metadata_fsp() with SMB_VFS_FGET_NT_ACL()Ralph Boehme2022-09-067-8/+7
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (backported from commit c949e4b2a42423ac3851e86e489fd0c5d46d7f1f) [slow@samba.org: context mismatch due to smbd_check_access_rights_fname() call in master]
* CI: add a test trying to delete a stream on a pathref ("stat open") handleRalph Boehme2022-09-064-0/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using vfs_streams_xattr, for a pathref handle of a stream the system fd will be a fake fd created by pipe() in vfs_fake_fd(). For the following callchain we wrongly pass a stream fsp to SMB_VFS_FGET_NT_ACL(): SMB_VFS_CREATE_FILE(..., "file:stream", ...) => open_file(): if (open_fd): -> taking the else branch: -> smbd_check_access_rights_fsp(stream_fsp) -> SMB_VFS_FGET_NT_ACL(stream_fsp) This is obviously wrong and can lead to strange permission errors when using vfs_acl_xattr: in vfs_acl_xattr we will try to read the stored ACL by calling fgetxattr(fake-fd) which of course faild with EBADF. Now unfortunately the vfs_acl_xattr code ignores the specific error and handles this as if there was no ACL stored and subsequently runs the code to synthesize a default ACL according to the setting of "acl:default acl style". As the correct access check for streams has already been carried out by calling check_base_file_access() from create_file_unixpath(), the above problem is not a security issue: it can only lead to "decreased" permissions resulting in unexpected ACCESS_DENIED errors. The fix is obviously going to be calling smbd_check_access_rights_fsp(stream_fsp->base_fsp). This test verifies that deleting a file works when the stored NT ACL grants DELETE_FILE while the basic POSIX permissions (used in the acl_xattr fallback code) do not. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 23bc760ec5d61208c2d8778991e3d7e202eab352)
* vfs_xattr_tdb: add "xattr_tdb:ignore_user_xattr" optionRalph Boehme2022-09-061-1/+84
| | | | | | | | | | | | | Allows passing on "user." xattr to the backend. This can be useful for testing specific aspects of operation on streams when "streams_xattr" is configured as stream filesystem backend. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 92e0045d7ca7c0b94efd0244ba0e426cad0a05b6)
* vfs_xattr_tdb: add a module configRalph Boehme2022-09-061-97/+99
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 451ad315a9bf32c627e1966ec30185542701c87e)
* vfs_xattr_tdb: move close_xattr_db()Ralph Boehme2022-09-061-10/+10
| | | | | | | | | | | This just makes the diff of the next commit smaller and easier to digest. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit b26dc252aaf3f4b960bdfdb6a3dfe612b89fcdd5)
* smdb: use fsp_is_alternate_stream() in open_file()Ralph Boehme2022-09-061-2/+2
| | | | | | | | | | | No change in behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 0d3995cec10c5fae8c8b6a1df312062e38437e6f)
* smbd: Introduce metadata_fsp()Volker Lendecke2022-09-062-0/+9
| | | | | | | | | | | | | | | Centralize the pattern if (fsp->base_fsp != NULL) { fsp = fsp->base_fsp; } with a descriptive name. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (backported from commit ac58b0b942cd73210100ee346816a0cf23900716) [slow@samba.org: only backport the function, skip all updated callers]
* smbd: Introduce fsp_is_alternate_stream()Volker Lendecke2022-09-062-0/+6
| | | | | | | | | | | To me this is more descriptive than "fsp->base_fsp != NULL". If this turns out to be a performance problem, I would go and make this a static inline in smbd/proto.h. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (backported from commit 21b380ca133417df096e2b262a5da41faff186ea) [slow@samba.org: only backport the function, skip all changed callers]
* lib:replace: Only include <sys/mount.h> on non-Linux systemsAndreas Schneider2022-08-232-1/+6
| | | | | | | | | | | | | | Details at: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E BUG: https://bugzilla.samba.org/show_bug.cgi?id=15132 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 766151bf5b7ef95ae4c8c98b8994e5c21c5bbec0) Autobuild-User(v4-16-test): Jule Anger <janger@samba.org> Autobuild-Date(v4-16-test): Tue Aug 23 08:53:41 UTC 2022 on sn-devel-184
* s3: smbd: Plumb close_type parameter through close_file_in_loop(), ↵Jeremy Allison2022-08-231-6/+9
| | | | | | | | | | | | | | | | | | | file_close_conn() Allows close_file_in_loop() to differentiate between SHUTDOWN_CLOSE (previously it only used this close type) and ERROR_CLOSE - called on error from smbXsrv_tcon_disconnect() in the error path. In that case we want to close the fd, but not run any delete-on-close actions. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15128 Signed-off-by: Jeremy Allison <jra@samba.org> Reivewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Thu Aug 18 14:10:18 UTC 2022 on sn-devel-184 (cherry picked from commit cf5f7b1489930f6d64c3e3512f116ccf286d4605)
* s3: smbd: Add "enum file_close_type close_type" parameter to file_close_conn().Jeremy Allison2022-08-233-3/+3
| | | | | | | | | | | | Not yet used. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15128 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org> (cherry picked from commit 7005a6354df5522d9f665fb30052c458dfc93124) [npower@samba.org Adjusted for 4.15 filename change smb2-service.c -> service.c]
* s3: smbd: Add "enum file_close_type close_type" parameter to close_cnum().Jeremy Allison2022-08-233-4/+8
| | | | | | | | | | | | | | | Not yet used, but needed so we can differentiate between SHUTDOWN_CLOSE and ERROR_CLOSE in smbXsrv_tcon_disconnect() if we fail to chdir. In that case we want to close the fd, but not run any delete-on-close actions. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15128 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org> (cherry picked from commit 9203d17106c0e55a30813ff1ed76869c7581a343) [npower@samba.org Adjusted for 4.15 filename change smb2-service.c -> service.c]