[Samba] Re: Fw: share a folder rw, but not deletable?
Marco De Vitis
starless at supereva.it
Wed Mar 26 14:59:57 GMT 2003
On Wed, 26 Mar 2003 02:38:43 -0600, Brian Wiese wrote:
> I've tried setting the directories with the sticky bit (i) with "chattr +i
> dir/" and that didn't work... as now the users could not r/w data within
> the directory. I don't want the directories to be renamed or deleted.
I solved a similar situation this way: I changed the mode of all files
in the share to 666, and dirs to 1777 (that's 777 + sticky bit). This
means that anyone can read the contents of the share, but they cannot
delete or rename any file or directory and they cannot edit the contents
of any existing file (exception made for one user, the owner of all
files and dirs, who can do anything).
Anyway, everyone can add files and dirs, but I also used these two
options:
force create mode = 666
force directory mode = 1777
Then, every night, an automated script sets the privileged user as the
owner of all files and dirs in the share.
So, if someone adds a file or dir, he has the possibility to delete or
edit it for the whole day; then, the next day, the objects he added are
"locked" again, just like the rest of the share.
The only difference, in your case, might be if you want to allow users
to edit existing files. I do not have a solution for this... you might
remove the sticky bit from the directory containing the files to be
edited, but this will allow other users to also delete or rename subdirs
contained in the same dir.
--
Ciao,
Marco.
..."The Glimpse", Trilok Gurtu 1997
More information about the samba
mailing list