Bug 11011 - No error shown when deleting a file from Read-Only file system
No error shown when deleting a file from Read-Only file system
Status: RESOLVED WONTFIX
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services
4.1.13
All All
: P5 normal
: ---
Assigned To: Samba QA Contact
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-16 13:15 UTC by Raghavendra Talur
Modified: 2015-01-07 13:28 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raghavendra Talur 2014-12-16 13:15:45 UTC
Create a xfs partition.
Mount it read-write permissions and create some files on it.
Unmount it and remount with read only mode now.
Create a share in smb.conf for the xfs partition now mounted read only.

[xfsshare]
path = /mount/path
read only = no
guest ok = yes

Now access the share using Windows 7.
Delete one of the files previously created with Shift+Del.
The file disappears without any error.
The file is however not deleted in the backend and comes back again after
the Windows Cache expires.
Comment 1 Volker Lendecke 2014-12-16 13:33:30 UTC
To properly show an error message we need to do a user-space check whether we are allowed to delete a file. However, we can't tell if the file we are trying to delete is on a readonly file system. We get an error message at unlink(2) time, but for the Windows GUI that's too late. Not sure how to properly handle this.
Comment 2 Jeremy Allison 2014-12-17 22:24:45 UTC
Raghavendra,

If you can figure out a way to detect a read-only filesystem at open() call time, I'm willing to reopen this one.

You need to add code inside can_delete_file_in_directory() to detect the read-only filesystem given the path - and it has to be efficient.

Until then I'm going to close this one out, sorry.

Jeremy.
Comment 3 Raghavendra Talur 2014-12-19 06:09:35 UTC
I will work on a patch as per Jeremy's idea.
Till I get that done, I agree that we can keep this bug closed.

Thanks for the comments Volker and Jeremy.