I'm quite amazed, that nobody complained about permisions 777. Why do you need these insanely elevated permisions? Why do you need execute bit anyway?
Let's say, that everybody accessing files should have read&write permissions. These users will be in group rwsamba. And the exported folder will be /data
So:
Create shared folder, change ownership and set sticky bit
mkdir /data
chown whoever:rwsamba /data
chmod 2770 /data
This will assure, that every new files and subdirectories in /data will belong to group rwsamba.
Configure samba to create files with 660 and directories with 2770 permisions
[shareme]
comment = Share me
browseable = yes
read only = no
create mask = 0660
directory mask = 2770
path = /data
Every user which will use samba has to belong to group rwsamba
And that should be all. New files and directories will have owner same as creator, group will be the rwsamba and everybody could read everything. Of course, being an owner gives me access to change permissions, so "skilled" user can mess with them. This can be fixed by telling samba to override owner of new files and directories:
force user = whoever