select-editor needs fully qualified path to "update-alternatives"

Bug #282784 reported by Kees Cook
2
Affects Status Importance Assigned to Milestone
debianutils (Ubuntu)
Fix Released
Medium
Dustin Kirkland 

Bug Description

Binary package hint: debianutils

line 9 needs a fully qualified pathname:

  editors=`update-alternatives --list editor | wc -l`

else minimal PATH users will get errors when doing things like "crontab -e":

  $ crontab -e
  /usr/bin/select-editor: 9: update-alternatives: not found

it still ran fine, but the stderr warning should go away.

Related branches

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Patch attached.

:-Dustin

Changed in debianutils:
assignee: nobody → kirkland
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Patch updated, simplified.

:-Dustin

Revision history for this message
Matt Zimmerman (mdz) wrote :

How about adding /usr/sbin to PATH in the script rather than hardcoding the path to each binary?

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 282784] Re: select-editor needs fully qualified path to "update-alternatives"

On Wed, Oct 15, 2008 at 7:47 AM, Matt Zimmerman <email address hidden> wrote:
> How about adding /usr/sbin to PATH in the script rather than hardcoding
> the path to each binary?

That would be reasonable too, especially if there were may calls.
However, it's only two hits.

There's a couple of minor changes I'd like to make to this code, which
I'll do for Jaunty, and try again to get Debian to take the script
(they agreed in principle, but said "not right now").

:-DUstin

Revision history for this message
Colin Watson (cjwatson) wrote :

I was about to make the same comment as Matt. This is generally good practice and I think we should be doing this rather than hardcoding paths wherever possible, even for small numbers of uses.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Updated patch attached, per feedback.

:-Dustin

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package debianutils - 2.30ubuntu2

---------------
debianutils (2.30ubuntu2) jaunty; urgency=low

  * select-editor: add /usr/sbin to the PATH in select-editor,
    for update-alternatives LP: #282784.

 -- Dustin Kirkland <email address hidden> Fri, 21 Nov 2008 23:12:23 -0600

Changed in debianutils:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.