Matt Pruett
2023-Jul-07 21:46 UTC
[Samba] Very strange issue copying only certain files to a share
I've been troubleshooting this issue for over a week and am running out of ideas. Generally everything works fine. I can copy files into the share, create and delete files and folders. However when copying *some* files from windows specifically it will say "The destination already has a file named "a"". A size 0 file by that name is then created. No files exist in the folder when I test this. 1. Renaming the file has no effect, in this case I renamed a pdf I'm having trouble with to the letter "a" with no extension. 2. Copying this file to a different windows system results in the same error 3. Renaming a different already working file to "a" and copying it into the share *works*. 4. Copying the problem files into the share from linux over smb works. 5. I also tried an entirely fresh standalone install of windows which has the same behavior, and also created a fresh test case with a simplified smb.conf to help narrow down the issue as seen below. 6. I've tested with and without selinux enforcing, however I have not gotten any selinux errors regardless, the share has been set to "samba_share_t" My test case is a fresh Fedora 38 server with Samba 4.18.4 ==> smb.conf: <=[global] workgroup = WORKGROUP security = user passdb backend = tdbsam disable netbios = yes printing = bsd printcap name = /dev/null load printers = no cups options = raw disable spoolss = yes log level = 3 # restrict anonymous = 2 # I tried restrict anonymous = 2 following a thread about permission issues related to anonymous access, but it didn't change the issue. [test] path = /srv/test read only = no valid users = jaadmin ==> Dir permissions <=$ ls -lZ /srv/ drwxr-xr-x. 2 jaadmin jaadmin unconfined_u:object_r:samba_share_t:s0 15 Jul 7 16:00 test ==> The size 0 file created on a failed copy <=# ls -lZ /srv/test/ -rwxr--r--. 1 jaadmin jaadmin system_u:object_r:samba_share_t:s0 0 Jul 7 16:38 a ==> log.smbd <=[2023/07/07 16:38:16.793627, 3] ../../source3/smbd/smb2_trans2.c:2151(smbd_do_qfsinfo) smbd_do_qfsinfo: level = 1007 [2023/07/07 16:38:16.795140, 3] ../../source3/smbd/smb2_server.c:3962(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_CANCELLED] || at ../../source3/smbd/smb2_notify.c:126 [2023/07/07 16:38:16.795705, 3] ../../source3/smbd/smb2_server.c:3962(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_CANCELLED] || at ../../source3/smbd/smb2_notify.c:126 [2023/07/07 16:38:16.798528, 2] ../../source3/smbd/open.c:1678(open_file) jaadmin opened file a read=Yes write=Yes (numopen=3) [2023/07/07 16:38:16.798643, 2] ../../source3/smbd/close.c:934(close_normal_file) jaadmin closed file a (numopen=2) NT_STATUS_OK [2023/07/07 16:38:16.798660, 3] ../../source3/smbd/smb2_server.c:3962(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_create.c:340 [2023/07/07 16:38:16.799052, 3] ../../source3/smbd/smb2_server.c:3962(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_OBJECT_NAME_COLLISION] || at ../../source3/smbd/smb2_create.c:340 [2023/07/07 16:38:16.799691, 3] ../../source3/smbd/smb2_server.c:3962(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_OBJECT_NAME_COLLISION] || at ../../source3/smbd/smb2_create.c:340 [2023/07/07 16:38:16.799996, 2] ../../source3/smbd/open.c:1678(open_file) jaadmin opened file a read=No write=No (numopen=3) [2023/07/07 16:38:16.800566, 2] ../../source3/smbd/close.c:934(close_normal_file) jaadmin closed file a (numopen=1) NT_STATUS_OK [2023/07/07 16:38:16.801578, 3] ../../source3/smbd/dir.c:1057(smbd_dirptr_get_entry) smbd_dirptr_get_entry mask=[*] found . fname=. (.) [2023/07/07 16:38:16.801612, 3] ../../source3/smbd/dir.c:1057(smbd_dirptr_get_entry) smbd_dirptr_get_entry mask=[*] found .. fname=.. (..) [2023/07/07 16:38:16.801642, 3] ../../source3/smbd/dir.c:1057(smbd_dirptr_get_entry) smbd_dirptr_get_entry mask=[*] found a fname=a (a) [2023/07/07 16:38:16.801668, 3] ../../source3/smbd/smb2_server.c:3962(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[5] status[STATUS_NO_MORE_FILES] || at ../../source3/smbd/smb2_query_directory.c:160 [2023/07/07 16:38:16.806348, 3] ../../source3/smbd/smb2_notify.c:251(smbd_smb2_notify_send) smbd_smb2_notify_send: notify change called on ., filter = DIR_NAME, recursive = 0 [2023/07/07 16:38:16.806622, 3] ../../source3/smbd/smb2_notify.c:251(smbd_smb2_notify_send) smbd_smb2_notify_send: notify change called on ., filter FILE_NAME|ATTRIBUTES|LAST_WRITE, recursive = 0 [2023/07/07 16:38:16.806677, 3] ../../source3/smbd/smb2_server.c:3962(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_CANCELLED] || at ../../source3/smbd/smb2_notify.c:126 [2023/07/07 16:38:16.807629, 3] ../../source3/smbd/smb2_server.c:3962(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_CANCELLED] || at ../../source3/smbd/smb2_notify.c:126 [2023/07/07 16:38:16.809659, 3] ../../source3/smbd/smb2_server.c:3962(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_OBJECT_NAME_COLLISION] || at ../../source3/smbd/smb2_create.c:340 [2023/07/07 16:38:16.810260, 3] ../../source3/smbd/smb2_server.c:3962(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_OBJECT_NAME_COLLISION] || at ../../source3/smbd/smb2_create.c:340 [2023/07/07 16:38:16.810599, 3] ../../source3/smbd/smb2_server.c:3962(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_OBJECT_NAME_COLLISION] || at ../../source3/smbd/smb2_create.c:340 [2023/07/07 16:38:16.810835, 2] ../../source3/smbd/open.c:1678(open_file) jaadmin opened file a read=No write=No (numopen=3) [2023/07/07 16:38:16.811233, 2] ../../source3/smbd/close.c:934(close_normal_file) jaadmin closed file a (numopen=1) NT_STATUS_OK [2023/07/07 16:38:16.811965, 3] ../../source3/smbd/dir.c:1057(smbd_dirptr_get_entry) smbd_dirptr_get_entry mask=[*] found . fname=. (.) [2023/07/07 16:38:16.811997, 3] ../../source3/smbd/dir.c:1057(smbd_dirptr_get_entry) smbd_dirptr_get_entry mask=[*] found .. fname=.. (..) [2023/07/07 16:38:16.812024, 3] ../../source3/smbd/dir.c:1057(smbd_dirptr_get_entry) smbd_dirptr_get_entry mask=[*] found a fname=a (a) [2023/07/07 16:38:16.812047, 3] ../../source3/smbd/smb2_server.c:3962(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[5] status[STATUS_NO_MORE_FILES] || at ../../source3/smbd/smb2_query_directory.c:160