On 02/21/2012 09:15 PM, michael@actrix.gen.nz wrote:
Sorry - I've done some googling and testing. Although bind mount accepts a umask it doesn't apply it. To explain the concept here is an example of what I tried - the following does not work...
# mount --bind -o umask=0 /tmp /mnt/tmp2/ # touch /mnt/tmp2/xyz # ls -l /mnt/tmp2/xyz -rw-r--r-- 1 root root 0 Feb 22 07:39 /mnt/tmp2/xyz
Some file system types allow a umask to be specified, but not the standard ones (see man mount). So I don't think that will fly.
I wouldn't consider using inotifywait - its formatting options for filenames with spaces in them is difficult for shell scripts to process. And even worse, it claims to have bugs that can lead it to miss changes. It's a bit disappointing - only a toy. It would be a cool project to create something better.
So I think you are stuck with a looping shell script.
If you're really keen it would be possible to write a umask virtual filesystem using Linux fuse - but I guess you don't want to do any C programming. If you do I can supply some pointers (I've written collectfs - a fuse folder protecting file system, it collects any file clobbered or deleted by any process).
Interesting problem.
On Wed, 22 Feb 2012 04:46:59 lynn wrote:
On 02/21/2012 11:53 AM, michael@actrix.gen.nz wrote:
I've read that it's possible to set a umask option for a bind mount, so would remounting the folder be an option? I haven't tried it myself - but it might be worth a shot.
On Tue, 21 Feb 2012 00:39:42 lynn wrote:
Hi openSUSE 12.1 umask 0022
In a shared folder, we want any file created to be group rw. Using acls is not an option.
... Mmm. I can only change the umask globally. Can it be done on a per folder basis? L x
Hi There is an alternative using POSIX acl's to control the the creation of files:
setfacl -d -m g::rw /home/CACTUS/dropbox lynn2@hh3:/home/CACTUS> touch dropbox/h lynn2@hh3:/home/CACTUS> ls -la dropbox/ total 8 drwxrws---+ 2 root suseusers 4096 Feb 19 11:13 . drwxr-xr-x 9 root root 4096 Feb 19 11:11 .. -rw-rw---- 1 lynn2 suseusers 0 Feb 19 11:13 h The reason I need the script is because I'm exporting the directory over NFS and even though the acls are translated to nfs4 acl's correctly: mount -t nfs4 hh3:/home /mnt nfs4_getfacl /mnt/CACTUS/dropbox/ A::OWNER@:rwaDxtTcCy A::GROUP@:rwaDxtcy A::EVERYONE@:tcy A:fdi:OWNER@:rwaDxtTcCy A:fdi:GROUP@:rwaDtcy A:fdi:EVERYONE@:tcy the files on the mounted share are not created with rw permissions. lynn2@hh3:/mnt/CACTUS/dropbox> touch h3 gives: -rw-r----- 1 lynn2 suseusers 0 Feb 19 11:19 h2 I think this is a bug with the POSIX <--> nfs4 mapping. I have a thread open on nfs acls here, on the nfs-kernel list and on the Samba list but no luck as yet. It seems that no one has been here before. So yes, you are right. I am stuck with a workaround script:-( Thanks for your time, L x -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org