Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 493770 - =sys-apps/portage-2.2.7 binpkgs made by a non-root user are installed with user id of the non-root user
Summary: =sys-apps/portage-2.2.7 binpkgs made by a non-root user are installed with us...
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Binary packages support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-09 17:06 UTC by Joakim Tjernlund
Modified: 2023-08-24 20:37 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Tjernlund 2013-12-09 17:06:52 UTC
Building a binary package using a normal user(non root) makes portage
to install the package with the same user as owner of the files installed.
This feels like a bug to me although I am not sure.

portage 2.2.7
Comment 1 Alex Xu (Hello71) 2013-12-09 18:32:21 UTC
it is not possible for non-root users to use chown for security reasons.

http://unix.stackexchange.com/questions/27350/why-cant-a-normal-user-chown-a-file
Comment 2 Joakim Tjernlund 2013-12-09 18:38:02 UTC
hmm, I think you misunderstand. As user jocke I build a binary pgk which will
install stuff under /opt but I won't atually merge the package.

Then on another machine I merge the binary pkg(as root) but the
files installed under /opt is still owned by user jocke
Comment 3 Alex Xu (Hello71) 2013-12-09 18:40:33 UTC
oh, I see.

I don't think it's actually possible for portage to do this, since it only "snapshots" the files as they are after src_install.
Comment 4 Joakim Tjernlund 2013-12-09 20:22:09 UTC
Still feels like a bug.
I can do as a normal user "ebuild mypkg install" and then as root
"ebuild mypkg merge" and that will work.
Binary pkgs should be able to do the same I think.

Perhaps fakeroot could be employed to help here?
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2013-12-10 11:08:51 UTC
(In reply to Joakim Tjernlund from comment #4)
> I can do as a normal user "ebuild mypkg install" and then as root
> "ebuild mypkg merge" and that will work.

Don't do that.

ebuild(1) was superseded by emerge(1) a very long time ago.
Comment 6 Alex Xu (Hello71) 2013-12-10 12:34:37 UTC
... you're missing the point.

reporter was trying to explain why my reason was wrong.

the initial report is still correct, AFAIK.
Comment 7 Joakim Tjernlund 2013-12-10 12:39:22 UTC
(In reply to Jeroen Roovers from comment #5)
> (In reply to Joakim Tjernlund from comment #4)
> > I can do as a normal user "ebuild mypkg install" and then as root
> > "ebuild mypkg merge" and that will work.
> 
> Don't do that.
> 
> ebuild(1) was superseded by emerge(1) a very long time ago.

ebuild(1) obsolete? It is part of portage and nowhere it is mentioned
the ebuild is obsolete AFAIK. I don't even know how to create
Manifest without using ebuild.

Pehaps you meant something else?
Anyhow emerge --buildpkgonly dev-libs/check as normal user
and then emerge -K dev-libs/check as root behave the same:
All files installed by emerge has owner/group from the normal
user.
Comment 8 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-02-02 00:43:41 UTC
Can you in the future use the guided interface for reporting?

Reproducibility: Always
Reproducement: 1. Create binpkg as non-root user. 2. Install binpkg elsewhere.

Actual results: The user ID of the non-root user is used during install.
Expected results: The correct user ID as like an emerge should be used instead.

Third time, good time?