[Samba] Inheriting Group Ownership on File Move

Nathan Fraser smbuser at otscorp.com
Thu Jan 9 02:44:01 GMT 2003


Hi,

Is it possible with samba to enforce the inheritance of group ownership on
a per-directory basis, for files moved without copying?

My situation is as follows:

  directory 'a' has permissions: 2770 (drwxrws---) and has
  owner = 'root' group = 'a'

  directory 'b' has permissions: 2770 (drwxrws---) and has
  owner = 'root' group = 'b'

As per setgid behaviour, any file created in either of those directories
will have the group id (except for superuser etc) inherited from the group
of the directory. this works great for most things except in one
circumstance:

When a windows user cuts and pastes a file (for example) from directory
'a' to directory 'b' then the group ownership is not changed. The file is
moved without re-creation, so the ownership is not changed.

In an Unix environment this is perfectly fine and the behaviour you
expect... but from the windows user's perspective it may not be correct.

If they were to copy, paste and then delete the original - then the group
is set. SO,

Is there any way within samba to alter the behaviour of file operations
that result in a move, so that the group id of the file is inherited from
the destination directory, when the destination directory has the SetGID
bit enabled? I know that you can set this on a per-share basis, but this
is not always convenient, and forcing all users to copy/paste/delete
instead of cut/paste (or move) is a difficult policy to maintain :/

Any information would be greatly appreciated.

Nathan.



More information about the samba mailing list