Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 204020 - "emerge --pretend -vuDN world" gives different results for root or user
Summary: "emerge --pretend -vuDN world" gives different results for root or user
Status: VERIFIED NEEDINFO
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: AMD64 Linux
: High minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-02 04:53 UTC by Clinton V. Weiss
Modified: 2008-02-10 16:55 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
raise PermissionDenied instead of ignoring permission errors (eaccess.patch,433 bytes, patch)
2008-01-02 15:18 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Clinton V. Weiss 2008-01-02 04:53:27 UTC
emerge -pvuDN world gives different results if ran as a regular user than if ran as root.

Reproducible: Always

Steps to Reproduce:
1. Ensure you have some updates for emerge to process
2. Run "emerge -pvuDN world" as a regular user, view results.
3. Run "emerge -pvuDN world" as root or with sudo, view results.
4. Notice the difference.

Actual Results:  
Not all packages are listed that will be re-emerged.

Expected Results:  
All packages that will be re-emerged should be viewable.

Here is an example:

clinton@e521 ~ $ emerge -pvuDN world

These are the packages that would be merged, in order:

Calculating world dependencies... done!
[ebuild     U ] sys-apps/less-416 [409] USE="unicode" 288 kB

Total: 1 package (1 upgrade), Size of downloads: 288 kB
clinton@e521 ~ $ sudo emerge -pvuDN world
Password:

These are the packages that would be merged, in order:

Calculating world dependencies... done!
[ebuild     U ] sys-apps/less-416 [409] USE="unicode" 288 kB
[ebuild     U ] media-libs/freetype-2.3.5-r2 [2.3.4-r2] USE="X doc -bindist -debug -utils% (-zlib%*)" 1,347 kB
[ebuild     U ] net-misc/neon-0.26.4 [0.26.3] USE="kerberos%* nls ssl zlib -expat -socks5" 776 kB
[ebuild     U ] net-www/netscape-flash-9.0.115.0 [9.0.48.0-r1] 2,962 kB

Total: 4 packages (4 upgrades), Size of downloads: 5,371 kB
clinton@e521 ~ $
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2008-01-02 12:28:22 UTC
check permissions of files in /etc/portage, /var/lib/portage and /var/db/pkg  presumably some of them aren't readable by your user.
Comment 2 Clinton V. Weiss 2008-01-02 12:48:51 UTC
All files have user, group, and world permission for reading.  The only oddity I could find was that /usr/lib/portage could not be cd'ed into, but the files /usr/lib/portage/world and /usr/lib/portage/config could still be read.
Comment 3 Zac Medico gentoo-dev 2008-01-02 15:18:37 UTC
Created attachment 139874 [details, diff]
raise PermissionDenied instead of ignoring permission errors

With this patch applied, you should be notified of any config files that are unreadable due to permissions. If it's saved as /tmp/eaccess.patch then you can apply it as follows:

patch /usr/lib/portage/pym/portage_util.py /tmp/eaccess.patch
Comment 4 Clinton V. Weiss 2008-01-04 01:54:23 UTC
Applied that patch.  No change in behavior, no errors either.
Comment 5 7335520f 2008-01-04 03:49:40 UTC
It seems to matter whether the user is a member of the portage group.  The handbook says to make a user a member of the portage group if he is going to use "emerge --pretend"
Comment 6 Zac Medico gentoo-dev 2008-01-04 18:42:06 UTC
(In reply to comment #5)
> It seems to matter whether the user is a member of the portage group.  The
> handbook says to make a user a member of the portage group if he is going to
> use "emerge --pretend"

That was necessary with older versions of portage but it shouldn't be anymore. Users in the portage group are capable of interfering with portage so having users in that group is a security risk.
Comment 7 Zac Medico gentoo-dev 2008-01-04 18:54:08 UTC
(In reply to comment #0)
> Steps to Reproduce:
> 1. Ensure you have some updates for emerge to process
> 2. Run "emerge -pvuDN world" as a regular user, view results.
> 3. Run "emerge -pvuDN world" as root or with sudo, view results.
> 4. Notice the difference.

Please attach logs for #2 and #3 with --debug enabled.
Comment 8 Zac Medico gentoo-dev 2008-01-11 04:41:00 UTC
Please reopen with logs requested in comment #7.
Comment 9 Clinton V. Weiss 2008-02-10 16:55:29 UTC
(In reply to comment #8)
> Please reopen with logs requested in comment #7.
> 

This bug has not re-occurred.  If I ever do see it again I will attach logs.  Marking as closed for the time being.