Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 15893 - portage-2.0.47-r2, query operations don't work under non-root user
Summary: portage-2.0.47-r2, query operations don't work under non-root user
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High normal
Assignee: Nicholas Jones (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-17 23:07 UTC by Alastair Tse (RETIRED)
Modified: 2011-10-30 22:20 UTC (History)
3 users (show)

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


Attachments
strace of a failed non-root 'emerge -s liteamp' process (userlog.dump,609.04 KB, application/octet-stream)
2003-02-18 05:27 UTC, jochem prins
Details
strace of a failed non-root 'emerge -s liteamp' process (userlog.dump,609.04 KB, text/plain)
2003-02-18 05:27 UTC, jochem prins
Details
proposed patch (bug15893.patch,634 bytes, patch)
2003-02-20 16:41 UTC, Robert Coie (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alastair Tse (RETIRED) gentoo-dev 2003-02-17 23:07:49 UTC
With portage-2.0.46-r*, you could run : emerge -u -p world or other query 
functions, but since portage-2.0.47-r2, this will result in errors:

-- start quote --

mcvaio /usr/portage/media-sound/liteamp % emerge -p postgresql
 
These are the packages that I would merge, in order:
 
[postgresql-7.2.3-r1] bash: /fire/1/portage_tmp/portage/homedir/.bashrc:
Permission denied
rm: cannot remove `/fire/1/portage_tmp/portage/homedir': Permission denied
[postgresql-7.2.3-r1] bash: /fire/1/portage_tmp/portage/homedir/.bashrc:
Permission denied
rm: cannot remove `/fire/1/portage_tmp/portage/homedir': Permission denied
Calculating dependencies
 
aux_get(): (2) couldn't open cache entry for dev-db/postgresql-7.2.3-r1
               Check for syntax error or corruption in the ebuild.
 
!!! all ebuilds that could satisfy "postgresql" have been masked.
 
!!! Error calculating dependancies. Please correct.

-- end quote --

I guess this is a permissions thing, the question is: is this the intended
result? if so, then should we have a cleaner error message when run as a
non-root user.
Comment 1 jochem prins 2003-02-18 05:27:22 UTC
Created attachment 8418 [details]
strace of a failed non-root 'emerge -s liteamp' process

I don't know if this makes a difference, but in the past I only had the
features sandbox and ccache enabled. Right now these are my FEATURES="sandbox
ccache userpriv" in /etc/make.conf
Comment 2 jochem prins 2003-02-18 05:27:40 UTC
Created attachment 8419 [details]
strace of a failed non-root 'emerge -s liteamp' process

I don't know if this makes a difference, but in the past I only had the
features sandbox and ccache enabled. Right now these are my FEATURES="sandbox
ccache userpriv" in /etc/make.conf
Comment 3 Tobias Sager 2003-02-18 12:07:33 UTC
Try remerging postgresql.

Do you have a PORTDIR_OVERLAY defined?
Comment 4 Seth Chandler 2003-02-18 12:16:30 UTC
this isn't a postgresql problem, its a problem in the new portage....
Comment 5 Tobias Sager 2003-02-18 12:21:38 UTC
Correct. I just had the same.
Remerging the complaining packages helped...

I think it is because I merged the packages from my overlay-directory.
After deleting the ebuilds there it began complaining...(and is only complaining
about ebuilds I merged from there).
Comment 6 D Wollmann 2003-02-18 15:19:43 UTC
After merging the 2.0.47-r2 upgrade I encountered the same errors. Checking the perms on /var/tmp/portage, I noticed:

drwxrwxr-x  280 portage  portage      9944 Feb 18 11:32 /var/tmp/portage

Adding myself to the portage group seems to have solved the problem.

Unless I'm just applying a band-aid, the ebuild should probably be modified to emit a notice informing the admin that membership in the portage group is required for non-root users.
Comment 7 Tobias Sager 2003-02-18 16:53:00 UTC
I did that before, so it does not help me.

Anyway, when running emerge and no user portage exists, emerge informs you about that.
(It would be nice, if the user and group could be created then and there, just by saying 'yes' to that)
The portage-user and group is maybe more a thing for baselayout?

But it does not tell you, that any user using emerge does have to be in that group.
Comment 8 Alastair Tse (RETIRED) gentoo-dev 2003-02-18 19:13:47 UTC
adding my user to group portage did indeed solve problems i was having.
Comment 9 Alastair Tse (RETIRED) gentoo-dev 2003-02-19 15:32:16 UTC
correction to my last comment. adding myself to group portage didn't solve the 
problem. it seems that after running the same command as root generates the cache 
entries that the user didn't have permissions to.

so thus the next time i run the same command as the user, it doesn't have to creat the cache entries and hence it runs without error.
Comment 10 Robert Coie (RETIRED) gentoo-dev 2003-02-20 16:41:44 UTC
Created attachment 8549 [details, diff]
proposed patch

According to experiments and looking at the source of touch (1), it appears
that utime can be called with a second argument of NULL by anyone with write
permission on a file, but changing mtime to an arbitrary number can only be
done by the owner of the file.	This patch deletes stale cache files before
running "ebuild depend", so that they will be created by the uid running
portage, and the utime call will succeed.
Comment 11 Nicholas Jones (RETIRED) gentoo-dev 2003-02-21 01:31:14 UTC
fixed in cvs.
Comment 12 Nicholas Jones (RETIRED) gentoo-dev 2003-02-22 07:58:42 UTC
out shortly