[Samba] Deleting undeletable files gives no error

David Shaw dshaw at jabberwocky.com
Fri Feb 24 21:26:05 GMT 2006


On Fri, Feb 24, 2006 at 10:52:10AM -0800, Jeremy Allison wrote:
> On Fri, Feb 24, 2006 at 01:32:02PM -0500, David Shaw wrote:
> > 
> > Perhaps readonly is not the best example.  I'm concerned because the
> > same thing happens with any of the many reasons why unlink() might
> > fail.  For example, EIO from a hardware problem, EACCES because the
> > file has the immutable (uchg) or undeletable flag set, running over a
> > filesystem that has a notion of retention ("can't delete until 2007"),
> > etc.
> 
> There's nothing we can do about it other than look at the share and
> file permissions. In POSIX you can only know for sure if you are
> allowed to delete a file if you actually do the delete. Windows clients
> do the following option to delete :
> 
> open with delete intent -> set delete on close -> close.
> 
> They expect any error to be returned on the "open with delete intent"
> call, if we return an error on the close (when we actually do the
> delete) then they don't display that error to the client (as you
> have noticed).
> 
> The problem is that the action of setting the delete on close is
> separate from the open action, and can also be reversed by unsetting
> it. This means we can't just open and unlink on the "open with delete intent"
> request as would be natural under POSIX.
> 
> What we have is the best compromise we could create.

Thanks, for both you and Jerry.  That's a very clear explanation.

David


More information about the samba mailing list