I am fairly sure you can do it with
smb.conf. I created such a thing in the past, on a SuSE Linux machine, without using
setgid/
setuid. I say "fairly sure" because I didn't test it thoroughly... just used it and had no complaints, and it was over 10 years ago.
Unlike using
setuid, the new directories created also have the same effect. With
setuid, those directories would also need to be
setgid/
setuid manually after they are created. I don't remember what options to use though... I scanned through the list (in man smb.conf) and here are my suggestions of what to try:
Most likely some of these:
Code:
create mask = 777
security mask = 777
directory mask = 777
directory security mask = 777
# yes means inherit from the directory rather than the user
inherit owner = yes
force user = nobody
force group = nobody
maybe also:
Code:
force create mode = 0777
force directory mode = 4777
force directory security mode = 4777
force security mode = 777
or maybe something slightly extreme/insane like:
Code:
dos filemode = yes
fstype = FAT (default is NTFS)
And currently, I have no dire need for something magically perfect like what I had before. The most similar thing I have now (originally on Linux samba sharing ext3, now Linux samba sharing the FreeBSD NFS zfs share) was set up like this:
Code:
[sharename]
path = /path/to/dir
writeable = yes
browseable = Yes
writeable = yes
create mask = 0664
directory mask = 0775
# Hide the .zfs directory so people can't view snapshots, which hangs ZFS on the NFS server (severe bug for which I haven't submitted a PR yet)
# Also, I bind-mounted /var/empty on top of the .zfs directory to hide it from local users
veto files = /.zfs/
and run once:
# chgrp -R bc /share/root/dir
The effect is that people can rename, move, and delete files that others created. I suppose it works because "bc" is the primary group for all users, not just simply added to supplimentary groups for all.
My simple thing I have now would fail if someone purposely changed permissions or ownership on a file, but nobody seems to do that.