[Samba] Deleting undeletable files gives no error

Gerald (Jerry) Carter jerry at samba.org
Fri Feb 24 18:48:56 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.


The problem was the new semantics used by explorer.exe in WinXP sp2
( and in later 2k or 2k3 hotfixes).  To delete a file from explorer,
the client opens the file with the delete-on-close bit set.
Previously it would simply call SMBunlink.  So previous we would
just ask trhe OS to delete the file on the behalf of the user and
the file system could say yes or no.  But now the client could open
the file with delete-on-close and later remove the d-o-c bit.

So we can't just immediately remove the file.  The only thing we
can do is check if the client would have permission to remove the
file.  Obviously the unlink could later fail and you get the
behavior you describe.  But there is no way to tell 100% if the
delete would fail at the time the file is opened.  The permission
check is close enough without all of the extra performance hits
from trying to catch every possible system specific corner case.





cheers, jerry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFD/1UYIR7qMdg1EfYRAvtZAJ90vQuutGl9K2iLRLZ97TBWHrHrEgCcC/Zx
P1U+JjrgA0yoi1avgkVbBic=
=SSzd
-----END PGP SIGNATURE-----


More information about the samba mailing list