1 |
On 10/02/2014 19:29, Alan McKinnon wrote: |
2 |
> On 10/02/2014 21:03, Walter Dnes wrote: |
3 |
>> >On Mon, Feb 10, 2014 at 05:09:55PM +0000, Stroller wrote |
4 |
>>> >> |
5 |
>>> >>On Mon, 10 February 2014, at 4:55 pm, Gleb Klochkov<glebiuskv@×××××.com> wrote: |
6 |
>>> >> |
7 |
>>>> >>>Hi. Try to use sudo with no password for eix-sync. |
8 |
>>> >> |
9 |
>>> >>I'd really rather not. Thanks, though. |
10 |
>> > |
11 |
>> > Being in group "portage" is not enough. That merely lets you do |
12 |
>> >emerges with "--pretend". "emerge --sync" modifies files in |
13 |
>> >/usr/portage. Files and directories in /usr/portage/ are user:group |
14 |
>> >root:root. Therefore you*NEED* root-level permission to modify them. |
15 |
> Not quite, it's not a cut and dried as that. If root chowns the files to |
16 |
> a regular user, and that user then syncs, ownership remains with the |
17 |
> user (as a regular user can't chown stuff and the owner must remain the |
18 |
> user regardless of what the master tree reckons the owning uid is). |
19 |
> |
20 |
> If the tree is then synced by root, well then all the problems come back |
21 |
|
22 |
It won't cause any problems. The effect of usersync is defined as thus: |
23 |
|
24 |
"Drop privileges to the owner of PORTDIR for emerge(1)." |
25 |
|
26 |
Hence, emerge --sync run as root will execute rsync as the portage user, |
27 |
assuming that PORTDIR is owned by that very same user. |
28 |
|
29 |
It can only be problematic if all of these conditions hold true: |
30 |
|
31 |
* usersync is enabled (as it is by default) |
32 |
* PORTDIR is owned by a non-root user |
33 |
* The ownership is not consistent across PORTDIR and its children |
34 |
|
35 |
As mentioned in a few other posts, recent snapshots are portage:portage |
36 |
throughout so it's a done deal for new installations. Those who still |
37 |
have it owned by root can benefit from usersync simply by running: |
38 |
|
39 |
# chown -R portage:portage "$(portageq envvar PORTDIR)" |
40 |
|
41 |
There is no subsequent requirement not to invoke emerge --sync as root. |
42 |
|
43 |
--Kerin |