1 |
On Sat, 3 Oct 2015 10:40:42 +0200, Alan McKinnon wrote: |
2 |
|
3 |
> On 03/10/2015 10:26, Neil Bothwick wrote: |
4 |
> > On Fri, 2 Oct 2015 20:48:06 -0700, Raymond Jennings wrote: |
5 |
> > |
6 |
> >> Who is supposed to own /usr/portage? |
7 |
> > |
8 |
> > This was discussed in some detail two weeks ago. Search for the thread |
9 |
> > entitled "portage directory ownerships?". |
10 |
> > |
11 |
> > |
12 |
> |
13 |
> |
14 |
> There's an aspect of that we didn't discuss 2 weeks ago. |
15 |
> |
16 |
> The answer to the OP's question is, as always, "it depends". |
17 |
> From man 5 make.conf, section "FEATURES": |
18 |
> |
19 |
> userfetch |
20 |
> When portage is run as root, drop privileges to |
21 |
> portage:portage during the fetching of package |
22 |
> sources. |
23 |
> |
24 |
> userpriv |
25 |
> Allow portage to drop root privileges and compile |
26 |
> packages as portage:portage without a sandbox |
27 |
> (unless usersandbox is also used). |
28 |
> |
29 |
> usersandbox |
30 |
> Enable the sandbox in the compile phase, when run‐ |
31 |
> ning without root privs (userpriv). |
32 |
> |
33 |
> usersync |
34 |
> Drop privileges to the owner of ${repository_loca‐ |
35 |
> tion} for emerge(1) --sync operations. Note that |
36 |
> this feature assumes that all subdirectories of |
37 |
> ${repository_location} have the same ownership as |
38 |
> ${repository_location} itself. It is the user's |
39 |
> responsibility to ensure correct ownership, since |
40 |
> otherwise Portage would have to waste time validat‐ |
41 |
> ing ownership for each and every sync operation. |
42 |
> |
43 |
> |
44 |
> So logically, if user* is in FEATURES then $PORTDIR should be |
45 |
> portage:portage |
46 |
> If emerge --sync is done as user alan, then all repos ($PORTDIR, local |
47 |
> overlays, layman overlays) need to be owned by alan: |
48 |
> |
49 |
> if user* is not in FEATURES and everything gets run as root, then |
50 |
> PORTDIR, DISTDIR and so on can be root:root. |
51 |
|
52 |
That's interesting, but I think only the last one applies to $POSTDIR. |
53 |
userfetch applies to $DISTDIR, which may or may not be within $PORTDIR |
54 |
while the others relate to compiling so should only affect transient |
55 |
directories in $PORTAGE_TMPDIR. |
56 |
|
57 |
> The point is, there really isn't a "owner:group /should/ be" rule for |
58 |
> portage data, the admin needs to make it whatever he needs it to be. |
59 |
|
60 |
The default though is for all four of those features to be set, so |
61 |
you would expect $PORTDIR to be portage:portage, yet on this recent |
62 |
install it is root:root. The local portage mirror it syncs from is |
63 |
portage:portage. |
64 |
|
65 |
I'm beginning to think portage is female and all attempts to understand it |
66 |
are futile... |
67 |
|
68 |
|
69 |
-- |
70 |
Neil Bothwick |
71 |
|
72 |
Give a man a fish and you feed him for a day; teach him |
73 |
to use the Net and he won't bother you for weeks. |