Bug 15610 - 4.20.0rc5: "NT_STATUS_ACCESS_DENIED closing remote file" when transfering files
Summary: 4.20.0rc5: "NT_STATUS_ACCESS_DENIED closing remote file" when transfering files
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
Depends on:
Reported: 2024-03-20 10:42 UTC by Marc Muehlfeld
Modified: 2024-03-25 16:24 UTC (History)
0 users

See Also:

Level 10 debug log (1.76 MB, text/plain)
2024-03-20 10:42 UTC, Marc Muehlfeld
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Muehlfeld 2024-03-20 10:42:39 UTC
Created attachment 18270 [details]
Level 10 debug log

If I transfer files with smbclient to a Samba 4.20.0rc5 server that runs on Fedora 40 nightly, the transfer complets (checksum are the same) but an error is shown:

NT_STATUS_ACCESS_DENIED closing remote file \<filename>


* Samba 4.20.0rc5, running as a standalone server
* Share is on an NTFS file system
* Share allows guest accounts

* Samba 4.20.0rc5 (but same problem with Samba 4.13.3)
* Connects to the server as guest

Steps to reproduce:

1. Create a file:
   $ dd if=/dev/zero of=test bs=1M count=256

2. Upload the file to the Samba server:
   $ smbclient -Uguest% //server/share
   smb: \> put test
   NT_STATUS_ACCESS_DENIED closing remote file \test

In a level 10 log, I find the following error:
[2024/03/20 11:26:51.445137, 10, pid=14882, effective(65534, 65534), real(65534, 0)] ../../source3/smbd/close.c:730(update_write_time_on_close)
  update_write_time_on_close: smb_set_file_time on file test returned NT_STATUS_ACCESS_DENIED
[2024/03/20 11:26:51.445193,  2, pid=14882, effective(65534, 65534), real(65534, 0)] ../../source3/smbd/close.c:934(close_normal_file)
  nobody closed file test (numopen=0) NT_STATUS_ACCESS_DENIED

Additonal information:
* I cannot reproduce the error if the share is on a non-NTFS volume.
* With Samba 4.19.5 on Fedora 39 (or all previous versions), I never had this problem. It came up after the switch to F40 with Samba 4.20.0rc5.