[sudo-users] [PATCH RFC RESEND] New option: root_add_path

Shane squindler at gmail.com
Tue May 17 10:08:26 EDT 2011


Doesn't "-i" solve this exact problem?  eg sudo -i fdisk

Unless I'm misinterpreting, your patch embeds within sudo a mechanism
for determining and appending roots path to the current path - that
seems contrary to sudo's purpose IMHO.

As a sys admin, I'd much prefer has sudo being less intuitive and
force explicit paths, rather than sudo perform some "magic" behind the


On 17 May 2011 23:19, Petr Uzel <petr.uzel at suse.cz> wrote:
> Hello,
> I did not get any feedback on this, so trying to resend; this time
> to sudo-users. Original mail:
> http://www.sudo.ws/pipermail/sudo-workers/2011-April/000667.html
> ----------------
> Hi all,
> The attached patch is an attempt to address the following:
> $ sudo fdisk -l
> Password:
> sudo: fdisk: command not found
> which happens if fdisk is installed in a directory not in a users
> PATH. The idea is to add new option, root_add_path, with which
> additional directories (besides what's in invoking users PATH) could
> be specified to be searched when looking up full path to the command.
> Motivated by:
> https://bugzilla.novell.com/show_bug.cgi?id=673669
> There might be reasons why distributions do not add /sbin,
> /usr/sbin to default PATH for non-root users, e.g. not to pollute
> shell completion results with commands not supposed to be run
> as regular user.
> I did not find any way how to achieve this without introducing new
> option.
> 1) root_add_path is probably a bad name for this option, but I
> couldn't invent anything more descriptive and sufficiently short.
> 2) for now, the root_add_path is simply appended to users path. While
> this works in theory, it would be probably better and cleaner to
> 'merge' the paths (remove duplicate directories, if there are any).
> Petr
> --
> Petr Uzel
> IRC: ptr_uzl @ freenode
> ____________________________________________________________
> sudo-users mailing list <sudo-users at sudo.ws>
> For list information, options, or to unsubscribe, visit:
> http://www.sudo.ws/mailman/listinfo/sudo-users

More information about the sudo-users mailing list