1 |
On Tuesday, September 15, 2015 10:25:15 PM Alan McKinnon wrote: |
2 |
> On 15/09/2015 22:09, james wrote: |
3 |
> > Hello, |
4 |
> > |
5 |
> > So looking at /etc/portage/repos.conf, it seems root.root owns these |
6 |
> > files; shouldn't it be portage.portage? and /usr/portage |
7 |
> > |
8 |
> > That got me thinking. Everywhere that portage operates or owns |
9 |
> > things, should the ownership not be portage.portage |
10 |
> > and what would the typical permissions be? |
11 |
> |
12 |
> Here, all of /etc/portage is root:root |
13 |
> The tree and all overlays are portage:portage |
14 |
> |
15 |
> You can make a local overlay owned by user you want, stuff you hack away |
16 |
> at yourself should probably be james:james or james:users |
17 |
> |
18 |
> Typically, permissions in /etc/portage are the usual 755 for dirs and |
19 |
> 644 for files |
20 |
> |
21 |
> I set overlays and the tree to be 2775 for dirs and 664 for files |
22 |
> |
23 |
> > |
24 |
> > Is there a master list I can look at? Surely root not own all |
25 |
> > these dirs, like /usr/portage/* ? My /usr/portage is root.root |
26 |
> > and 755 on permissions, is that right? |
27 |
> |
28 |
> Permissions should be what YOU need them to be on your computer. There's |
29 |
> a default, it's what portage makes them when you install stuff |
30 |
> |
31 |
> > |
32 |
> > If so, why? |
33 |
> |
34 |
> Only root should change the master config files in /etc, just like in |
35 |
> all other apps |
36 |
> IIRC emerge can drop privs to a user account, if that user is portage |
37 |
> then portage must own the files |
38 |
|
39 |
It is true that portage drops privileges to the portage account (unless the |
40 |
ebuild has RESTRICT="userpriv" or I think FEATURES="-userpriv" on make.conf) |
41 |
but it doesn't need to write to the portage tree except to the distfiles |
42 |
directory so I don't know of any reason to have everything owned by |
43 |
portage:portage if the perms are 755/644. |
44 |
|
45 |
Mine is owned by root:root because it got borked one time after a sync so I |
46 |
deleted it and copied from another box manually. The only problem I ever had |
47 |
is that a fetch failed, and I just chowned the distfiles dir to portage:portage |
48 |
to fix it. Only recently it was pointed to me on this list that it was supposed |
49 |
to be portage:portage. I never changed it back to portage:portage but I made a |
50 |
mental note not to forget about it in case of trouble, that way I'll learn why |
51 |
that's the default if/when something breaks :) Besides it offers some (limited) |
52 |
protection against an ebuild accidentally writing to your portage tree. |
53 |
|
54 |
> > |
55 |
> > In my /usr/local/portage and it's subdirs where I hack on many |
56 |
> > ebuild, portage.portage owns everything.....? |
57 |
> |
58 |
> Make your life easy, chaown that stuff to james |
59 |
|
60 |
I personally prefer root:root because I think it is more secure. If you let |
61 |
somebody use your account even for a minute s/he could modify an ebuild |
62 |
without a password to install whatever s/he wants next time you run an update. |
63 |
|
64 |
> > Curious, and I cannot remember ever looking at this.... |
65 |
> > |
66 |
> > |
67 |
> > James |
68 |
> > |
69 |
> > |
70 |
> > |
71 |
> > |
72 |
> |
73 |
> |
74 |
> |
75 |
|
76 |
-- |
77 |
Fernando Rodriguez |