Gentoo Archives: gentoo-user

From: hw <hw@×××××.de>
To: gentoo-user@l.g.o
Subject: how to share a directory tree with files in it with multiple users (Re: [gentoo-user] local shared directory)
Date: Sat, 23 Apr 2016 14:42:58
Message-Id: 571B89E5.7060108@gc-24.de
In Reply to: Re: [gentoo-user] local shared directory by hw
1 hw schrieb:
2 > Neil Bothwick schrieb:
3 >> On Thu, 17 Mar 2016 18:38:56 -0400, Rich Freeman wrote:
4 >>
5 >>>> umask is just not viable either, as a) it's global and affects all
6 >>>> files a user creates and b) by definition umask is modifiable by the
7 >>>> user (it's a feature to help users out so they don't need to chmod
8 >>>> every file every time) and c) you can't stop them doing it (by
9 >>>> design).
10 >>>
11 >>> Actually, this is completely viable. Just set the default umasks to
12 >>> 007, and create a new group for each user as their default group (and
13 >>> don't have all their home directories be owned by some users group).
14 >>> This is how this sort of situation was handled long before POSIX ACLs
15 >>> became common, and I know that some distros behave this way by default
16 >>> for this reason (this was the case in the distro I used right before I
17 >>> switched to Gentoo).
18 >>>
19 >>> If users chmod a file then tell them not to. If you must, set up some
20 >>> cron job to clean up after them.
21 >>>
22 >>> But, you can of course do this with ACLs as well. I haven't tried
23 >>> setting those up personally.
24 >>
25 >> I've done this with ACLs in the past, which is why I suggested it, but
26 >> it's a pain to set up if you haven't used them before. Alan's suggestion
27 >> of using inotify is probably simplest. Install incrond and put something
28 >> like this in a file in /etc/incron.d
29 >>
30 >> /shared/dir IN_CREATE,IN_MODIFY chmod g+w $#
31 >>
32 >>
33 >
34 > PS: How about subdirectories? The users sharing the directory can
35 > create and delete them as well, and files within them; yet incron
36 > ignores what happens in subdirectories.
37 >
38 > Using 'chmod -R g+w $#' isn't very appealing, and how safely does it
39 > handle file names?
40 >
41 >
42
43
44 PPS: Since it is impossible to share a local directory tree with
45 multiple users, I'm trying to use a directory tree on a server, which is
46 exported using samba and mounted by an entry in fstab. (I could also
47 use nfs, if it helps.)
48
49 That still doesn't work. How do I calculate an appropriate 'create
50 mask' for the smb.conf to at least force the files group writable? I
51 wouldn't even mind if all the files belonged to the same user. Or what
52 would I need to do?
53
54 Has it become entirely impossible to share a directory tree and the
55 files in it with multiple users when Linux is involved? This should be
56 a very simple thing to accomplish.

Replies