Shell lockup with on tab completion of tar with --acls option

Bug #1426107 reported by Mike Matera
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)

Bug Description

Bash completion causes the shell to lockup when completing command lines for the TAR command. The following sequence of commands shows the problem:

# starting in an empty directory
mkdir foo
touch foo/bar
touch foo/bak
tar -cvf foo.tar <tab>
tar --acls -cvf foo.tar <tab>

After the last tab the shell is locked up permanently and is no longer usable. This only seems to happen when the --acls option is specified, though it may affect others too (I have only tried --acls).

Tags: patch
Revision history for this message
Mike Matera (fatboymaximus) wrote :

Digging into /usr/share/bash-completion/completions/tar I found some answers. Basically the completer doesn't understand the intent argument "-c" when the intent is not the first argument. That confused the program and it's trying to extract the index of a (nonexistant) tar file by running:

tar t foo.tar

Lacking the "f" argument TAR is reading from STDIN and that will hang us up forever. I tried CTRL-D but that didn't work.

Attached is a patch that works around the problem by blinding the completer when the first argument is --something. A better solution would be to fix the parser to understand arguments in any position but in the mean time it's better for my mental health not to crash.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Workaround patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Mike Matera (fatboymaximus) wrote :

I had the wrong package selected. This bug affect bash-completion. Sorry.

affects: nvidia-graphics-drivers-331 (Ubuntu) → bash-completion (Ubuntu)
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.