Setting separate default file and directory permissions

Hi,

This is a quick question, I have tried to find an answer but it’s been unsuccesful.

Is there a way to set different default permissions for files and for directories?

To illustrate better, let’s say I have a /project samba share. I want to configure that share so that new files created in it have the file permissions of 660, and new directories are created with 750.

I have thought of umask, acls, but I dont really know how to accomplish this.

Thanks in advance for your help.

Diego

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Just to be clear, that would allow any files created to be modified by
anybody who is either the group-owner (and probably the creator if
that’s the case) or a group-owner (member of the specified group), but
that would also mean that any directories created could only be
browsed/read by group-owner members. That may be a little strange,
since members of the group could modify files created, at the base
level, but could not create/delete files in any subdirectories because
the directory permissions did not allow the group-owner to write.

I guess this goes back to: what is your business need here? Maybe it
is, “Allow modification of files anywhere but only creation by
group-owners in this subdirectory” but that seems pretty strange without
an interesting story behind it.

Good luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQmXYFAAoJEF+XTK08PnB5esIQANawzNk+j6+8RjAv6ShnpadU
tXmmAUn7XSwpNiPkIUzLFPMqW6KluwAxCOIYL5Q5lYGFD4SIPzYKFgYAiCgeMhVs
Ngj3cxUkXfK4XQojZskphJhXgBVA1qg/ZUu2vqHHjtwc3Sgc5kwoGscjPEmaUrwE
fcXUYEqqXHrJEhU1TnnXJacly/RDXAzR58uKJzxj4jg3/X9ZH7eid9jo7kg+nqHg
XljK4rls+LGhx5t1bxsLsGzbnufwXjwyZ3CPb8MZmGBzL7kF6trCUQypyYcK1FIS
r/f6HezdIeqKdManoTCNfw5SVifm2ZzfHf0Kz8ExGOH75W67bKxcT/crCx2YQEyB
Td4GuNYkcuaXz0XP1ZXYYqD4iOauSJbMPI2/AiqWqrAfwmCj1SGkFHGRpTibc9zr
d50cD/JxG/9IFNPcxKt2t3mPpEPhoSasYeDbTSyq44ketY+lMuTtdmgMfwN/IeD+
cVT+OfB1n0HOlCZtMDnW+u8t/wKwfhA6u9zYf8yao1qE8EVPkXDoSOz1XfbuBD/+
mbE05ZlV+r24g9NHKiexYY3kUmNv0p0v3vdWSjpNz8BkysLtkdrrQOEF/jI8mdzU
jTTnAxGhSZ4y5b27TsM22KgG4HgSbS0c8hgEHYDR26r57ksXvXAxR0bo/Bs1g7+b
CWuvCyGVlPsef0Mr7z5r
=9m4i
-----END PGP SIGNATURE-----

Thank you,

It was solved by adding this to the smb.conf share block:

Mask for new files that are created;

create mask = 0660

mask for new directories that are created:

directory mask = 0750

Thanks.

Diego