[Samba] Who may delete a file ?

Pierre Dehaen dehaen at milano.drever.be
Tue Sep 10 15:17:00 GMT 2002


Hi All,

I was checking the access rights and a problem (hence a question) 
appeared: Who can delete a file through Samba ?

Suppose we have the following situation:
drwxrwxrwx   john   finance   directory
-rw-r--r--   jack   finance   directory/file

Under unix everyone can delete the file.

Under Samba, the documentation says (due to the Windows sementic) you 
also need the write access to the file to be able to delete it. The "delete 
readonly" option is set to "no" (default). John doesn't have the write access 
but:
- in the properties window, John won't see the Read-only attribute set;
- John can't update the file;
- and he can delete the file !

I don't consider the first point as normal but, okay, the "Using Samba" book 
that comes with Samba says in chapter 5 that:
"By default, Samba 2.0 sets this whenever a file does not have the Unix 
owner write permission bit set. In other words, you can set this bit by 
changing the permissions of the file to 555."

What I don't understand are the two other points: these are correct for the 
unix semantic, not for the DOS/Windows one ! But the same book says:
"DOS filesystems are not designed for multiple users, and so its designers 
decided that read-only means "protected against accidental change, 
including deletion," rather than "protected against some other user on a 
single-user machine." So the designers of DOS prohibited removal of a read-
only file. Even today, Windows file systems exhibit the same behavior."


The result of all this is that the "delete readonly" option is only useful to the 
owner of a file, not to anyone else !!!???

Do you have any idea how I could set the permissions so that a user has the 
rights to create a file in a directory but not to delete the files of other people ? 
I know about the stickybit, but it won't help on subdirectories created by users 
unless I enable the inherit option which leads me to other problems...

Thaks in advance,
Pierre






More information about the samba mailing list