ad_convert_xattr() doesn't pass FILE_SHARE_DELETE to SMB_VFS_CREATE_FILE() and this might trigger a subtle NT_STATUS_SHARING_VIOLATION error. Not specifying FILE_SHARE_DELETE wasn't done intentionally. Not setting the flag triggers the following problem: * client sends a CREATE with delete access * this triggers a call to open_streams_for_delete() where we check for conflicting opens on any of the streams of the file or directory * if the file (or directory) has a stream like ":com.apple.quarantine" the stream is opened with DELETE_ACCESS and kept open when the next step might: * if the file (or directory) has a Mac specific :AFP_AfpInfo stream, the ad_convert() routine in fruit_create_file() is triggered * ad_convert() checks if the file (or ...) has a sidecar ._ AppleDouble file, if it has: * in ad_convert_xattr() we unpack any set of xattrs encoded in the AppleDouble file and recreate them as streams with the VFS. Now, if any of these xattrs happens to be converted to a stream that we still have open in open_streams_for_delete() (see above) we get a NT_STATUS_SHARING_VIOLATION This error gets passed up the stack back to open_streams_for_delete() so the client CREATE request fails and the client is unhappy. Have patch, need bugnumber...
This bug was referenced in samba master: 59eadfe21aca6d563f86ea656517216036421bca 9b91a8bad2ff8da9eb56f1f9d640bcea294a5a0a 06f0c070a0b18313f48362aa326e3e7e6a096492 55bd10456486628cad2bd085618e873598401c3b 3bf97f19c36d26b4178f7cb6202bbdd44de0c1aa
Created attachment 17898 [details] Patch for 4.17 and 4.18 cherry-picked from master
Re-assigning to Jule for inclusion in 4.18.next, 4.17.next.
Pushed to autobuild-v4-{18,17}-test.
This bug was referenced in samba v4-17-test: f544dc9cc069457bd1e911e692d28ad1d4e72a03 ed1979c76c6e75f168049fc9669e6e5250264af3 b0e8932b1cf94f1f43ac6eca29250a63bea66708 4e0850b7afc7ac383ddd6929e7b9d3836135564d a2567c172945a2b3fab6a7741d72d55503ba3ab6
This bug was referenced in samba v4-18-test: 976b4955570d34b8b013a7fd17f3551fbf105f83 051cd8f5915615bed9ff8756661afffb794e42b4 fe988c713798732b996de99684c73199ec68b70f 0db5f559d0ef883c975177a705e82ae4d0951c72 5c5ab78d93def900a91954e30fdb25aa1d5a3cdb
This bug was referenced in samba v4-18-stable (Release samba-4.18.3): 976b4955570d34b8b013a7fd17f3551fbf105f83 051cd8f5915615bed9ff8756661afffb794e42b4 fe988c713798732b996de99684c73199ec68b70f 0db5f559d0ef883c975177a705e82ae4d0951c72 5c5ab78d93def900a91954e30fdb25aa1d5a3cdb
Closing out bug report. Thanks!
This bug was referenced in samba v4-17-stable (Release samba-4.17.9): f544dc9cc069457bd1e911e692d28ad1d4e72a03 ed1979c76c6e75f168049fc9669e6e5250264af3 b0e8932b1cf94f1f43ac6eca29250a63bea66708 4e0850b7afc7ac383ddd6929e7b9d3836135564d a2567c172945a2b3fab6a7741d72d55503ba3ab6