summaryrefslogtreecommitdiff
path: root/source3
Commit message (Collapse)AuthorAgeFilesLines
...
* s3-vfs: Use ENOATTR in errno comparison for getxattrAnoop C S2019-02-053-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | * ENODATA is not defined in FreeBSD * ENOATTR is defined to be a synonym for ENODATA in Linux * In its absence Samba already defines ENOATTR to either ENODATA or ENOENT Thus it is safe and correct to compare with ENOATTR rather than ENODATA. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13774 Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jan 23 21:59:10 CET 2019 on sn-devel-144 (cherry picked from commit c99402724a65f4e1f8ed4dcd236a43e0603bef0a) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Tue Feb 5 20:31:37 CET 2019 on sn-devel-144
* s3-vfs: add glusterfs_fuse vfs module.Günther Deschner2019-02-053-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | This module only implements the get_real_filename function by accessing a distinct extended attribute that is available over a glusterfs fuse mount. By implementing this vfs function users of a glusterfs fuse mount achieve a much better performance in create based workloads where samba then can avoid trying multiple case folding options to detect the real filename. Patch is based on an initial patch provided by Poornima G <pgurusid@redhat.com> BUG: https://bugzilla.samba.org/show_bug.cgi?id=13774 Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Tue Jan 22 18:37:56 CET 2019 on sn-devel-144 (cherry picked from commit adffe0dcf002aa4721dc7897261895e3486d5271)
* vfs_glusterfs: Adapt to changes in libgfapi signaturesAnoop C S2019-02-052-0/+22
| | | | | | | | | | | | | | | | | VFS module for GlusterFS fails to compile due to recent changes done to some API signatures. Therefore adding missing arguments to those APIs adapting to new signatures. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13330 Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sun Feb 3 17:00:33 CET 2019 on sn-devel-144 (cherry picked from commit 0e3eda5bab5ae9316a42725aea048fb350020ec7)
* vfs_fileid: fix fsname_norootdir algorithmRalph Wuerthner2019-02-051-1/+2
| | | | | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13744 Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Jan 17 01:36:54 CET 2019 on sn-devel-144 (cherry picked from commit 2723d900ef35f4797058675f298f4a4364b29cd3)
* vfs_fileid: fix get_connectpath_inoRalph Wuerthner2019-02-011-1/+3
| | | | | | | | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13741 Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Jan 15 04:13:15 CET 2019 on sn-devel-144 (cherry picked from commit 12398a2d1ddcd326e02e5d8b0749e0e796145165) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Fri Feb 1 17:06:06 CET 2019 on sn-devel-144
* s3:libsmb: cli_smb2_list() can sometimes fail initially on a connectionTim Beale2019-02-011-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cli_smb2_list() appears to be a slightly unique SMB operation in that it specifies the max transaction size for the response buffer size. The Python bindings highlighted a problem where if cli_smb2_list() were one of the first operations performed on the SMBv2 connection, it would fail due to insufficient credits. Because the response buffer size is (potentially) so much larger, it requires more credits (128) compared with other SMB operations. When talking to a samba DC, the connection credits seem to start off at 1, then increase by 32 for every SMB reply we receive back from the server. After cli_full_connection(), the connection has 65 credits. The cli_smb2_create_fnum() in cli_smb2_list() adds another 32 credits, but this is still less than the 128 that smb2cli_query_directory() requires. This problem doesn't happen for smbclient because the cli_cm_open() API it uses ends up sending more messages, and so the connection has more credits. This patch changes cli_smb2_list(), so it requests a smaller response buffer size if it doesn't have enough credits available for the max transaction size. smb2cli_query_directory() is already in a loop, so it can span multiple SMB messages if for some reason the transaction size isn't big enough for the listings. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13736 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Jan 10 02:40:16 CET 2019 on sn-devel-144 (cherry picked from commit fd355dff906f5f4832901bce76544f1a4e50c33d)
* s3: libsmb: use smb2cli_conn_max_trans_size() in cli_smb2_list()Ralph Boehme2019-02-011-1/+2
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13736 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 580ff206431969dc2924d520053b956b7169ca07)
* s3: lib: nmbname: Ensure we limit the NetBIOS name correctly. CID: 1433607Jeremy Allison2019-02-011-13/+21
| | | | | | | | | | | | | | | | | | | | Firstly, make the exit condition from the loop explicit (we must never write into byte n, where n >= sizeof(name->name). Secondly ensure exiting from the loop that n==MAX_NETBIOSNAME_LEN, as this is the sign of a correct NetBIOS name encoding (RFC1002) in order to properly read the NetBIOS name type (which is always encoded in byte 16 == name->name[15]). BUG: https://bugzilla.samba.org/show_bug.cgi?id=11495 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Tue Nov 13 20:54:56 CET 2018 on sn-devel-144 (cherry picked from commit 3634e20c7603103b0f2e00e5b61cc63f905d780d)
* s3-vfs-fruit: add close callGünther Deschner2019-01-141-0/+82
| | | | | | | | | | | | | | | | | | | | | https://bugzilla.samba.org/show_bug.cgi?id=13725 We cannot always rely on vfs_default to close the fake fds. This mostly is relevant when used with another non-local VFS filesystem module such as gluster. Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Dec 21 07:20:49 CET 2018 on sn-devel-144 (cherry picked from commit ba016939aa91e0806f509c8b8ce9506bebceb7e5) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Mon Jan 14 14:50:09 CET 2019 on sn-devel-144
* s3-vfs-streams_xattr: add close callGünther Deschner2019-01-141-0/+26
| | | | | | | | | | | | | | | | | | https://bugzilla.samba.org/show_bug.cgi?id=13725 We cannot always rely on vfs_default to close the fake fds. This mostly is relevant when used with another non-local VFS filesystem module such as gluster. Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Dec 20 07:18:20 CET 2018 on sn-devel-144 (cherry picked from commit 1b263ed631c86bf4117c9388fce3fa1f24cea4c9)
* s3:auth_winbind: ignore a missing winbindd as NT4 PDC/BDC without trustsStefan Metzmacher2019-01-091-1/+32
| | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13722 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Alexander Bokovoy <ab@samba.org> Autobuild-Date(master): Thu Dec 20 12:15:09 CET 2018 on sn-devel-144 (cherry picked from commit 63dc60767eb13d8fc09ed4bc44faa538581b18f1) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Wed Jan 9 15:55:39 CET 2019 on sn-devel-144
* s3:auth_winbind: return NT_STATUS_NO_LOGON_SERVERS if winbindd is not availableStefan Metzmacher2019-01-091-1/+1
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13722 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13723 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> (cherry picked from commit ec3adc1e5b3cc953576efa795dfb25af08a8ab79)
* s3:auth_winbind: remove fallback to optional backendStefan Metzmacher2019-01-092-17/+1
| | | | | | | | | | | | This is not possible anymore, as the trustdomain backend was removed in commit 75c152c0d764165a4a9dd0a85390af063dd0192a. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13722 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13723 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> (cherry picked from commit f3bac8c91121871bf8ce852bc3e3ea2e834d3f27)
* s3-smbd: avoid assuming fsp is always intact after close_file call.Günther Deschner2019-01-091-1/+1
| | | | | | | | | | | | | | | | Instead use the already copied smb_fname directly. https://bugzilla.samba.org/show_bug.cgi?id=13720 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Tue Dec 18 20:11:07 CET 2018 on sn-devel-144 (cherry picked from commit 90fab07f0710bb2061d3f14326c874dd049823fc)
* s3:utils/smbget fix recursive download with empty source directoriesChristian Ambach2019-01-072-1/+38
| | | | | | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13199 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Oct 26 09:58:07 CEST 2018 on sn-devel-144 (cherry picked from commit fce0d1b290c7a2205f2454b268b55909d1044f1b) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Mon Jan 7 15:56:31 CET 2019 on sn-devel-144
* s3:utils/smbget add error handling for mkdir() callsChristian Ambach2019-01-072-1/+33
| | | | | | Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit b89732c31be350828110fe46f2c655f77cb488f3)
* s3:script/tests reduce code duplicationChristian Ambach2019-01-071-11/+15
| | | | | | Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit 525b19fafb43bd97e3dfc1d3e7dc13955c0f387f)
* vfs_shadow_copy2: in fstat also convert fsp->fsp_name and ↵Ralph Boehme2018-12-131-8/+50
| | | | | | | | | | | | | | | | fsp->base_fsp->fsp_name Stacked VFS modules might use the file name, not the file handle. Looking at you, vfs_fruit... Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit aa1fac696956f96e89e54ddd4535a6e2844161b0) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Thu Dec 13 18:20:47 CET 2018 on sn-devel-144
* s3:smbd: pass down twrp from SMB2_CREATE to filename_convert()Ralph Boehme2018-12-131-24/+5
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 9c462e1b324ebad60c51bd6e8e659b39a31ec02e)
* s3:smbd: add twrp args to filename_convert()Ralph Boehme2018-12-139-2/+36
| | | | | | | | | | All existing callers pass NULL, no change in behaviour. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 14b6e6842b76d7c3e53249ba026a3ff51615ebd7)
* s3:smbd: add twrp processing to filename_convert_internal()Ralph Boehme2018-12-131-0/+26
| | | | | | | | | | Not used for now, existing callers pass NULL. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit c69bd336a17ca04dbfb4f5d04a963d25b9925118)
* s3:smbd: prepare filename_convert_internal() for twrpRalph Boehme2018-12-131-1/+4
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit bffc540bc8459cbb1bd1a98528fb1d3b2b54d1d2)
* s3:selftest: add a VSS test reading a streamRalph Boehme2018-12-131-0/+38
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit cfffa2e2428b42db65a4ece00602e0cef8ceb5a3)
* s3-vfs: Prevent NULL pointer dereference in vfs_glusterfs.Günther Deschner2018-12-131-32/+168
| | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13708 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Tue Dec 11 17:26:31 CET 2018 on sn-devel-144 (cherry picked from commit 75d15484f3b71b1a2684c4a73e53aaa467f9932b)
* vfs_shadow_copy2: nicely deal with attempts to open previous version for writingRalph Boehme2018-12-131-2/+122
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit cf95756235f718478e556ce1fbf7c032f9c9acfb)
* vfs_shadow_copy2: add shadow_copy2_strip_snapshot_convertedRalph Boehme2018-12-131-0/+16
| | | | | | | | | | | Can be used by callers to determine if a path is in fact pointing at a file in a snapshot. Will be used in the next commit. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 14d6488d355e960ab02e72c414cbbc316f1db718)
* vfs_shadow_copy2: add _already_converted arg to ↵Ralph Boehme2018-12-131-8/+24
| | | | | | | | | | | | shadow_copy2_strip_snapshot_internal() Not used for now, all existing callers pass NULL. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 87bf06ed790dad8a4f650c0cd1b6781864666cbf)
* s3:script/tests: add a test for VSS write behaviourRalph Boehme2018-12-132-0/+77
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (backported from commit 12778f015988f7e8755016c72c26939998758dae)
* vfs_error_inject: add EBADF errorRalph Boehme2018-12-131-0/+1
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 523a9b312c9f09178a5afefb48343e684e41d817)
* vfs_error_inject: add pwriteRalph Boehme2018-12-131-0/+18
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 55a82f907f6410ff478e82b0cf7f1caeacaf5ddd)
* winbindd: Route predefined domains through the BUILTIN domain childRalph Boehme2018-12-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this eg "NT Authority" didn't work: $ bin/wbinfo -n "NT Authority/Authenticated Users" failed to call wbcLookupName: WBC_ERR_DOMAIN_NOT_FOUND Could not lookup name NT Authority/Authenticated Users $ bin/wbinfo --group-info="NT Authority/Authenticated Users" failed to call wbcGetgrnam: WBC_ERR_DOMAIN_NOT_FOUND Could not get info for group NT Authority/Authenticated Users With the patch: $ bin/wbinfo -n "NT Authority/Authenticated Users" S-1-5-11 SID_WKN_GROUP (5) $ bin/wbinfo --group-info="NT Authority/Authenticated Users" NT AUTHORITY\authenticated users:x:10002: BUG: https://bugzilla.samba.org/show_bug.cgi?id=12164 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: David Mulder <dmulder@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Dec 5 11:27:22 CET 2018 on sn-devel-144 (cherry picked from commit 8b8d9fdad4a4e2c479141b3d40e9a7320a49c0dd) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Fri Dec 7 16:15:58 CET 2018 on sn-devel-144
* winbindd: fix predefined domains routing in find_lookup_domain_from_sid()Ralph Boehme2018-12-071-19/+8
| | | | | | | | | | | | | Route predefined domains through the BUILTIN domain child, not passdb. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12164 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: David Mulder <dmulder@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit b512a58bbd7361cbbcf68f6713943377338fc2a1)
* winbindd: add some bracesRalph Boehme2018-12-071-1/+2
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12164 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: David Mulder <dmulder@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit e0f784baeaa73096534d9a1ed941028d99f84ece)
* vfs_zfsacl: return synthesized ACL when ZFS return ENOTSUPRalph Boehme2018-11-281-2/+34
| | | | | | | | | | | | | | | | | | This allows accessing the ZFS .snapshots directory where ZFS returns ENOTSUP when calling acl(".snapshots"). Bug: https://bugzilla.samba.org/show_bug.cgi?id=13175 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri May 18 22:03:21 CEST 2018 on sn-devel-144 (cherry picked from commit f93cc232377d4c686ac35ee5e14e798974bc0700) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Wed Nov 28 13:20:55 CET 2018 on sn-devel-144
* s3:smbd: make psbuf arg to make_default_acl_posix() constRalph Boehme2018-11-282-5/+5
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13175 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit ec2a40831359ae93f437ef76f8ba76bbd95bc6dc)
* s3:smb2_sesssetup: check session_info security level before it gets ↵Ralph Boehme2018-11-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | talloc_move'd We talloc_move() session_info to session->global->auth_session_info which sets session_info to NULL. This means security_session_user_level(NULL, NULL) will always return SECURITY_ANONYMOUS so we never sign the session setup response. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Nov 13 14:22:46 CET 2018 on sn-devel-144 (cherry picked from commit bb93e691ca9b1922bf552363a1e7d70792749d67) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Fri Nov 23 13:52:04 CET 2018 on sn-devel-144
* s3:selftest: also run smb2.session torture testsuite against ad_memberRalph Boehme2018-11-231-0/+1
| | | | | | | | | | | | | | | The next commit adds a subtest to the smb2.session testsuite that requires Kerberos (ad_dc would work), but where neither SMB2 server or client must require signing (ad_dc, being an AD DC, requires signing). The ad_member environment supports Kerberos with the SMB2 server not mandating signing, that'll do. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit b86c94f0b929f2d9e521d41396c4e1611f5a4c5b)
* s3:selftest: split "raw.session" and "smb2.session"Ralph Boehme2018-11-231-1/+6
| | | | | | | | | | The next commit is going to add a testsuite to "smb2.session". Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit d0a8899ed57c2b368c3870b3899a3422251222aa)
* vfs_fruit: validation of writes on AFP_AfpInfo streamRalph Boehme2018-11-141-8/+55
| | | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13677 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (backported from commit a7c877847f855be5ee6673e541a181b818013abf) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Wed Nov 14 17:12:08 CET 2018 on sn-devel-144
* vfs_fruit: move a comment to the right placeRalph Boehme2018-11-141-7/+12
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13677 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 4901d71c3de754a106662d01481b960ed7c2c4dd)
* selftest: Run smb2.delete-on-close-perms also with "delete readonly = yes"Christof Schmitt2018-11-071-0/+4
| | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13673 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Sat Nov 3 05:55:45 CET 2018 on sn-devel-144 (cherry picked from commit 7dd3585f9c3ae04df45d98bfdc62663c7a69d3e0) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Wed Nov 7 13:19:41 CET 2018 on sn-devel-144
* smbd: Fix DELETE_ON_CLOSE behaviour on files with READ_ONLY attributeChristof Schmitt2018-11-071-8/+22
| | | | | | | | | | | | | | | MS-FSA states that a CREATE with FILE_DELETE_ON_CLOSE on an existing file with READ_ONLY attribute has to return STATUS_CANNOT_DELETE. This was missing in smbd as the check used the DOS attributes from the CREATE instead of the DOS attributes on the existing file. We need to handle the new file and existing file cases separately. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13673 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 162a5257c48f20d3752f644e86c9e626b46436c0)
* vfs_fruit: let fruit_open_meta() with O_CREAT return a fake-fdRalph Boehme2018-11-061-93/+72
| | | | | | | | | | | | | | | | | This is the final step in implementing the needed macOS semantics on the FinderInfo stream: as long as the client hasn't written a non-zero FinderInfo blob to the stream, there mustn't be a visible filesystem entry for other openers. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Nov 1 01:14:23 CET 2018 on sn-devel-144 (cherry picked from commit 1b2de44ea8114cf2025e8b8c843131e2f2dbed27)
* vfs_fruit: don't check for delete-on-close on the FinderInfo streamRalph Boehme2018-11-061-72/+1
| | | | | | | | | | | macOS SMB server doesn't filter out the FinderInfo stream if it has delete-on-close set. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit d8c1bb52018289878b9397d513ebbae63933a05f)
* vfs_fruit: let fruit_pwrite_meta_stream also ftruncate empty FinderInfoRalph Boehme2018-11-061-12/+18
| | | | | | | | | | | | | | | | | | | | | fruit_streaminfo currently filters out the FinderInfo stream is delete-on-close is set. We set it here internally, but the client may also set it over SMB. Turns out that the macOS SMB server does NOT filter out FinderInfo stream with delete-on-close set, so we must change the way filtering is done in fruit_streaminfo. Filtering is now done based on the FinderInfo stream being 0-bytes large which is why I'm adding the ftruncate here. No idea why the tests that check the filtering passed the commits leading up to this one, but if you revert this commit after applying the whole patchset, the "delete AFP_AfpInfo by writing all 0" test will fail. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 480695cd723cc4949e0b39ddb83560efac393412)
* vfs_fruit: pass stream size to delete_invalid_meta_stream()Ralph Boehme2018-11-061-3/+12
| | | | | | | | | | | | | delete_invalid_meta_stream() is meant to guard against random data being present in the FinderInfo stream. If the stream size is 0, it's likely a freshly created stream where no data has been written to yet, so don't delete it. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 6e13dbddaec9f8118e11309297f85c3cdfd22e43)
* vfs_fruit: let fruit handle all aio on the FinderInfo metadata streamRalph Boehme2018-11-061-3/+1
| | | | | | | | | | | This will be required to support using fake fds for the FinderInfo metadata stream. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 6fd256afcd5fedc894036efbfba1fc6d2264fba9)
* vfs_fruit: do ino calculationRalph Boehme2018-11-061-2/+48
| | | | | | | | | | | | As we'll start returning fake fds in open shortly, we can't rely on the next module to calculat correct inode numbers for streams and must take over that responsibility. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 80afafe398566fd622f431966808d08ba9ec6473)
* vfs_fruit: prepare fruit_pread_meta() for reading on fake-fdRalph Boehme2018-11-061-2/+20
| | | | | | | | | | | | | If the read on the stream fails we may have hit a handle on a just created stream (fio->created=true) with no data written yet. If that's the case return an empty initialized FinderInfo blob. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit d7d92710711f6e555ed45c1dda528cd6a83e1bf5)
* vfs_fruit: prepare fruit_pwrite_meta() for on-demand opening and writingRalph Boehme2018-11-061-0/+34
| | | | | | | | | | | | | | | | | | This avoid creating files or blobs in our streams backend when a client creates a stream but hasn't written anything yet. This is the only sane way to implement the following semantics: * client 1: create stream "file:foo" * client 2: open stream "file:foo" The second operation of client 2 must fail with NT_STATUS_NOT_FOUND. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 4a5c9a9e73230f640eb045a3c47af75b5be9f1d6)