Gentoo Archives: gentoo-user

From: james <wireless@×××××××××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: portage directory ownerships?
Date: Wed, 16 Sep 2015 02:20:36
Message-Id: loom.20150916T040345-954@post.gmane.org
In Reply to: Re: [gentoo-user] portage directory ownerships? by Fernando Rodriguez
1 Fernando Rodriguez <frodriguez.developer <at> outlook.com> writes:
2
3
4 > > Here, all of /etc/portage is root:root
5
6 This is what I have except for distfiles::
7 drwxrwxr-x 5 root portage 232K Sep 14 23:00 distfiles
8
9 root.portage ??? I guess portage does that. Fernando's explaination
10 seem plausible, I guess I'd have to look at the code (not today)
11 but this just seems strange to me that sys-apps/portage would do this...
12
13 > > The tree and all overlays are portage:portage
14
15 Mine are root.root but no harm, right? I guess I could change them
16 recursively to portage:portage but why, if portage is just going
17 to do what it wants anyway.
18
19
20
21 > > You can make a local overlay owned by user you want, stuff you hack away
22 > > at yourself should probably be james:james or james:users
23
24 Yea, I gonna think about /usr/local/portage. I see the convenience of
25 your suggestion, but I have always had most everthing portage:portage.
26 I cannot remember why though.....
27
28 > >
29 > > Typically, permissions in /etc/portage are the usual 755 for dirs and
30 > > 644 for files
31 > >
32 > > I set overlays and the tree to be 2775 for dirs and 664 for files
33
34 Yea, I have just let portage do what it wants and never really thought
35 about it before. This seem reasonable.
36
37
38 > > Permissions should be what YOU need them to be on your computer. There's
39 > > a default, it's what portage makes them when you install stuff
40
41 yep, it makes sense that sys-apps/portage is the master of these files,
42 I just never thought about it much before.
43
44
45 > > Only root should change the master config files in /etc, just like in
46 > > all other apps IIRC emerge can drop privs to a user account, if that
47 > > user is portage then portage must own the files
48
49 Ah. makes sense.
50
51 >
52 > It is true that portage drops privileges to the portage account (unless the
53 > ebuild has RESTRICT="userpriv" or I think FEATURES="-userpriv" on make.conf)
54
55 Nope these are not set on my make.conf (600) on permissions).
56
57 > but it doesn't need to write to the portage tree except to the distfiles
58 > directory so I don't know of any reason to have everything owned by
59 > portage:portage if the perms are 755/644.
60
61 Ah, this is whay my distfiles is root:portage.....?
62
63 >
64 > Mine is owned by root:root because it got borked one time after a sync so I
65 > deleted it and copied from another box manually. The only problem I ever had
66 > is that a fetch failed, and I just chowned the distfiles dir to
67 portage:portage
68 > to fix it. Only recently it was pointed to me on this list that it was
69 supposed
70 > to be portage:portage. I never changed it back to portage:portage but I
71 made a
72 > mental note not to forget about it in case of trouble, that way I'll learn
73 why
74 > that's the default if/when something breaks :) Besides it offers some
75 (limited)
76 > protection against an ebuild accidentally writing to your portage tree.
77
78 Interesting. I guess I could look at the code but everything is working
79 fine.
80
81
82 > > > In my /usr/local/portage and it's subdirs where I hack on many
83 > > > ebuild, portage.portage owns everything.....?
84 > >
85 > > Make your life easy, chaown that stuff to james
86 >
87 > I personally prefer root:root because I think it is more secure. If you let
88 > somebody use your account even for a minute s/he could modify an ebuild
89 > without a password to install whatever s/he wants next time you run an update.
90
91 I like Alan's simplicity. I also like root:root, like my /usr/portage,
92 but most of it is portage:portage, and that I did do. I just cant
93 remember why.
94
95 usr/local/portage/ is the one I need to think about.
96
97 Thanks for the feedback guys,
98 James

Replies

Subject Author
Re: [gentoo-user] Re: portage directory ownerships? Alan McKinnon <alan.mckinnon@×××××.com>