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

Petr Uzel petr.uzel at suse.cz
Tue May 17 09:48:29 EDT 2011


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.


TODO:
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sudo-root_add_path-option.patch
Type: text/x-patch
Size: 4114 bytes
Desc: not available
URL: </pipermail/sudo-workers/attachments/20110517/0216f7c0/attachment.bin>


More information about the sudo-workers mailing list