[sudo-users] [PATCH RFC RESEND] New option: root_add_path
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:
> I did not get any feedback on this, so trying to resend; this time
> to sudo-users. Original mail:
> Hi all,
> The attached patch is an attempt to address the following:
> $ sudo fdisk -l
> 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:
> 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
> 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 Uzel
> IRC: ptr_uzl @ freenode
> sudo-users mailing list <sudo-users at sudo.ws>
> For list information, options, or to unsubscribe, visit:
More information about the sudo-users