Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 260135 - ask for password when emerging as user
Summary: ask for password when emerging as user
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-24 14:58 UTC by Vittorio
Modified: 2009-03-01 14:08 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 Vittorio 2009-02-24 14:58:52 UTC
when a non-root user launches an emerge, a --pretend is appended at the end of the command; instead of doing this, it would be much more convenient if portage asked for proper user authentication (eg. asking root password, or user password if user is in sudoers)

if there are concerns about leaving this as default, it would be nice to have --auth flag that is appended instead of --pretend when user is in sudoers

Reproducible: Always

Actual Results:  
emerge prelink
 * Failed to change nice value to '-15'
 * [Errno 1] Operation not permitted

superuser access is required... adding --pretend to options.


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

Calculating dependencies... done!
[ebuild  N    ] sys-devel/prelink-20071009  892 kB

Total: 1 package (1 new), Size of downloads: 892 kB


Expected Results:  
emerge prelink
 * Failed to change nice value to '-15'
 * [Errno 1] Operation not permitted

superuser access is required... adding --pretend to options.


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

Calculating dependencies... done!
[ebuild  N    ] sys-devel/prelink-20071009  892 kB

Total: 1 package (1 new), Size of downloads: 892 kB
Enter superuser user password or Control-C to abort: **************

>>> Verifying ebuild manifests

[...]
Comment 1 Alec Warner (RETIRED) archtester gentoo-dev Security 2009-02-24 16:40:52 UTC
You don't want portage handling more authentication, trust me.  Install and use sudo/su or other tools to elevate privileges.
Comment 2 Alec Warner (RETIRED) archtester gentoo-dev Security 2009-02-24 16:46:11 UTC
er, not FIXED..what am I doing.
Comment 3 Alec Warner (RETIRED) archtester gentoo-dev Security 2009-02-24 16:46:29 UTC
Ok, coffee has cleared the brain.
Comment 4 Vittorio 2009-02-24 19:20:33 UTC
ok i understand that portage has already many privilege handlings but if so there may be other solutions

for example automatically prepend "sudo " to the emerge command or automatically create an alias to people in the portage group


usually you don't run programs with sudo, so it's common to forget and have to recall emerge; this may be quite annoying expecially if you just tried to emerge a package with many dependencies as it requires time. So you end with a root shell always open for portage work, which in my opinion is much worse than giving portage more priviledges.
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-02-25 05:23:19 UTC
(In reply to comment #4)
> ok i understand that portage has already many privilege handlings but if so
> there may be other solutions
> 
> for example automatically prepend "sudo " to the emerge command or
> automatically create an alias to people in the portage group
> 
> 
> usually you don't run programs with sudo, so it's common to forget and have to
> recall emerge; this may be quite annoying expecially if you just tried to
> emerge a package with many dependencies as it requires time. So you end with a
> root shell always open for portage work, which in my opinion is much worse than
> giving portage more priviledges.
> 

Hi,
How would prepending sudo to any emerge command be beneficial? It would still prompt you for your password unless you set up sudo to be password-less. In which case, your request is moot because you can easily do this yourself by using your shell's alias feature. In bash, you would do 'alias emerge="sudo emerge"' in ~/.bashrc. In both cases, there is the same security concern that you have by "leaving a root shell if a malicious user interrupts an emerge process" - which I would propose to solve by using your terminal's locking feature (ie. screen has this ability) - again, not a portage feature and it shouldn't be.

Alot of people rely on emerge backing down to --pretend, myself included. So, I am not in favor of this change which can easily be done without code changes.
Comment 6 Marius Mauch (RETIRED) gentoo-dev 2009-03-01 13:20:11 UTC
The original proposal is actually a CANTFIX as you'd need to set python as SUID, which is not an option in any way.
As for the sudo proposal, that should be handled by a custom wrapper script if you want it (or one of the community provided wrappers), as a portage-internal solution would have to deal with all kinds of situations (no sudo installed, sudo not configured, unexpected configurations, permission issues, ...) and such functionality IMO doesn't fit in the scope of a package manager.
Comment 7 Vittorio 2009-03-01 14:08:29 UTC
well the points expresses here are quite sensible
i guess a wrapper will have to do
thanks for motivating your points