Gentoo Archives: gentoo-user

From: Alan McKinnon <alan@××××××××××××××××.za>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] permissions for a common folder
Date: Tue, 19 Sep 2006 12:29:22
Message-Id: 200609191423.44112.alan@linuxholdings.co.za
In Reply to: [gentoo-user] permissions for a common folder by "Stefán István"
1 On Tuesday 19 September 2006 13:53, Stefán István wrote:
2 > We have a file server, and there are a common directory for a
3 > group of a users. I set this common folder's permission to
4 > 2775 and that results that a newly created file or directory
5 > will have the same goup owner as the common dir. But the
6 > problem is, that if someone creates a file or a directory in
7 > this common folder, the permissions will be 644 or 755, and
8 > so the other users in the same group can't write that file or
9 > directory, only if the creator of the entry sets it manually
10 > to 664 or 775. Is there any way to tell the Linux to
11 > automatically set the rights to 664 or 775 in this common
12 > directory (and only in this)?
13 > This common dir is also shared with samba for the windows
14 > users, and in samba it is possible to set this.
15
16 Sorry, but it's not possible to do this with conventional Linux
17 permissions or NFS. The permissions of a newly created file
18 depend only on the hard-coded MODE (666 for files, 777 for
19 directories) and the user's umask. So, either the users have to
20 remember to set their umask, or use a different account with a
21 correct umask to access that dir (you could try two accounts
22 for each user with the same uid - it might work but I haven't
23 tried it out myself), or have the user chmod each new file they
24 make.
25
26 Thsi question came up on another list recently, and some
27 workarounds I thought up were variations on using cron, find
28 and chmod. Maybe there's some way you can hook fam and call a
29 script each time a file is newly created.
30
31 But the easiest way is to simply export the filesystem in a way
32 that does do what you want - samba. As long as the total number
33 of connectiosn through samba for Linux and windows clients
34 stays below some sane amount (I find 5-10 is usually about the
35 maximum) the file server will cope ok.
36
37 alan
38
39 --
40 gentoo-user@g.o mailing list