1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

2543 Commits

Author SHA1 Message Date
Jeremy Allison
644ab10b04 s3: modules: Fruit. Now we know we have a handle, always use VFS_FCHMOD instead of VFS_CHMOD.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2019-06-24 18:49:10 +00:00
Volker Lendecke
4bbe291efc vfs: Remove SMB_VFS_BRL_CANCEL_WINDOWS
This is not called anymore, bump the VFS version number in a separate
commit

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 Jun 20 18:34:20 UTC 2019 on sn-devel-184
2019-06-20 18:34:20 +00:00
Volker Lendecke
67f89bb330 smbd: Return "blocker_pid" from do_lock()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-06-20 17:18:18 +00:00
Günther Deschner
7cc9e3fe24 s3/vfs_glusterfs_fuse: Avoid using NAME_MAX directly
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13872

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Jun 11 00:29:19 UTC 2019 on sn-devel-184
2019-06-11 00:29:19 +00:00
Günther Deschner
e85bb58532 s3/vfs_glusterfs: Avoid using NAME_MAX directly
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13872

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2019-06-10 23:14:11 +00:00
Günther Deschner
01a569bec0 Revert "s3/vfs_glusterfs_fuse: Dynamically determine NAME_MAX"
This reverts commit e28d172b00.

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2019-06-10 23:14:10 +00:00
Günther Deschner
1ea533bd5f Revert "s3/vfs_glusterfs: Dynamically determine NAME_MAX"
This reverts commit 8e3a042eb9.

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2019-06-10 23:14:10 +00:00
Andreas Schneider
046de05521 s3:modules: Put debug msg into the if clause checking the strings exists
error: '%s' directive argument is null [-Werror=format-overflow=]

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-06-04 22:13:07 +00:00
Noel Power
52cf237b1d s3/modules: cppcheck: Fix ctunullpointer error
Fixes

source3/modules/vfs_syncops.c:117: error: ctunullpointer: Null pointer dereference: smb_fname <--[cppcheck]

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-06-04 22:13:07 +00:00
Ralph Boehme
9a2c9834cb vfs_fruit: remove a now unnecessary include
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

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 May 30 22:12:50 UTC 2019 on sn-devel-184
2019-05-30 22:12:50 +00:00
Ralph Boehme
9fe84a6345 vfs_fruit: use VFS functions in ad_read_rsrc_adouble()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:28 +00:00
Ralph Boehme
70c4a8f0ac vfs_fruit: use fsp and remove syscalls from ad_convert_blank_rfork()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
3739ad90cf vfs_fruit: use VFS function in ad_convert_truncate()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
4e44b1da93 vfs_fruit: add VFS handle to ad_convert_truncate()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
4ff7ea0e03 vfs_fruit: use fsp and remove mmap in ad_convert_xattr()
No need to mmap() anyway, the xattr data is already available in ad->ad_data.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
0041855af0 vfs_fruit: remove use of mmap() from ad_convert_move_reso()
We now have an fsp that we can use, so we can get rid of mmap() and
sys_pread()/sys_pwrite().

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
29418c726b vfs_fruit: convert ad_open_rsrc() to open a proper fsp with SMB_VFS_CREATE_FILE()
A first step in converting all raw syscalls to use proper VFS functions. All
existing users of the raw system filedescriptor continue to use the fd from
fsp->fh for now.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
f5f7d1e9bf vfs_fruit: only do cross protocol locking on non-internal opens
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
97d485ff2c vfs_fruit: remove a layer of indirection
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
3919ea048f vfs_fruit: pass VFS handle to ad_convert_move_reso()
Not used for now, that comes next.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
e3cb1cb24f vfs_fruit: remove xattr code from the AppleDouble subsystem
The subsystem consumers have been reworked in the previous commits, so this is
not used anymore. ad_init() doesn't need a handle argument anymore due to this,
remove it as well.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
cb9dffa1c6 vfs_fruit: remove now unused AppleDouble code for resource fork in xattr
This was only needed to get the resourcefork size via the ad_* AppleDouble
function. This is now done with a fstat on the low level xattr fd (remember,
this is Solaris only code...), so we can remove the xattr special casing from
the AppleDouble functions.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
a23bcc1916 vfs_fruit: use stream code for resource fork size calculation in readdir_attr_rfork_size()
This works as well, using an fstat() on the filehandle to get the size. This is
tested by the torture test "vfs.fruit.SMB2/CREATE context AAPL".

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
83179a7411 vfs_fruit: use correct case FRUIT_RSRC_STREAM in readdir_attr_rfork_size()
This is a genuine bug, but luckily this would only impact configs which nobody
uses:

  fruit:metadata = netatalk
  fruit:resource = stream

With the above configuration the switch in readdir_attr_rfork_size() would hit
the default case and so always report resource forks as 0 bytes in size.

All deployment that I've seen that use fruit:resource=stream also use
fruit:metadata=stream, so the switch takes FRUIT_META_STREAM case which runs the
correct code readdir_attr_rfork_size_stream().

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
797dc64945 vfs_fruit: ignore AppleDouble files in fruit_unlink()
Otherwise, if SMB_VFS_UNLINK() is called for an AppleDouble path "._file", we
try to delete "._._file" which doesn't make sense. AppleDouble files don't have
AppleDouble themselves.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
44d8568001 vfs_fruit: add a missing else
Luckily the missing else has the same control flow due to the previous if and
else blocks calling return.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:27 +00:00
Ralph Boehme
ad70c947c7 vfs_fruit: add and use is_adouble_file()
This adds a helper function that checks whether the last component of a path is
an AppleDouble sidecar file with "._" name prefix.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:26 +00:00
Ralph Boehme
e266daaed1 vfs_fruit: finally, remove ad_handle from struct adouble
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:26 +00:00
Ralph Boehme
5f4d16b40e vfs_fruit: pass handle to ad_convert_delete_adfile()
On the course of removing ad_handle from struct adouble, step 10.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:26 +00:00
Ralph Boehme
50874c1548 vfs_fruit: pass handle to ad_convert_finderinfo()
On the course of removing ad_handle from struct adouble, step 9.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:26 +00:00
Ralph Boehme
adc7ac38b8 vfs_fruit: pass handle to ad_convert_blank_rfork()
On the course of removing ad_handle from struct adouble, step 8.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:26 +00:00
Ralph Boehme
fd2f4cf828 vfs_fruit: pass handle to ad_convert_xattr()
On the course of removing ad_handle from struct adouble, step 7.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:26 +00:00
Ralph Boehme
400b3c2f8c vfs_fruit: indentation fix
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:26 +00:00
Ralph Boehme
661dfa4a19 vfs_fruit: pass handle to ad_read_rsrc() and all the way down
On the course of removing ad_handle from struct adouble, step 5.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:26 +00:00
Ralph Boehme
30ca328c69 vfs_fruit: use proper VFS function in ad_read_meta()
Continuing to ignore a possible error for now, this is in an error codepath
anyway.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:26 +00:00
Ralph Boehme
47721d8d35 vfs_fruit: indentation fix
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:26 +00:00
Ralph Boehme
f8df09157f vfs_fruit: pass handle to ad_read_meta()
On the course of removing ad_handle from struct adouble, step 4.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:26 +00:00
Ralph Boehme
d0abf945e6 vfs_fruit: pass handle to ad_read()
On the course of removing ad_handle from struct adouble, step 3.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:26 +00:00
Ralph Boehme
c78ba30ac4 vfs_fruit: pass handle to ad_set()
On the course of removing ad_handle from struct adouble, step 2.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:26 +00:00
Ralph Boehme
585d4d4977 vfs_fruit: pass handle to ad_fset()
On the course of removing ad_handle from struct adouble, step 1.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-30 20:19:26 +00:00
Ralph Boehme
78a4639b2d vfs_fruit: change trigger points of AppleDouble conversion
This moves the trigger points where AppleDouble file conversion is run by
ad_convert() from deep down the callchain in ad_read_rsrc_adouble() to high
level VFS entry points.

Currently ad_convert() will be triggered as part of open_file_ntcreate(...,
"file:AFP_AfpResource", ...): after SMB_VFS_OPEN() has been called with O_CREAT,
what created the file, we call SMB_VFS_FSTAT() on the just created
filehandle. This ends up in ad_convert(), finds the resource fork empty and thus
deletes the file.

This commit moves calling of the conversion funtion to the high level VFS entry
points where the converted metadata is needed:

o for directory enumerations SMB_VFS_READDIR_ATTR() is called to fill in the
  repurposed fields in the directory entry metadata

o obviously for SMB_VFS_CREATE_FILE() on an macOS stream

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13958

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-23 23:26:15 +00:00
Ralph Boehme
4777d1163a vfs_fruit: add a forward declaration for ad_get()
Will be needed in the next commit.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13958

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-23 23:26:14 +00:00
Andreas Schneider
2915125661 s3:vfs: Use GnuTLS MD5 in vfs_fruit
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-05-21 00:03:22 +00:00
Andreas Schneider
bb273a0053 s3:vfs: Use GnuTLS MD5 in vfs_streams_xattr
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-05-21 00:03:22 +00:00
Rikard Falkeborn
3a4f23636d vfs_gpfs: Fix return value if getting data fails
Returning -1 in a function with bool as return value type is the same
as returning true. Change to false to indicate the error.

Detected by the help of cppcheck.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-19 17:34:21 +00:00
Rikard Falkeborn
18965c0b84 vfs_catia: Fix return value in lock functions
Returning -1 in a function with bool as return value type is the same
as returning true. Change to false to indicate the error.

Detected by the help of cppcheck.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-19 17:34:21 +00:00
David Disseldorp
76f3b194c2 vfs: add ceph_snapshots module
vfs_ceph_snapshots is a module for accessing CephFS snapshots as
Previous Versions. The module is separate from vfs_ceph, so that it can
also be used atop a CephFS kernel backed share with vfs_default.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-14 22:17:32 +00:00
David Disseldorp
76d7d05b1d vfs_ceph: drop fdopendir handler
libcephfs doesn't currently offer an fdopendir equivalent, so the
existing implementation peeks at fsp->fsp_name->base_name, which can
break if vfs_ceph is used under a separate path-munging VFS module.

Return ENOSYS instead and rely on existing OpenDir_fsp() fallback.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-14 22:17:32 +00:00
David Disseldorp
21dc6f8e8d vfs_ceph: fix cephwrap_flistxattr() debug message
The @list buffer may be uninitialised prior to ceph_flistxattr()
invocation, so only log the address.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13940

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri May 10 12:59:05 UTC 2019 on sn-devel-184
2019-05-10 12:59:05 +00:00
Robert Sander
966fc0dc60 s3: modules: ceph: use current working directory instead of share path
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13918

Signed-off-by: Robert Sander <r.sander@heinlein-support.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May  2 19:34:11 UTC 2019 on sn-devel-184
2019-05-02 19:34:11 +00:00