Bash-completion bug in "modprobe -r" (awk syntax error)

Bug #316654 reported by Jon Sahlberg
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Fix Released
Colin Watson

Bug Description

Binary package hint: bash-completion

In bash try "modprobe -r /<tab>" (in which <tab> means pressing the <tab> key to auto complete.
I get an errornous output "awk: line 1: syntax error at or near )".
What should happen is file/directory name should be completed (even if/when "modprobe -r" expects a module name as parameter). There shouldn't be an error message (not before user press <enter>.

The bug does not occur when doing other modprobe functions eg "modprobe /<tab>" or "modprobe -l /<tab>".
It seems the key to failure is the parameter '-r' and '/' sign in the beginning of "module name".

Tested in two Ubuntu hardy 8.04 32bit desktop and one Ubuntu Intrepid 8.10 64bit server.

Ubuntu 8.04.1 32bit:
$ apt-cache policy bash-completion
  Installed: 20060301-3ubuntu3
  Candidate: 20060301-3ubuntu3
  Version table:
 *** 20060301-3ubuntu3 0
        500 hardy/main Packages
        100 /var/lib/dpkg/status

Ubuntu 8.10 64bit:
~$ apt-cache policy bash-completion
  Installed: 20060301-4ubuntu1
  Candidate: 20060301-4ubuntu1
  Version table:
 *** 20060301-4ubuntu1 0
        500 intrepid/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
Florian Diesch (diesch) wrote :

Thanks for reporting this bug and any supporting documentation. Since this bug has enough information provided for a developer to begin work, I'm going to mark it as confirmed and let them handle it from here. Thanks for taking the time to make Ubuntu better!

Changed in bash-completion:
status: New → Confirmed
Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

Here is a debdiff that fixes it for Jaunty.

Changed in bash-completion:
importance: Undecided → Low
status: Confirmed → Triaged
Colin Watson (cjwatson)
Changed in bash-completion:
assignee: nobody → kamion
Revision history for this message
Colin Watson (cjwatson) wrote :

I think it would be simpler to just move the */* check from immediately below to above the 'modprobe -r' check, but otherwise this looks good, thanks. I'll forward it to Debian and upload shortly.

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

Collin, oh your are right. I was a bit confused at this point, but now I realise that there is a "return 0" in each block which prevents the others blocks from being executed.

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

This bug was fixed in the package bash-completion - 20080705ubuntu2

bash-completion (20080705ubuntu2) jaunty; urgency=low

  * modprobe: Check for */* before checking for 'modprobe -r', to avoid
    spewing an awk syntax error (thanks, Martin Mai; LP: #316654).

 -- Colin Watson <email address hidden> Wed, 21 Jan 2009 18:33:06 +0000

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

Other bug subscribers