file permissions
Hi,
How would I setup a directory that would automatically set the permissions of files that are placed in that directory to rw for user, group, and others. At this time all the files that are being put into the directory are defaulting to rw for owner and r only for group and other.
Thanks,
Larry
[330 byte] By [
lheverly2] at [2007-11-25 23:21:35]

# 1
You have three options.
1) Set the umask of the user/process that will be creating the files in this directory. This is the easy way out, but not the smartest. Anytime the user/process creates a file anywhere, it will be world writeable.
2) Create a cron job that does a chmod on all files in that directory at some interval. There will be a brief period where the files won't have the correct permissions, and that depends on how often your cron job runs.
3) Use ACL's. This is probably the most elegant solution, but be forwarned that administering ACL's can quickly become a nightmare. Here is the command to set the ACL's up like you want them.
setfacl -s user::rwx,group::r-x,other:r-x,mask:r-x,\
default:user::rw-,default:group::rw-,default:other:rw-,default:mask:rw- \
yourdirectory
Dave
# 2
Using ACLs, how would you specify, for a specific user, default r-x permissions on new subdirectories and default r-- permissions on new files created in a directory. I can't seem to have both. If I specify default r-x permissions on the directory, both new subdirectories and new files get r-x permissions. Likewise, if I create default r-- permissions for the user, both new subdirectories and files receive r-- permissions for the user.
Thanks in advance,
Gerald