Gentoo Archives: gentoo-dev

From: Rich Freeman <rich0@g.o>
To: gentoo-dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] GLEP81 and /home
Date: Sun, 19 Jan 2020 11:29:42
Message-Id: CAGfcS_nm4CqTBVP0bfpt0gX03-=0D7g-LepLefjhHuL8q=EnbA@mail.gmail.com
In Reply to: Re: [gentoo-dev] GLEP81 and /home by Michael Orlitzky
1 On Sat, Jan 18, 2020 at 9:50 PM Michael Orlitzky <mjo@g.o> wrote:
2 >
3 > On 1/18/20 7:21 PM, Rich Freeman wrote:
4 > > On Sat, Jan 18, 2020 at 6:38 PM Michael Orlitzky <mjo@g.o> wrote:
5 > >>
6 > >> But now users have to follow one more step (create /home/amavis) when
7 > >> setting up amavisd-new. Is the QA check really assuring a quality user
8 > >> experience here?
9 > >>
10 > >
11 > > Lots of daemons need a home directory for their users, and usually
12 > > they manage to get by in /var/lib. It really seems like a bad
13 > > practice to start having packages creating stuff in /home. Certainly
14 > > I don't want random daemons sticking stuff in /home, which I manage
15 > >
16 >
17 > * The daemon DOES NOT need a home directory for its user.
18 > * I DO NOT want to install anything to anyone's home directory.
19
20 My concern isn't with installing stuff to "anyone's home directory."
21 My concern is with creating ANYTHING in /home.
22
23 Daemons are local users. There is no guarantee that /home is a local
24 filesystem. Heck, there is no guarantee that /home is even mounted
25 when portage is running. Portage shouldn't be touching /home at all.
26 With stuff like automounted or encrypted home directories and
27 systemd-homed and so on it seems like it is even more important to
28 avoid sticking stuff in /home (and this is hardly something started by
29 systemd - stuff in /home that is non-static has been a thing for some
30 time - certainly it was happening in the 90s on some IRIX workstations
31 I used).
32
33 > * With respect to user.eclass, I'm proposing that /home be treated
34 > EXACTLY THE SAME as it always has been.
35
36 I'm not aware that it was ever considered good practice to stick stuff
37 in /home. I suspect it just wasn't on QA's radar in the past.
38
39 >
40 > All I want to do is *set* a user's home directory to /home/foo.
41
42 You don't just want to "set" it. You want to create the directory,
43 which is modifying the filesystem (otherwise, why have a .keepdir?).
44 And setting a home directory to something that doesn't exist doesn't
45 seem like an improvement unless it is /dev/null.
46
47 I get though that the daemon itself doesn't use the home directory,
48 and that you just want it for configuring other stuff it might launch.
49
50 > Spamassassin itself is a better example than amavis. We already set the
51 > spamd user's home directory to /home/spamd with user.eclass. We don't
52 > install anything there, and this works fine. If a human logs into that
53 > account and generates some configuration in ~/.spamassassin, then it's
54 > within the spirit of the FHS to have that data stored in /home.
55
56 Looks like we might have another package to deal with, and perhaps
57 others as well, depending on what comes out of this thread.
58
59 > Now, with GLEP 81, we get a QA warning for that, because the eclass
60 > installs a keepdir file there. I would like things to remain exactly as
61 > they are, with no QA warning. Otherwise, we have to tell users to move
62 > /home/spamd to /var/lib/spamd-home or something stupid like that. I can
63 > think of no good reason to do so.
64
65 Well, you won't get QA warnings from the tinderbox if the default home
66 isn't under /home. Users who already have the home there might get
67 warnings at install time. They can just ignore them. You could
68 output an einfo to explain the situation to the user. If they're fine
69 with /home then they can ignore the warning, and if they want to move
70 it they can do so.
71
72 I'll also note that GLEP 81 itself is silent on WHERE home directories
73 should be placed. If some sort of definitive answer comes out of this
74 thread the GLEP should probably be updated to reflect this, unless
75 there is a better place to put it. Seems like the fact that this
76 practice was undocumented in the past is part of how we got to where
77 we're at.
78
79 > > It seems like the straightforward solution is to stick everything in
80 > > /var/lib/amavis, and fix things so that everything has the right
81 > > permissions regardless of install order.
82 >
83 > Please stop telling people to do this. Calling chown on the live
84 > filesystem is rarely safe, and I already fixed one root exploit (bug
85 > 630836) in the amavisd-new ebuild from the last guy who tried to adjust
86 > wrong permissions after the fact.
87
88 That bug appears to be restricted. Perhaps it is embargoed? If not,
89 then it probably shouldn't be restricted, especially if already fixed
90 and GLSA'ed (and if it wasn't GLSA'ed then it isn't fixed, not that
91 this has anything to do with you most likely).
92
93 Portage should provide a safe mechanism to fix permissions. Or we
94 should just avoid nesting user home directories inside directories
95 that will be written to by that user.
96
97 If this is the same hard-linking concern as with tmpfiles.d then
98 somebody really just needs to fix POSIX. :) But as a workaround just
99 avoiding nesting seems like the simpler solution...
100
101 Just on a side note, I'm just stating an opinion here. I'm not in QA.
102 Nobody should be construing my posts as "telling people" to do
103 anything. And I do realize that you're just inheriting a situation
104 that goes back probably quite a long time - please don't take anything
105 as a personal criticism. Maybe this stuff wasn't entirely thought out
106 in the past, but going forward we should try to come up with the best
107 solution, and then try to find the most reasonable way to get from
108 here to there.
109
110 > > Another option is to have /var/lib/amavis/home and /var/lib/amavis/work.
111 >
112 > This is better-looking than /var/lib/amavis-home, but it's still
113 > violating the spirit of the FHS to avoid triggering a warning on a dummy
114 > file.
115
116 Do you have a more FHS-compliant suggestion? Clearly /home isn't
117 particularly FHS-compliant:
118
119 /home is a fairly standard concept, but it is clearly a site-specific
120 filesystem. The setup will differ from host to host.
121 Non-login accounts created for administrative purposes often have
122 their home directories elsewhere.
123
124 This actually seems like a bit of an FHS gap. IMO /var/lib is the
125 lesser evil here, but if there is something else more FHS-appropriate
126 that could work. FHS says that users shouldn't have to touch /var/lib
127 to configure a daemon, but as you've pointed out this isn't about
128 configuring the daemon itself, but rather helpers that it might run
129 after the user configures it to do so.
130
131 --
132 Rich

Replies

Subject Author
Re: [gentoo-dev] GLEP81 and /home Michael Orlitzky <mjo@g.o>