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 [...]
You don't want portage handling more authentication, trust me. Install and use sudo/su or other tools to elevate privileges.
er, not FIXED..what am I doing.
Ok, coffee has cleared the brain.
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.
(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.
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.
well the points expresses here are quite sensible i guess a wrapper will have to do thanks for motivating your points