Can someone explain how samba handles permissions?

Mac dmccann at
Fri Sep 25 13:57:06 GMT 1998


>I have a directory called sigmaproj on my samba server; ls -la gives
>the following information:
>14 drwxrwxrwx  31 bkelly  users         6656 Sep 17 16:12 sigmaproj
>in this directory is a file:
>  2 -rw-r--r--   1 dvorak users         253 Jul  3 17:57 sigma.log
>As I understand it, any user should be able to delete the file sigma.log
>via a samba connection.  The Unix file system should allow the file to
>be deleted because all users have write privileges on the sigmaproj

100% correct.

>If I understand windows permissions correctly, I believe I should also
>be able to delete the file after clicking the OK button on a warning dialog

Also correct.

>      I find however, that samba users other than bkelly can not delete the
>file sigma.log.

Also true.

This is because Samba (in an effort to preserve DOS style semantics as
much as possible) actually ignores the directory permissions when
deleting a file, and treats the 'w' permission as DOS does the 'R'
attribute (with the sens reversed of course).

So, looking at your file 'sigma.log' above, we can see that users other
than bkelly don't have the UNIX 'w' permission, and so the file is deemed (by
Samba) to have the DOS 'R' attribute set.  (i.e. Samba treats the file
as if it's read-only).

In recent versions of Samba there is a configuration flag 'delete read
only' (or similar) which allows exactly this sort of operation.

          Assistant Systems Adminstrator
                        dmccann at
   Work: +44 1707 654753 x285      Everything else: +44 956 237670 (anytime)

More information about the samba mailing list