s3:modules:fruit - skip resource unlink on POSIX paths
requested to merge samba-team/devel/samba:anodos325-s3-modules-fruit-skip-rsrc-unlink-on-posix-paths into master
User provided corefile where smbd crashed with "assert failed: smb_fname->stream_name == NULL
due to is_named_stream() check in streams_xattr_unlink_internal() for following smb filename:
$1 = {base_name = 0x81b158520 "<redacted>", stream_name = 0x81b1585f0 ":AFP_Resource", original_lcomp = 0x0, flags = 4, st = {st_ex_dev = 0, st_ex_ino = 0, st_ex_file_id = 0,
st_ex_mode = 0, st_ex_nlink = 0, st_ex_uid = 0, st_ex_gid = 0, st_ex_rdev = 0, st_ex_size = 0, st_ex_atime = {tv_sec = 0, tv_nsec = 0}, st_ex_mtime = {tv_sec = 0, tv_nsec = 0}, st_ex_ctime = {tv_sec = 0, tv_nsec = 0}, st_ex_btime = {tv_sec = 0, tv_nsec = 0},
st_ex_itime = {tv_sec = 0, tv_nsec = 0}, st_ex_blksize = 0, st_ex_blocks = 0, st_ex_flags = 0, st_ex_iflags = 0}}
Basically, this appears to be an edge-case configuration where fruit:resource = stream
and we're doing a POSIX unlink on a POSIX path. vfs_fruit keeps same flags as main data stream when creating a temporary SMB filename struct for unlinking a resource fork in fruit_unlink_internal().
Solution is a little hackish. My assumption is that for the most part the module providing streams will be streams_xattr and therefore streams don't need to be deleted separately.
Checklist
-
Commits have Signed-off-by:
with name/author being identical to the commit author -
(optional) This MR is just one part towards a larger feature. -
(optional, if backport required) Bugzilla bug filed and BUG:
tag added -
Test suite updated with functionality tests -
Test suite updated with negative tests -
Documentation updated -
CI timeout is 3h or higher (see Settings/CICD/General pipelines/ Timeout)
Reviewer's checklist:
-
There is a test suite reasonably covering new functionality or modifications -
Function naming, parameters, return values, types, etc., are consistent and according to README.Coding.md
-
This feature/change has adequate documentation added -
No obvious mistakes in the code