Host completion does not use HOSTFILE

Bug #184175 reported by ojb
6
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

From bash manual:
       HOSTFILE
              Contains the name of a file in the same format as /etc/hosts
              that should be read when the shell needs to complete a hostname.
              The list of possible hostname completions may be changed while
              the shell is running; the next time hostname completion is
              attempted after the value is changed, bash adds the contents of
              the new file to the existing list. If HOSTFILE is set, but has
              no value, bash attempts to read /etc/hosts to obtain the list of
              possible hostname completions. When HOSTFILE is unset, the
              hostname list is cleared.

When HOSTFILE is specified and ~/.ssh/known_hosts exits the entries in $HOSTFILE is not used for completion.

The problem is '_known_hosts()' in /etc/bash_completion where it seems only entries from "known host files" are used. I'm not sure if this is intentional, but if it is, I'd like to file a complaint :-) If not I guess I'm in the right place.

I suggest that the result from know_hosts and $HOSTFILE should be merged.

Running Feisty, GNU bash, version 3.2.13(1)-release (i486-pc-linux-gnu)

ojb (olejorgenb)
description: updated
Mika Fischer (zoop)
Changed in bash-completion:
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bash-completion - 20060301-3ubuntu1

---------------
bash-completion (20060301-3ubuntu1) hardy; urgency=low

  * Bug fix upload (LP: #194860)
   - Fixed completion of filenames with spaces
   - Fixed completion of hostnames with scp
   - Fixed completion of filenames with scp
   - Fixed parsing of SSH config files to parse Host and HostName lines
     correctly. Previously "HostName host" lines were parsed as two hosts:
     "Name" and "host".
  * More bugfixes:
   - Fix tar completion to handle "tar rf" the same as "tar cf" (LP: #94407)
   - Complete .m4v and .M4V for media players (LP: #115224)
   - Complete .divx and .flv for media players (LP: #127605)
   - Complete all files for "gzip ... <" (LP: #127605)
   - Allow whitespace in front of GlobalKnownHostsFile etc. (LP: #128866)
   - Complete compressed files for vim (LP: #149494)
   - Always use /etc/hosts and $HOSTFILE for host completion too (LP: #184175)
  * Modify Maintainer value to match the DebianMaintainerField
    specification.

 -- Mika Fischer <email address hidden> Sat, 15 Mar 2008 19:46:17 +0100

Changed in bash-completion:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

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